Skip to content

Commit e5f9884

Browse files
committed
test(anthropic) fix test_set_output_data_with_input_json_delta
1 parent 9c52cd6 commit e5f9884

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/integrations/anthropic/test_anthropic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -823,19 +823,19 @@ def test_set_output_data_with_input_json_delta(sentry_init):
823823
with start_transaction(name="test"):
824824
span = start_span()
825825
integration = AnthropicIntegration()
826-
826+
json_deltas = ["{'test': 'data',", "'more': 'json'}"]
827827
_set_output_data(
828828
span,
829829
integration,
830830
model="",
831831
input_tokens=10,
832832
output_tokens=20,
833-
content_blocks=["{'test': 'data',", "'more': 'json'}"],
833+
content_blocks=[{"text": "".join(json_deltas), "type": "text"}],
834834
)
835835

836836
assert (
837837
span._data.get(SPANDATA.GEN_AI_RESPONSE_TEXT)
838-
== "[\"{'test': 'data',\", \"'more': 'json'}\"]"
838+
== "[{\"text\": \"{'test': 'data','more': 'json'}\", \"type\": \"text\"}]"
839839
)
840840
assert span._data.get(SPANDATA.GEN_AI_USAGE_INPUT_TOKENS) == 10
841841
assert span._data.get(SPANDATA.GEN_AI_USAGE_OUTPUT_TOKENS) == 20

0 commit comments

Comments
 (0)