File tree Expand file tree Collapse file tree
sentry_sdk/integrations/google_genai Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929from sentry_sdk .consts import OP , SPANDATA
3030from sentry_sdk .scope import should_send_default_pii
3131from sentry_sdk .traces import StreamedSpan
32- from sentry_sdk .tracing_utils import has_span_streaming_enabled
32+ from sentry_sdk .tracing_utils import (
33+ has_span_streaming_enabled ,
34+ should_truncate_gen_ai_input ,
35+ )
3336from sentry_sdk .utils import (
3437 capture_internal_exceptions ,
3538 event_from_exception ,
@@ -921,9 +924,9 @@ def set_span_data_for_request(
921924 client = sentry_sdk .get_client ()
922925 scope = sentry_sdk .get_current_scope ()
923926 messages_data = (
924- normalized_messages
925- if client .options . get ( "stream_gen_ai_spans" , False )
926- else truncate_and_annotate_messages ( normalized_messages , span , scope )
927+ truncate_and_annotate_messages ( normalized_messages , span , scope )
928+ if should_truncate_gen_ai_input ( client .options )
929+ else normalized_messages
927930 )
928931 if messages_data is not None :
929932 set_data_normalized (
You can’t perform that action at this time.
0 commit comments