Skip to content

Commit 5a5f81d

Browse files
.
1 parent 0f53ac0 commit 5a5f81d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

sentry_sdk/tracing_utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,15 @@ def has_span_streaming_enabled(options: "Optional[dict[str, Any]]") -> bool:
116116
return (options.get("_experiments") or {}).get("trace_lifecycle") == "stream"
117117

118118

119+
def should_truncate_gen_ai_input(options: "Optional[dict[str, Any]]") -> bool:
120+
if options is None:
121+
return True
122+
123+
return not options.get(
124+
"stream_gen_ai_spans", False
125+
) and not has_span_streaming_enabled(options)
126+
127+
119128
@contextlib.contextmanager
120129
def record_sql_queries(
121130
cursor: "Any",

0 commit comments

Comments
 (0)