Skip to content

Commit cdcdf4d

Browse files
Merge branch 'webb/gen-ai-v2' into webb/remove-truncation
2 parents ffb339f + 5889ad9 commit cdcdf4d

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

sentry_sdk/consts.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,6 +1218,7 @@ def __init__(
12181218
before_send_metric: "Optional[Callable[[Metric, Hint], Optional[Metric]]]" = None,
12191219
org_id: "Optional[str]" = None,
12201220
strict_trace_continuation: bool = False,
1221+
stream_gen_ai_spans: bool = False,
12211222
) -> None:
12221223
"""Initialize the Sentry SDK with the given parameters. All parameters described here can be used in a call to `sentry_sdk.init()`.
12231224
@@ -1633,6 +1634,9 @@ def __init__(
16331634
but you can provide it explicitly for self-hosted and Relay setups. This value is used for
16341635
trace propagation and for features like `strict_trace_continuation`.
16351636
1637+
:param stream_gen_ai_spans: When set, generative AI spans are sent in a new transport format to
1638+
reduce downstream data loss.
1639+
16361640
:param _experiments:
16371641
"""
16381642
pass

sentry_sdk/tracing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ def finish(
10421042

10431043
finished_spans = []
10441044
has_gen_ai_span = False
1045-
if client.options["_experiments"].get("stream_gen_ai_spans", False):
1045+
if client.options.get("stream_gen_ai_spans", False):
10461046
for span in self._span_recorder.spans:
10471047
if span.timestamp is None:
10481048
continue

0 commit comments

Comments
 (0)