File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
tests/integrations/anthropic Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments