Skip to content

Commit 5e286ed

Browse files
authored
Merge branch 'potel-base' into ivana/potel/port-sample-rate-update
2 parents 7842236 + 1fc4f85 commit 5e286ed

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/integrations/anthropic/test_anthropic.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -528,9 +528,9 @@ def test_streaming_create_message_with_input_json_delta(
528528
assert span["data"][SPANDATA.AI_INPUT_MESSAGES] == _serialize_span_attribute(
529529
messages
530530
)
531-
assert span["data"][SPANDATA.AI_RESPONSES] == _serialize_span_attribute([
532-
{"type": "text", "text": "{'location': 'San Francisco, CA'}"}
533-
]) # we do not record InputJSONDelta because it could contain PII
531+
assert span["data"][SPANDATA.AI_RESPONSES] == _serialize_span_attribute(
532+
[{"type": "text", "text": "{'location': 'San Francisco, CA'}"}]
533+
) # we do not record InputJSONDelta because it could contain PII
534534

535535
else:
536536
assert SPANDATA.AI_INPUT_MESSAGES not in span["data"]
@@ -667,9 +667,9 @@ async def test_streaming_create_message_with_input_json_delta_async(
667667
assert span["data"][SPANDATA.AI_INPUT_MESSAGES] == _serialize_span_attribute(
668668
messages
669669
)
670-
assert span["data"][SPANDATA.AI_RESPONSES] == _serialize_span_attribute([
671-
{"type": "text", "text": "{'location': 'San Francisco, CA'}"}
672-
]) # we do not record InputJSONDelta because it could contain PII
670+
assert span["data"][SPANDATA.AI_RESPONSES] == _serialize_span_attribute(
671+
[{"type": "text", "text": "{'location': 'San Francisco, CA'}"}]
672+
) # we do not record InputJSONDelta because it could contain PII
673673

674674
else:
675675
assert SPANDATA.AI_INPUT_MESSAGES not in span["data"]
@@ -832,10 +832,10 @@ def test_add_ai_data_to_span_with_input_json_delta(sentry_init, capture_events):
832832
assert len(event["spans"]) == 1
833833
(span,) = event["spans"]
834834

835-
assert span["data"][SPANDATA.AI_RESPONSES] == _serialize_span_attribute([
836-
{"type": "text", "text": "{'test': 'data','more': 'json'}"}
837-
])
838-
assert span["data"]["ai.streaming"] == True
835+
assert span["data"][SPANDATA.AI_RESPONSES] == _serialize_span_attribute(
836+
[{"type": "text", "text": "{'test': 'data','more': 'json'}"}]
837+
)
838+
assert span["data"]["ai.streaming"] is True
839839
assert span["measurements"]["ai_prompt_tokens_used"]["value"] == 10
840840
assert span["measurements"]["ai_completion_tokens_used"]["value"] == 20
841841
assert span["measurements"]["ai_total_tokens_used"]["value"] == 30

0 commit comments

Comments
 (0)