Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions sentry_sdk/ai/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,10 @@ def truncate_and_annotate_messages(
scope: "Any",
max_single_message_chars: int = MAX_SINGLE_MESSAGE_CONTENT_CHARS,
) -> "Optional[List[Dict[str, Any]]]":
client = sentry_sdk.get_client()
if client.options["_experiments"].get("stream_gen_ai_spans", False):
return messages
Comment thread
alexander-alderman-webb marked this conversation as resolved.
Comment thread
alexander-alderman-webb marked this conversation as resolved.

if not messages:
return None

Expand All @@ -761,6 +765,10 @@ def truncate_and_annotate_embedding_inputs(
scope: "Any",
max_bytes: int = MAX_GEN_AI_MESSAGE_BYTES,
) -> "Optional[List[Dict[str, Any]]]":
client = sentry_sdk.get_client()
if client.options["_experiments"].get("stream_gen_ai_spans", False):
return messages

if not messages:
return None

Expand Down
Loading
Loading