File tree Expand file tree Collapse file tree
tests/integrations/google_genai Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -978,11 +978,10 @@ def test_google_genai_message_truncation(
978978 )
979979
980980 (event ,) = events
981- _ , chat_span = event ["spans" ]
982-
983- assert SPANDATA .GEN_AI_REQUEST_MESSAGES in chat_span ["data" ]
981+ invoke_span = event ["spans" ][0 ]
982+ assert SPANDATA .GEN_AI_REQUEST_MESSAGES in invoke_span ["data" ]
984983
985- messages_data = chat_span ["data" ][SPANDATA .GEN_AI_REQUEST_MESSAGES ]
984+ messages_data = invoke_span ["data" ][SPANDATA .GEN_AI_REQUEST_MESSAGES ]
986985 assert isinstance (messages_data , str )
987986
988987 parsed_messages = json .loads (messages_data )
@@ -991,7 +990,7 @@ def test_google_genai_message_truncation(
991990 assert parsed_messages [0 ]["role" ] == "user"
992991 assert small_content in parsed_messages [0 ]["content" ]
993992
994- assert chat_span ["data" ][SPANDATA .META_GEN_AI_ORIGINAL_INPUT_MESSAGES_LENGTH ] == 2
993+ assert invoke_span ["data" ][SPANDATA .META_GEN_AI_ORIGINAL_INPUT_MESSAGES_LENGTH ] == 2
995994 assert (
996995 event ["_meta" ]["spans" ]["0" ]["data" ]["gen_ai.request.messages" ]["" ]["len" ] == 2
997996 )
You can’t perform that action at this time.
0 commit comments