|
62 | 62 | TRACE_SET_DATA = [ |
63 | 63 | { |
64 | 64 | "name": "execute_tool get_city_weather", |
65 | | - "span_id": 5421848634094108689, |
66 | | - "trace_id": 115143748123782151752771111946932434777, |
67 | | - "start_time": 1754884672226444000, |
68 | | - "end_time": 1754884672226993000, |
| 65 | + "span_id": 4497348974122733469, |
| 66 | + "trace_id": 142655176138954930885272077198014871976, |
| 67 | + "start_time": 1758158957162250000, |
| 68 | + "end_time": 1758158957162426000, |
69 | 69 | "attributes": { |
70 | 70 | "gen_ai.tool.name": "get_city_weather", |
71 | | - "gen_ai.tool.description": "Retrieves the weather information of a given city. the args must in English", |
72 | | - "gen_ai.tool.call.id": "call_6ow5622pvcouw3tpvr7rfqtl", |
73 | | - "gcp.vertex.agent.tool_call_args": '{"city": "Xi\'an"}', |
| 71 | + "gen_ai.tool.input": '{"name": "get_city_weather", "description": "Retrieves the weather information of a given city. the args must in English", "parameters": {"city": "Beijing"}}', |
| 72 | + "gen_ai.tool.output": '{"id": "call_w4bj25flpvs74zgyyiquqh5s", "name": "get_city_weather", "response": {"result": "Sunny, 25°C"}}', |
74 | 73 | }, |
75 | | - "parent_span_id": 7997784243558253239, |
| 74 | + "parent_span_id": 574819447039686650, |
76 | 75 | }, |
77 | 76 | { |
78 | 77 | "name": "call_llm", |
79 | | - "span_id": 7997784243558253239, |
80 | | - "trace_id": 115143748123782151752771111946932434777, |
| 78 | + "span_id": 574819447039686650, |
| 79 | + "trace_id": 142655176138954930885272077198014871976, |
| 80 | + "start_time": 1758158945807630000, |
| 81 | + "end_time": 1758158957171304000, |
81 | 82 | "attributes": { |
82 | | - "session.id": "veadk_example_session", |
83 | | - "user.id": "veadk_default_user", |
| 83 | + "gen_ai.app.name": "veadk_default_app", |
| 84 | + "gen_ai.user.id": "veadk_default_user", |
| 85 | + "gen_ai.prompt.0.role": "user", |
| 86 | + "gen_ai.prompt.0.content": "How is the weather like in BeiJing?", |
84 | 87 | }, |
85 | | - "parent_span_id": 14844888006539887900, |
| 88 | + "parent_span_id": 13789664766018020416, |
86 | 89 | }, |
87 | 90 | { |
88 | 91 | "name": "call_llm", |
89 | | - "span_id": 7789424022423491416, |
90 | | - "trace_id": 115143748123782151752771111946932434777, |
| 92 | + "span_id": 9007934154052797946, |
| 93 | + "trace_id": 142655176138954930885272077198014871976, |
| 94 | + "start_time": 1758158957171713000, |
| 95 | + "end_time": 1758158964035230000, |
91 | 96 | "attributes": { |
92 | | - "session.id": "veadk_example_session", |
93 | | - "user.id": "veadk_default_user", |
| 97 | + "gen_ai.app.name": "veadk_default_app", |
| 98 | + "gen_ai.user.id": "veadk_default_user", |
| 99 | + "gen_ai.prompt.0.content": "How is the weather like in BeiJing?", |
| 100 | + "gen_ai.completion.0.content": "The weather in Beijing is sunny with a temperature of 25°C.", |
94 | 101 | }, |
95 | | - "parent_span_id": 14844888006539887900, |
| 102 | + "parent_span_id": 13789664766018020416, |
96 | 103 | }, |
97 | 104 | { |
98 | 105 | "name": "agent_run [chat_robot]", |
99 | | - "span_id": 14844888006539887900, |
100 | | - "trace_id": 115143748123782151752771111946932434777, |
101 | | - "attributes": { |
102 | | - "session.id": "veadk_example_session", |
103 | | - "user.id": "veadk_default_user", |
104 | | - }, |
105 | | - "parent_span_id": 2943363177785645047, |
| 106 | + "span_id": 13789664766018020416, |
| 107 | + "trace_id": 142655176138954930885272077198014871976, |
| 108 | + "start_time": 1758158945807350000, |
| 109 | + "end_time": 1758158964035291000, |
| 110 | + "attributes": {}, |
| 111 | + "parent_span_id": 5589459087402275636, |
106 | 112 | }, |
107 | 113 | { |
108 | | - "name": "invocation [veadk_default_app]", |
109 | | - "span_id": 2943363177785645047, |
110 | | - "trace_id": 115143748123782151752771111946932434777, |
111 | | - "start_time": 1754884660687962000, |
112 | | - "end_time": 1754884676664833000, |
113 | | - "attributes": { |
114 | | - "input.value": '{"user_id": "veadk_default_user", "session_id": "veadk_example_session", "new_message": "{\\"parts\\": [{\\"video_metadata\\": null, \\"thought\\": null, \\"inline_data\\": null, \\"file_data\\": null, \\"thought_signature\\": null, \\"code_execution_result\\": null, \\"executable_code\\": null, \\"function_call\\": null, \\"function_response\\": null, \\"text\\": \\"How is the weather like in Xi\'an?\\"}], \\"role\\": \\"user\\"}", "run_config": "{\\"speech_config\\": null, \\"response_modalities\\": null, \\"save_input_blobs_as_artifacts\\": false, \\"support_cfc\\": false, \\"streaming_mode\\": \\"StreamingMode.NONE\\", \\"output_audio_transcription\\": null, \\"input_audio_transcription\\": null, \\"realtime_input_config\\": null, \\"enable_affective_dialog\\": null, \\"proactivity\\": null, \\"max_llm_calls\\": 500}"}', |
115 | | - "user.id": "veadk_default_user", |
116 | | - "session.id": "veadk_example_session", |
117 | | - "output.value": '{"content":{"parts":[{"text":"The weather in Xi\'an is cool, with a temperature of 18\u00b0C."}],"role":"model"},"partial":false,"usage_metadata":{"candidates_token_count":132,"prompt_token_count":547,"total_token_count":679},"invocation_id":"e-ea6bb35b-c3f0-4c5c-b127-c71c7d6d6441","author":"chat_robot","actions":{"state_delta":{},"artifact_delta":{},"requested_auth_configs":{}},"id":"c0929124-9be0-4f75-a6ba-f7a531c9ccb6","timestamp":1754884672.227546}', |
118 | | - }, |
| 114 | + "name": "invocation", |
| 115 | + "span_id": 5589459087402275636, |
| 116 | + "trace_id": 142655176138954930885272077198014871976, |
| 117 | + "start_time": 1758158945807233000, |
| 118 | + "end_time": 1758158964035304000, |
| 119 | + "attributes": {}, |
119 | 120 | "parent_span_id": None, |
120 | 121 | }, |
121 | 122 | ] |
@@ -154,8 +155,8 @@ def test_tracing_file_to_evalset(): |
154 | 155 | assert len(base_evaluator.invocation_list) == 1 |
155 | 156 | assert len(base_evaluator.invocation_list[0].invocations) == 1 |
156 | 157 | assert ( |
157 | | - base_evaluator.invocation_list[0].invocations[0].invocation_id |
158 | | - == "e-ea6bb35b-c3f0-4c5c-b127-c71c7d6d6441" |
| 158 | + base_evaluator.invocation_list[0].invocations[0].expected_output |
| 159 | + == "The weather in Beijing is sunny with a temperature of 25°C." |
159 | 160 | ) |
160 | 161 |
|
161 | 162 | os.remove(tracing_file_path) |
0 commit comments