File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66from sentry_sdk .ai .utils import (
77 get_start_span_function ,
88 set_data_normalized ,
9- truncate_and_annotate_embedding_inputs ,
109)
1110from sentry_sdk .consts import SPANDATA
1211from sentry_sdk .integrations import DidNotEnable , Integration
@@ -82,22 +81,14 @@ def _input_callback(kwargs: "Dict[str, Any]") -> None:
8281 # For embeddings, look for the 'input' parameter
8382 embedding_input = kwargs .get ("input" )
8483 if embedding_input :
85- scope = sentry_sdk .get_current_scope ()
86- # Normalize to list format
8784 input_list = (
8885 embedding_input
8986 if isinstance (embedding_input , list )
9087 else [embedding_input ]
9188 )
92- messages_data = truncate_and_annotate_embedding_inputs (
93- input_list , span , scope
94- )
95- if messages_data is not None :
89+ if input_list is not None :
9690 set_data_normalized (
97- span ,
98- SPANDATA .GEN_AI_EMBEDDINGS_INPUT ,
99- messages_data ,
100- unpack = False ,
91+ span , SPANDATA .GEN_AI_EMBEDDINGS_INPUT , input_list , unpack = False
10192 )
10293 else :
10394 # For chat, look for the 'messages' parameter
You can’t perform that action at this time.
0 commit comments