Agent Tracing
An AgentTrace
is returned when calling agent.run
or agent.run_async
.
any-agent
generates standardized (regarding the structure) OpenTelemetry traces regardless of the framework used, based on the Semantic conventions for generative AI systems. This means that any OpenTelemetry exporter compatible with the Python SDK can be added. More information can be found below.
Info
Check the exposed attributes in GenAI
You can try to 🔍 find 🔍 the subtle differences (regarding the content) across frameworks in the examples below.
Tip
The following are real traces generated by executing one of our integration tests.
Console
Here is what the console output looks like:
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ INPUT ──────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "role": "system", │ │
│ │ "content": "<instructions>\nUse the available tools to answer.\n</in │ │
│ │ }, │ │
│ │ { │ │
│ │ "role": "user", │ │
│ │ "content": "Find what year it is in the America/New_York timezone an │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "tool.name": "get_current_time", │ │
│ │ "tool.args": "{\"timezone\": \"America/New_York\"}" │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 395, │ │
│ │ "output_tokens": 16, │ │
│ │ "input_cost": 3.95e-05, │ │
│ │ "output_cost": 4.8e-06 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── EXECUTE_TOOL: get_current_time ───────────────────────╮
│ ╭─ Input ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "timezone": "America/New_York" │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "timezone": "America/New_York", │ │
│ │ "datetime": "2025-08-01T05:54:54-04:00", │ │
│ │ "is_dst": true │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "tool.name": "write_file", │ │
│ │ "tool.args": "{\"text\": \"2025\"}" │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 481, │ │
│ │ "output_tokens": 14, │ │
│ │ "input_cost": 4.81e-05, │ │
│ │ "output_cost": 4.2e-06 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── EXECUTE_TOOL: write_file ──────────────────────────╮
│ ╭─ Input ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "text": "2025" │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ {} │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "steps": [ │ │
│ │ { │ │
│ │ "number": 1, │ │
│ │ "description": "Find what year it is in the America/New_York timez │ │
│ │ }, │ │
│ │ { │ │
│ │ "number": 2, │ │
│ │ "description": "Write the value (single number) to a file" │ │
│ │ }, │ │
│ │ { │ │
│ │ "number": 3, │ │
│ │ "description": "Return a list of the steps you have taken" │ │
│ │ } │ │
│ │ ] │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 514, │ │
│ │ "output_tokens": 70, │ │
│ │ "input_cost": 5.1399999999999996e-05, │ │
│ │ "output_cost": 2.1e-05 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ INPUT ──────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "role": "system", │ │
│ │ "content": "Use the available tools to answer.You must call the fina │ │
│ │ }, │ │
│ │ { │ │
│ │ "role": "user", │ │
│ │ "content": "Find what year it is in the America/New_York timezone an │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "tool.name": "get_current_time", │ │
│ │ "tool.args": { │ │
│ │ "timezone": "America/New_York" │ │
│ │ } │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 678, │ │
│ │ "output_tokens": 16, │ │
│ │ "input_cost": 6.78e-05, │ │
│ │ "output_cost": 4.8e-06 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── EXECUTE_TOOL: get_current_time ───────────────────────╮
│ ╭─ Input ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "timezone": "America/New_York" │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ "meta=None content=[TextContent(type='text', text='{\n \"timezone\": \ │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "tool.name": "write_file", │ │
│ │ "tool.args": { │ │
│ │ "text": "2025" │ │
│ │ } │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 799, │ │
│ │ "output_tokens": 14, │ │
│ │ "input_cost": 7.989999999999999e-05, │ │
│ │ "output_cost": 4.2e-06 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── EXECUTE_TOOL: write_file ──────────────────────────╮
│ ╭─ Input ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "text": "2025" │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ {} │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "tool.name": "final_output", │ │
│ │ "tool.args": { │ │
│ │ "answer": "{\"steps\": [{\"number\": 1, \"description\": \"Get cur │ │
│ │ } │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 838, │ │
│ │ "output_tokens": 56, │ │
│ │ "input_cost": 8.379999999999999e-05, │ │
│ │ "output_cost": 1.68e-05 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────── EXECUTE_TOOL: final_output ─────────────────────────╮
│ ╭─ Input ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "answer": "{\"steps\": [{\"number\": 1, \"description\": \"Get current │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "success": true, │ │
│ │ "result": { │ │
│ │ "steps": [ │ │
│ │ { │ │
│ │ "number": 1, │ │
│ │ "description": "Get current time in the America/New_York timezon │ │
│ │ }, │ │
│ │ { │ │
│ │ "number": 2, │ │
│ │ "description": "Write the year to a file." │ │
│ │ } │ │
│ │ ] │ │
│ │ } │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ INPUT ──────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "role": "system", │ │
│ │ "content": "Use the available tools to answer." │ │
│ │ }, │ │
│ │ { │ │
│ │ "role": "user", │ │
│ │ "content": "Find what year it is in the America/New_York timezone an │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "tool.name": "get_current_time", │ │
│ │ "tool.args": { │ │
│ │ "timezone": "America/New_York" │ │
│ │ } │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 241, │ │
│ │ "output_tokens": 16, │ │
│ │ "input_cost": 2.41e-05, │ │
│ │ "output_cost": 4.8e-06 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── EXECUTE_TOOL: get_current_time ───────────────────────╮
│ ╭─ Input ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "timezone": "America/New_York" │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "timezone": "America/New_York", │ │
│ │ "datetime": "2025-08-01T05:52:42-04:00", │ │
│ │ "is_dst": true │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "tool.name": "write_file", │ │
│ │ "tool.args": { │ │
│ │ "text": "2025" │ │
│ │ } │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 329, │ │
│ │ "output_tokens": 14, │ │
│ │ "input_cost": 3.29e-05, │ │
│ │ "output_cost": 4.2e-06 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── EXECUTE_TOOL: write_file ──────────────────────────╮
│ ╭─ Input ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "text": "2025" │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ null │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ Here are the steps I have taken: │ │
│ │ │ │
│ │ 1 Found the current time in the America/New_York timezone. │ │
│ │ 2 Wrote the year to a file. │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 364, │ │
│ │ "output_tokens": 33, │ │
│ │ "input_cost": 3.64e-05, │ │
│ │ "output_cost": 9.9e-06 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "steps": [ │ │
│ │ { │ │
│ │ "number": 1, │ │
│ │ "description": "Found the current time in the America/New_York tim │ │
│ │ }, │ │
│ │ { │ │
│ │ "number": 2, │ │
│ │ "description": "Wrote the year to a file." │ │
│ │ } │ │
│ │ ] │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 328, │ │
│ │ "output_tokens": 62, │ │
│ │ "input_cost": 3.28e-05, │ │
│ │ "output_cost": 1.8599999999999998e-05 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ INPUT ──────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "role": "system", │ │
│ │ "content": "Use the available tools to answer.You must call the fina │ │
│ │ }, │ │
│ │ { │ │
│ │ "role": "user", │ │
│ │ "content": "Find what year it is in the America/New_York timezone an │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "tool.name": "get_current_time", │ │
│ │ "tool.args": "{}" │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 203, │ │
│ │ "output_tokens": 35, │ │
│ │ "input_cost": 2.03e-05, │ │
│ │ "output_cost": 1.05e-05 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── EXECUTE_TOOL: get_current_time ───────────────────────╮
│ ╭─ Input ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "timezone": "America/New_York" │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "timezone": "America/New_York", │ │
│ │ "datetime": "2025-08-01T05:52:52-04:00", │ │
│ │ "is_dst": true │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "tool.name": "write_file", │ │
│ │ "tool.args": "{}" │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 295, │ │
│ │ "output_tokens": 34, │ │
│ │ "input_cost": 2.95e-05, │ │
│ │ "output_cost": 1.0199999999999999e-05 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── EXECUTE_TOOL: write_file ──────────────────────────╮
│ ╭─ Input ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "text": "2025" │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ "None" │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "tool.name": "final_output", │ │
│ │ "tool.args": "{}" │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 319, │ │
│ │ "output_tokens": 96, │ │
│ │ "input_cost": 3.1899999999999996e-05, │ │
│ │ "output_cost": 2.88e-05 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────── EXECUTE_TOOL: final_output ─────────────────────────╮
│ ╭─ Input ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "answer": "{\"steps\": [{\"number\": 1, \"description\": \"Get current │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "success": true, │ │
│ │ "result": { │ │
│ │ "steps": [ │ │
│ │ { │ │
│ │ "number": 1, │ │
│ │ "description": "Get current time in the America/New_York timezon │ │
│ │ }, │ │
│ │ { │ │
│ │ "number": 2, │ │
│ │ "description": "Write the year (2025) to a file." │ │
│ │ } │ │
│ │ ] │ │
│ │ } │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ Here are the steps I have taken: │ │
│ │ │ │
│ │ 1 Get current time in the America/New_York timezone. │ │
│ │ 2 Write the year (2025) to a file. │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 443, │ │
│ │ "output_tokens": 34, │ │
│ │ "input_cost": 4.43e-05, │ │
│ │ "output_cost": 1.0199999999999999e-05 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "steps": [ │ │
│ │ { │ │
│ │ "number": 1, │ │
│ │ "description": "Get current time in the America/New_York timezone. │ │
│ │ }, │ │
│ │ { │ │
│ │ "number": 2, │ │
│ │ "description": "Write the year (2025) to a file." │ │
│ │ } │ │
│ │ ] │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 171, │ │
│ │ "output_tokens": 66, │ │
│ │ "input_cost": 1.71e-05, │ │
│ │ "output_cost": 1.98e-05 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ INPUT ──────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "role": "system", │ │
│ │ "content": "Use the available tools to answer." │ │
│ │ }, │ │
│ │ { │ │
│ │ "content": "Find what year it is in the America/New_York timezone an │ │
│ │ "role": "user" │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "tool.name": "get_current_time", │ │
│ │ "tool.args": "{\"timezone\": \"America/New_York\"}" │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 447, │ │
│ │ "output_tokens": 16, │ │
│ │ "input_cost": 4.4699999999999996e-05, │ │
│ │ "output_cost": 4.8e-06 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── EXECUTE_TOOL: get_current_time ───────────────────────╮
│ ╭─ Input ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "timezone": "America/New_York" │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "type": "text", │ │
│ │ "text": "{\n \"timezone\": \"America/New_York\",\n \"datetime\": \"2 │ │
│ │ "annotations": null, │ │
│ │ "meta": null │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "tool.name": "write_file", │ │
│ │ "tool.args": "{\"text\": \"2025\"}" │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 554, │ │
│ │ "output_tokens": 14, │ │
│ │ "input_cost": 5.54e-05, │ │
│ │ "output_cost": 4.2e-06 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── EXECUTE_TOOL: write_file ──────────────────────────╮
│ ╭─ Input ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "text": "2025" │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ {} │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── EXECUTE_TOOL: write_file ──────────────────────────╮
│ ╭─ Input ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "text": "2025" │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ {} │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "steps": [ │ │
│ │ { │ │
│ │ "number": 1, │ │
│ │ "description": "Get current time in the America/New_York timezone" │ │
│ │ }, │ │
│ │ { │ │
│ │ "number": 2, │ │
│ │ "description": "Write the year to a file" │ │
│ │ } │ │
│ │ ] │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 589, │ │
│ │ "output_tokens": 44, │ │
│ │ "input_cost": 5.8899999999999995e-05, │ │
│ │ "output_cost": 1.3199999999999999e-05 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ INPUT ──────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "role": "system", │ │
│ │ "content": "Use the available tools to answer.You must call the fina │ │
│ │ }, │ │
│ │ { │ │
│ │ "role": "user", │ │
│ │ "content": "New task:\nFind what year it is in the America/New_York │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "tool.name": "get_current_time", │ │
│ │ "tool.args": "{\"timezone\": \"America/New_York\"}" │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 689, │ │
│ │ "output_tokens": 16, │ │
│ │ "input_cost": 6.89e-05, │ │
│ │ "output_cost": 4.8e-06 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── EXECUTE_TOOL: get_current_time ───────────────────────╮
│ ╭─ Input ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "timezone": "America/New_York" │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "timezone": "America/New_York", │ │
│ │ "datetime": "2025-08-01T05:55:38-04:00", │ │
│ │ "is_dst": true │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "tool.name": "write_file", │ │
│ │ "tool.args": "{\"text\": \"2025\"}" │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 821, │ │
│ │ "output_tokens": 14, │ │
│ │ "input_cost": 8.209999999999999e-05, │ │
│ │ "output_cost": 4.2e-06 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── EXECUTE_TOOL: write_file ──────────────────────────╮
│ ╭─ Input ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "text": "2025" │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ {} │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "tool.name": "final_answer", │ │
│ │ "tool.args": "{\"answer\": \"{\\"steps\\": [{\\"number\\": 1, \ │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 902, │ │
│ │ "output_tokens": 56, │ │
│ │ "input_cost": 9.02e-05, │ │
│ │ "output_cost": 1.68e-05 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────── EXECUTE_TOOL: final_answer ─────────────────────────╮
│ ╭─ Input ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "answer": "{\"steps\": [{\"number\": 1, \"description\": \"Get current │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "steps": [ │ │
│ │ { │ │
│ │ "number": 1, │ │
│ │ "description": "Get current time in the America/New_York timezone. │ │
│ │ }, │ │
│ │ { │ │
│ │ "number": 2, │ │
│ │ "description": "Write the year to a file." │ │
│ │ } │ │
│ │ ] │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ INPUT ──────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "role": "system", │ │
│ │ "content": "Use the available tools to answer." │ │
│ │ }, │ │
│ │ { │ │
│ │ "role": "user", │ │
│ │ "content": "Find what year it is in the America/New_York timezone an │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "tool.name": "get_current_time", │ │
│ │ "tool.args": "{\"timezone\": \"America/New_York\"}" │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 315, │ │
│ │ "output_tokens": 16, │ │
│ │ "input_cost": 3.15e-05, │ │
│ │ "output_cost": 4.8e-06 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── EXECUTE_TOOL: get_current_time ───────────────────────╮
│ ╭─ Input ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "timezone": "America/New_York" │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "timezone": "America/New_York", │ │
│ │ "datetime": "2025-08-01T05:57:51-04:00", │ │
│ │ "is_dst": true │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "tool.name": "write_file", │ │
│ │ "tool.args": "{\"text\": \"2025\"}" │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 401, │ │
│ │ "output_tokens": 14, │ │
│ │ "input_cost": 4.01e-05, │ │
│ │ "output_cost": 4.2e-06 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── EXECUTE_TOOL: write_file ──────────────────────────╮
│ ╭─ Input ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "text": "2025" │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ None │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ [ │ │
│ │ { │ │
│ │ "tool.name": "final_answer", │ │
│ │ "tool.args": "{\"answer\": \"1. Found the current time in the Americ │ │
│ │ } │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 432, │ │
│ │ "output_tokens": 47, │ │
│ │ "input_cost": 4.32e-05, │ │
│ │ "output_cost": 1.4099999999999999e-05 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────── EXECUTE_TOOL: final_answer ─────────────────────────╮
│ ╭─ Input ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "answer": "1. Found the current time in the America/New_York timezone. │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ │ │
│ │ 1 Found the current time in the America/New_York timezone. 2. Wrote the │ │
│ │ year to a file. 3. Returned a list of the steps taken. │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
│ ╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "steps": [ │ │
│ │ { │ │
│ │ "number": 1, │ │
│ │ "description": "Found the current time in the America/New_York tim │ │
│ │ }, │ │
│ │ { │ │
│ │ "number": 2, │ │
│ │ "description": "Wrote the year to a file." │ │
│ │ }, │ │
│ │ { │ │
│ │ "number": 3, │ │
│ │ "description": "Returned a list of the steps taken." │ │
│ │ } │ │
│ │ ] │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ ╭─ USAGE ──────────────────────────────────────────────────────────────────╮ │
│ │ { │ │
│ │ "input_tokens": 188, │ │
│ │ "output_tokens": 87, │ │
│ │ "input_cost": 1.88e-05, │ │
│ │ "output_cost": 2.6099999999999997e-05 │ │
│ │ } │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
Tip
The spans are printed to the console by default, using the callback
mechanism.
See Default Callbacks for more information and how to disable this behavior.
Spans
Here's what the returned agent_trace.spans
look like when dumped to JSON format:
{
"spans": [
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 95544105696794577450773972010078374733,
"span_id": 303045384231505382,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042093365382438,
"end_time": 1754042094389317492,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 95544105696794577450773972010078374733,
"span_id": 6454084660402922358,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.input.messages": "[{\"role\": \"system\", \"content\": \"<instructions>\\nUse the available tools to answer.\\n</instructions>\\n\\nProvide your output as a JSON containing the following fields:\\n<json_fields>\\n[\\\"steps\\\"]\\n</json_fields>\\n\\nHere are the properties for each field:\\n<json_field_properties>\\n{\\n \\\"steps\\\": {\\n \\\"items\\\": {\\n \\\"$ref\\\": \\\"#/$defs/Step\\\"\\n },\\n \\\"type\\\": \\\"array\\\"\\n },\\n \\\"$defs\\\": {\\n \\\"Step\\\": {\\n \\\"number\\\": {\\n \\\"type\\\": \\\"integer\\\"\\n },\\n \\\"description\\\": {\\n \\\"type\\\": \\\"string\\\"\\n }\\n }\\n }\\n}\\n</json_field_properties>\\nStart your response with `{` and end it with `}`.\\nYour output will be passed to json.loads() to convert it to a Python object.\\nMake sure it only contains valid JSON.\"}, {\"role\": \"user\", \"content\": \"Find what year it is in the America/New_York timezone and write the value (single number) to a file. Finally, return a list of the steps you have taken.\"}]",
"gen_ai.output": "[{\"tool.name\": \"get_current_time\", \"tool.args\": \"{\\\"timezone\\\": \\\"America/New_York\\\"}\"}]",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 395,
"gen_ai.usage.output_tokens": 16,
"gen_ai.usage.input_cost": 0.0000395,
"gen_ai.usage.output_cost": 4.8e-6
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "execute_tool get_current_time",
"kind": "internal",
"parent": {
"trace_id": 95544105696794577450773972010078374733,
"span_id": 303045384231505382,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042094389902900,
"end_time": 1754042094396883865,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 95544105696794577450773972010078374733,
"span_id": 14611729959467895252,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "execute_tool",
"gen_ai.tool.name": "get_current_time",
"gen_ai.tool.description": "Get current time in a specific timezones",
"gen_ai.tool.args": "{\"timezone\": \"America/New_York\"}",
"gen_ai.tool.call.id": "dyud3i89k",
"gen_ai.output": "{\n \"timezone\": \"America/New_York\",\n \"datetime\": \"2025-08-01T05:54:54-04:00\",\n \"is_dst\": true\n}",
"gen_ai.output.type": "json"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 95544105696794577450773972010078374733,
"span_id": 303045384231505382,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042094397312367,
"end_time": 1754042094874042259,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 95544105696794577450773972010078374733,
"span_id": 14385352767817738361,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.output": "[{\"tool.name\": \"write_file\", \"tool.args\": \"{\\\"text\\\": \\\"2025\\\"}\"}]",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 481,
"gen_ai.usage.output_tokens": 14,
"gen_ai.usage.input_cost": 0.0000481,
"gen_ai.usage.output_cost": 4.2e-6
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "execute_tool write_file",
"kind": "internal",
"parent": {
"trace_id": 95544105696794577450773972010078374733,
"span_id": 303045384231505382,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042094874688576,
"end_time": 1754042094878868545,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 95544105696794577450773972010078374733,
"span_id": 14432302980854530208,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "execute_tool",
"gen_ai.tool.name": "write_file",
"gen_ai.tool.description": "write the text to a file in the tmp_path directory",
"gen_ai.tool.args": "{\"text\": \"2025\"}",
"gen_ai.tool.call.id": "MxNsCHgBh",
"gen_ai.output": "{}",
"gen_ai.output.type": "json"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 95544105696794577450773972010078374733,
"span_id": 303045384231505382,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042094879391782,
"end_time": 1754042103654702622,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 95544105696794577450773972010078374733,
"span_id": 5666546098829446803,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.output": "{\"steps\": [{\"number\": 1, \"description\": \"Find what year it is in the America/New_York timezone\"}, {\"number\": 2, \"description\": \"Write the value (single number) to a file\"}, {\"number\": 3, \"description\": \"Return a list of the steps you have taken\"}]}",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 514,
"gen_ai.usage.output_tokens": 70,
"gen_ai.usage.input_cost": 0.000051399999999999996,
"gen_ai.usage.output_cost": 0.000021
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "invoke_agent [any_agent]",
"kind": "internal",
"parent": {
"trace_id": null,
"span_id": null,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042093360142798,
"end_time": 1754042104169690830,
"status": {
"status_code": "unset",
"description": null
},
"context": {
"trace_id": 95544105696794577450773972010078374733,
"span_id": 303045384231505382,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "invoke_agent",
"gen_ai.agent.name": "any_agent",
"gen_ai.agent.description": "No description.",
"gen_ai.request.model": "mistral/mistral-small-latest"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
}
],
"final_output": {
"steps": [
{
"number": 1,
"description": "Find what year it is in the America/New_York timezone"
},
{
"number": 2,
"description": "Write the value (single number) to a file"
},
{
"number": 3,
"description": "Return a list of the steps you have taken"
}
]
}
}
{
"spans": [
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 33362580503506345100368337102358721762,
"span_id": 2712805629862806879,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041900404886224,
"end_time": 1754041901334036067,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 33362580503506345100368337102358721762,
"span_id": 16279905869241783410,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.input.messages": "[{\"role\": \"system\", \"content\": \"Use the available tools to answer.You must call the final_output tool when finished.The 'answer' argument passed to the final_output tool must be a JSON string that matches the following schema:\\n{'$defs': {'Step': {'properties': {'number': {'title': 'Number', 'type': 'integer'}, 'description': {'title': 'Description', 'type': 'string'}}, 'required': ['number', 'description'], 'title': 'Step', 'type': 'object'}}, 'additionalProperties': False, 'properties': {'steps': {'items': {'$ref': '#/$defs/Step'}, 'title': 'Steps', 'type': 'array'}}, 'required': ['steps'], 'title': 'Steps', 'type': 'object'}\\n\\nYou are an agent. Your internal name is \\\"any_agent\\\".\"}, {\"role\": \"user\", \"content\": \"Find what year it is in the America/New_York timezone and write the value (single number) to a file. Finally, return a list of the steps you have taken.\"}]",
"gen_ai.output": "[{\"tool.name\": \"get_current_time\", \"tool.args\": {\"timezone\": \"America/New_York\"}}]",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 678,
"gen_ai.usage.output_tokens": 16,
"gen_ai.usage.input_cost": 0.0000678,
"gen_ai.usage.output_cost": 4.8e-6
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "execute_tool get_current_time",
"kind": "internal",
"parent": {
"trace_id": 33362580503506345100368337102358721762,
"span_id": 11014913846512304287,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041901334609241,
"end_time": 1754041901343002221,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 33362580503506345100368337102358721762,
"span_id": 6889227159904830916,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "execute_tool",
"gen_ai.tool.name": "get_current_time",
"gen_ai.tool.description": "Get current time in a specific timezones",
"gen_ai.tool.args": "{\"timezone\": \"America/New_York\"}",
"gen_ai.tool.call.id": "jsSCuqFF4",
"gen_ai.output": "\"meta=None content=[TextContent(type='text', text='{\\\\n \\\"timezone\\\": \\\"America/New_York\\\",\\\\n \\\"datetime\\\": \\\"2025-08-01T05:51:41-04:00\\\",\\\\n \\\"is_dst\\\": true\\\\n}', annotations=None, meta=None)] structuredContent=None isError=False\"",
"gen_ai.output.type": "json"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 33362580503506345100368337102358721762,
"span_id": 2712805629862806879,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041901344321896,
"end_time": 1754041901738877989,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 33362580503506345100368337102358721762,
"span_id": 8737080548129166115,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.output": "[{\"tool.name\": \"write_file\", \"tool.args\": {\"text\": \"2025\"}}]",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 799,
"gen_ai.usage.output_tokens": 14,
"gen_ai.usage.input_cost": 0.00007989999999999999,
"gen_ai.usage.output_cost": 4.2e-6
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "execute_tool write_file",
"kind": "internal",
"parent": {
"trace_id": 33362580503506345100368337102358721762,
"span_id": 12442915751565387291,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041901739226273,
"end_time": 1754041901740507347,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 33362580503506345100368337102358721762,
"span_id": 1026121205495977129,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "execute_tool",
"gen_ai.tool.name": "write_file",
"gen_ai.tool.description": "write the text to a file in the tmp_path directory\n\nArgs:\n text (str): The text to write to the file.\n\nReturns:\n None",
"gen_ai.tool.args": "{\"text\": \"2025\"}",
"gen_ai.tool.call.id": "8p0AZBpW9",
"gen_ai.output": "{}",
"gen_ai.output.type": "json"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 33362580503506345100368337102358721762,
"span_id": 2712805629862806879,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041901741466089,
"end_time": 1754041957731278401,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 33362580503506345100368337102358721762,
"span_id": 7044854708908688899,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.output": "[{\"tool.name\": \"final_output\", \"tool.args\": {\"answer\": \"{\\\"steps\\\": [{\\\"number\\\": 1, \\\"description\\\": \\\"Get current time in the America/New_York timezone.\\\"}, {\\\"number\\\": 2, \\\"description\\\": \\\"Write the year to a file.\\\"}]}\"}}]",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 838,
"gen_ai.usage.output_tokens": 56,
"gen_ai.usage.input_cost": 0.00008379999999999999,
"gen_ai.usage.output_cost": 0.0000168
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "execute_tool final_output",
"kind": "internal",
"parent": {
"trace_id": 33362580503506345100368337102358721762,
"span_id": 9296425131812262451,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041957731899270,
"end_time": 1754041957734599477,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 33362580503506345100368337102358721762,
"span_id": 10760751170651242666,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "execute_tool",
"gen_ai.tool.name": "final_output",
"gen_ai.tool.description": "This tool is used to validate the final output. It must be called when the final answer is ready in order to ensure that the output is valid.\n\nArgs:\n answer: The final output that can be loaded as a Pydantic model. This must be a JSON compatible string that matches the following schema:\n {'$defs': {'Step': {'properties': {'number': {'title': 'Number', 'type': 'integer'}, 'description': {'title': 'Description', 'type': 'string'}}, 'required': ['number', 'description'], 'title': 'Step', 'type': 'object'}}, 'additionalProperties': False, 'properties': {'steps': {'items': {'$ref': '#/$defs/Step'}, 'title': 'Steps', 'type': 'array'}}, 'required': ['steps'], 'title': 'Steps', 'type': 'object'}\n\nReturns:\n A dictionary with the following keys:\n - success: True if the output is valid, False otherwise.\n - result: The final output if success is True, otherwise an error message.",
"gen_ai.tool.args": "{\"answer\": \"{\\\"steps\\\": [{\\\"number\\\": 1, \\\"description\\\": \\\"Get current time in the America/New_York timezone.\\\"}, {\\\"number\\\": 2, \\\"description\\\": \\\"Write the year to a file.\\\"}]}\"}",
"gen_ai.tool.call.id": "LF2QJdgFW",
"gen_ai.output": "{\"success\": true, \"result\": {\"steps\": [{\"number\": 1, \"description\": \"Get current time in the America/New_York timezone.\"}, {\"number\": 2, \"description\": \"Write the year to a file.\"}]}}",
"gen_ai.output.type": "json"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "invoke_agent [any_agent]",
"kind": "internal",
"parent": {
"trace_id": null,
"span_id": null,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041900403272069,
"end_time": 1754041957734853456,
"status": {
"status_code": "unset",
"description": null
},
"context": {
"trace_id": 33362580503506345100368337102358721762,
"span_id": 9898570198081698602,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "invoke_agent",
"gen_ai.agent.name": "any_agent",
"gen_ai.agent.description": "No description.",
"gen_ai.request.model": "mistral/mistral-small-latest"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
}
],
"final_output": {
"steps": [
{
"number": 1,
"description": "Get current time in the America/New_York timezone."
},
{
"number": 2,
"description": "Write the year to a file."
}
]
}
}
{
"spans": [
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 190326915882252930752151066829320989027,
"span_id": 3878859057581409824,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041958237326120,
"end_time": 1754041962002052490,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 190326915882252930752151066829320989027,
"span_id": 289527053134946261,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.input.messages": "[{\"role\": \"system\", \"content\": \"Use the available tools to answer.\"}, {\"role\": \"user\", \"content\": \"Find what year it is in the America/New_York timezone and write the value (single number) to a file. Finally, return a list of the steps you have taken.\"}]",
"gen_ai.output": "[{\"tool.name\": \"get_current_time\", \"tool.args\": {\"timezone\": \"America/New_York\"}}]",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 241,
"gen_ai.usage.output_tokens": 16,
"gen_ai.usage.input_cost": 0.0000241,
"gen_ai.usage.output_cost": 4.8e-6
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "execute_tool get_current_time",
"kind": "internal",
"parent": {
"trace_id": 190326915882252930752151066829320989027,
"span_id": 3878859057581409824,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041962006466883,
"end_time": 1754041962011004751,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 190326915882252930752151066829320989027,
"span_id": 14581387401617946166,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "execute_tool",
"gen_ai.tool.name": "get_current_time",
"gen_ai.tool.description": "Get current time in a specific timezones",
"gen_ai.tool.args": "{\"timezone\": \"America/New_York\"}",
"gen_ai.output": "{\n \"timezone\": \"America/New_York\",\n \"datetime\": \"2025-08-01T05:52:42-04:00\",\n \"is_dst\": true\n}",
"gen_ai.output.type": "json"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 190326915882252930752151066829320989027,
"span_id": 3878859057581409824,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041962013170974,
"end_time": 1754041962375355360,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 190326915882252930752151066829320989027,
"span_id": 12825293778498665963,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.output": "[{\"tool.name\": \"write_file\", \"tool.args\": {\"text\": \"2025\"}}]",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 329,
"gen_ai.usage.output_tokens": 14,
"gen_ai.usage.input_cost": 0.0000329,
"gen_ai.usage.output_cost": 4.2e-6
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "execute_tool write_file",
"kind": "internal",
"parent": {
"trace_id": 190326915882252930752151066829320989027,
"span_id": 3878859057581409824,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041962378398536,
"end_time": 1754041962379706532,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 190326915882252930752151066829320989027,
"span_id": 456307986160624204,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "execute_tool",
"gen_ai.tool.name": "write_file",
"gen_ai.tool.description": "write the text to a file in the tmp_path directory\n\nArgs:\n text (str): The text to write to the file.\n\nReturns:\n None",
"gen_ai.tool.args": "{\"text\": \"2025\"}",
"gen_ai.output": "null",
"gen_ai.output.type": "json"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 190326915882252930752151066829320989027,
"span_id": 3878859057581409824,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041962382338030,
"end_time": 1754041967232514909,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 190326915882252930752151066829320989027,
"span_id": 1802677288849805961,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.output": "Here are the steps I have taken:\n\n1. Found the current time in the America/New_York timezone.\n2. Wrote the year to a file.",
"gen_ai.output.type": "text",
"gen_ai.usage.input_tokens": 364,
"gen_ai.usage.output_tokens": 33,
"gen_ai.usage.input_cost": 0.0000364,
"gen_ai.usage.output_cost": 9.9e-6
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 190326915882252930752151066829320989027,
"span_id": 3878859057581409824,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041967237316245,
"end_time": 1754041970445833554,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 190326915882252930752151066829320989027,
"span_id": 15974399814840764171,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.output": "{\n \"steps\": [\n {\n \"number\": 1,\n \"description\": \"Found the current time in the America/New_York timezone.\"\n },\n {\n \"number\": 2,\n \"description\": \"Wrote the year to a file.\"\n }\n ]\n}",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 328,
"gen_ai.usage.output_tokens": 62,
"gen_ai.usage.input_cost": 0.0000328,
"gen_ai.usage.output_cost": 0.000018599999999999998
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "invoke_agent [any_agent]",
"kind": "internal",
"parent": {
"trace_id": null,
"span_id": null,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041958228731312,
"end_time": 1754041970446051277,
"status": {
"status_code": "unset",
"description": null
},
"context": {
"trace_id": 190326915882252930752151066829320989027,
"span_id": 3878859057581409824,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "invoke_agent",
"gen_ai.agent.name": "any_agent",
"gen_ai.agent.description": "No description.",
"gen_ai.request.model": "mistral/mistral-small-latest"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
}
],
"final_output": {
"steps": [
{
"number": 1,
"description": "Found the current time in the America/New_York timezone."
},
{
"number": 2,
"description": "Wrote the year to a file."
}
]
}
}
{
"spans": [
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 229014657432212207702615506520765449730,
"span_id": 6236357966915113777,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041971368528493,
"end_time": 1754041971844966245,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 229014657432212207702615506520765449730,
"span_id": 1162322960898089063,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.input.messages": "[{\"role\": \"system\", \"content\": \"Use the available tools to answer.You must call the final_output tool when finished.The 'answer' argument passed to the final_output tool must be a JSON string that matches the following schema:\\n{'$defs': {'Step': {'properties': {'number': {'title': 'Number', 'type': 'integer'}, 'description': {'title': 'Description', 'type': 'string'}}, 'required': ['number', 'description'], 'title': 'Step', 'type': 'object'}}, 'additionalProperties': False, 'properties': {'steps': {'items': {'$ref': '#/$defs/Step'}, 'title': 'Steps', 'type': 'array'}}, 'required': ['steps'], 'title': 'Steps', 'type': 'object'}\"}, {\"role\": \"user\", \"content\": \"Find what year it is in the America/New_York timezone and write the value (single number) to a file. Finally, return a list of the steps you have taken.\"}]",
"gen_ai.output": "[{\"tool.name\": \"get_current_time\", \"tool.args\": \"{}\"}]",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 203,
"gen_ai.usage.output_tokens": 35,
"gen_ai.usage.input_cost": 0.0000203,
"gen_ai.usage.output_cost": 0.0000105
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "execute_tool get_current_time",
"kind": "internal",
"parent": {
"trace_id": 229014657432212207702615506520765449730,
"span_id": 6236357966915113777,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041971846047229,
"end_time": 1754041972236698901,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 229014657432212207702615506520765449730,
"span_id": 14900170875762896105,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "execute_tool",
"gen_ai.tool.name": "get_current_time",
"gen_ai.tool.description": "Get current time in a specific timezones",
"gen_ai.tool.args": "{\"timezone\": \"America/New_York\"}",
"gen_ai.output": "{\n \"timezone\": \"America/New_York\",\n \"datetime\": \"2025-08-01T05:52:52-04:00\",\n \"is_dst\": true\n}",
"gen_ai.output.type": "json"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 229014657432212207702615506520765449730,
"span_id": 6236357966915113777,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041972237965029,
"end_time": 1754041972657144080,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 229014657432212207702615506520765449730,
"span_id": 2847063733672611827,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.output": "[{\"tool.name\": \"write_file\", \"tool.args\": \"{}\"}]",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 295,
"gen_ai.usage.output_tokens": 34,
"gen_ai.usage.input_cost": 0.0000295,
"gen_ai.usage.output_cost": 0.000010199999999999999
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "execute_tool write_file",
"kind": "internal",
"parent": {
"trace_id": 229014657432212207702615506520765449730,
"span_id": 6236357966915113777,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041972658263666,
"end_time": 1754041972660760374,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 229014657432212207702615506520765449730,
"span_id": 3128541987358295614,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "execute_tool",
"gen_ai.tool.name": "write_file",
"gen_ai.tool.description": "write_file(text: str) -> None\nwrite the text to a file in the tmp_path directory\n\nArgs:\n text (str): The text to write to the file.\n\nReturns:\n None\n",
"gen_ai.tool.args": "{\"text\": \"2025\"}",
"gen_ai.output": "\"None\"",
"gen_ai.output.type": "json"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 229014657432212207702615506520765449730,
"span_id": 6236357966915113777,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041972661734519,
"end_time": 1754041973546674192,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 229014657432212207702615506520765449730,
"span_id": 193721726002487187,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.output": "[{\"tool.name\": \"final_output\", \"tool.args\": \"{}\"}]",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 319,
"gen_ai.usage.output_tokens": 96,
"gen_ai.usage.input_cost": 0.000031899999999999996,
"gen_ai.usage.output_cost": 0.0000288
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "execute_tool final_output",
"kind": "internal",
"parent": {
"trace_id": 229014657432212207702615506520765449730,
"span_id": 6236357966915113777,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041973547764181,
"end_time": 1754041973550720669,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 229014657432212207702615506520765449730,
"span_id": 1249858002909553576,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "execute_tool",
"gen_ai.tool.name": "final_output",
"gen_ai.tool.description": "final_output(answer: str) -> dict[str, str | bool | dict[str, typing.Any] | list[typing.Any]]\nThis tool is used to validate the final output. It must be called when the final answer is ready in order to ensure that the output is valid.\n\n Args:\n answer: The final output that can be loaded as a Pydantic model. This must be a JSON compatible string that matches the following schema:\n {'$defs': {'Step': {'properties': {'number': {'title': 'Number', 'type': 'integer'}, 'description': {'title': 'Description', 'type': 'string'}}, 'required': ['number', 'description'], 'title': 'Step', 'type': 'object'}}, 'additionalProperties': False, 'properties': {'steps': {'items': {'$ref': '#/$defs/Step'}, 'title': 'Steps', 'type': 'array'}}, 'required': ['steps'], 'title': 'Steps', 'type': 'object'}\n\n Returns:\n A dictionary with the following keys:\n - success: True if the output is valid, False otherwise.\n - result: The final output if success is True, otherwise an error message.\n\n ",
"gen_ai.tool.args": "{\"answer\": \"{\\\"steps\\\": [{\\\"number\\\": 1, \\\"description\\\": \\\"Get current time in the America/New_York timezone.\\\"}, {\\\"number\\\": 2, \\\"description\\\": \\\"Write the year (2025) to a file.\\\"}]}\"}",
"gen_ai.output": "{\"success\": true, \"result\": {\"steps\": [{\"number\": 1, \"description\": \"Get current time in the America/New_York timezone.\"}, {\"number\": 2, \"description\": \"Write the year (2025) to a file.\"}]}}",
"gen_ai.output.type": "json"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 229014657432212207702615506520765449730,
"span_id": 6236357966915113777,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041973551871749,
"end_time": 1754041974193113943,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 229014657432212207702615506520765449730,
"span_id": 8782958070785853179,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.output": "Here are the steps I have taken:\n\n1. Get current time in the America/New_York timezone.\n2. Write the year (2025) to a file.",
"gen_ai.output.type": "text",
"gen_ai.usage.input_tokens": 443,
"gen_ai.usage.output_tokens": 34,
"gen_ai.usage.input_cost": 0.0000443,
"gen_ai.usage.output_cost": 0.000010199999999999999
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 229014657432212207702615506520765449730,
"span_id": 6236357966915113777,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041974199520838,
"end_time": 1754041983456205561,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 229014657432212207702615506520765449730,
"span_id": 10815226053290719261,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.output": "{\n \"steps\": [\n {\n \"number\": 1,\n \"description\": \"Get current time in the America/New_York timezone.\"\n },\n {\n \"number\": 2,\n \"description\": \"Write the year (2025) to a file.\"\n }\n ]\n}",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 171,
"gen_ai.usage.output_tokens": 66,
"gen_ai.usage.input_cost": 0.0000171,
"gen_ai.usage.output_cost": 0.0000198
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "invoke_agent [any_agent]",
"kind": "internal",
"parent": {
"trace_id": null,
"span_id": null,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041971362064887,
"end_time": 1754041983456503734,
"status": {
"status_code": "unset",
"description": null
},
"context": {
"trace_id": 229014657432212207702615506520765449730,
"span_id": 6236357966915113777,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "invoke_agent",
"gen_ai.agent.name": "any_agent",
"gen_ai.agent.description": "No description.",
"gen_ai.request.model": "mistral/mistral-small-latest"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
}
],
"final_output": {
"steps": [
{
"number": 1,
"description": "Get current time in the America/New_York timezone."
},
{
"number": 2,
"description": "Write the year (2025) to a file."
}
]
}
}
{
"spans": [
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 167072354449669612179569273318124318336,
"span_id": 18272850298833688173,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041983839169924,
"end_time": 1754042001509071793,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 167072354449669612179569273318124318336,
"span_id": 14151044612272926131,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.input.messages": "[{\"role\": \"system\", \"content\": \"Use the available tools to answer.\"}, {\"content\": \"Find what year it is in the America/New_York timezone and write the value (single number) to a file. Finally, return a list of the steps you have taken.\", \"role\": \"user\"}]",
"gen_ai.output": "[{\"tool.name\": \"get_current_time\", \"tool.args\": \"{\\\"timezone\\\": \\\"America/New_York\\\"}\"}]",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 447,
"gen_ai.usage.output_tokens": 16,
"gen_ai.usage.input_cost": 0.000044699999999999996,
"gen_ai.usage.output_cost": 4.8e-6
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "execute_tool get_current_time",
"kind": "internal",
"parent": {
"trace_id": 167072354449669612179569273318124318336,
"span_id": 18272850298833688173,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042001509970892,
"end_time": 1754042001517594596,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 167072354449669612179569273318124318336,
"span_id": 4389457807946308237,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "execute_tool",
"gen_ai.tool.name": "get_current_time",
"gen_ai.tool.description": "Get current time in a specific timezones",
"gen_ai.tool.args": "{\"timezone\": \"America/New_York\"}",
"gen_ai.output": "{\"type\":\"text\",\"text\":\"{\\n \\\"timezone\\\": \\\"America/New_York\\\",\\n \\\"datetime\\\": \\\"2025-08-01T05:53:21-04:00\\\",\\n \\\"is_dst\\\": true\\n}\",\"annotations\":null,\"meta\":null}",
"gen_ai.output.type": "json"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 167072354449669612179569273318124318336,
"span_id": 18272850298833688173,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042001520328340,
"end_time": 1754042004090939550,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 167072354449669612179569273318124318336,
"span_id": 5289756295809639845,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.output": "[{\"tool.name\": \"write_file\", \"tool.args\": \"{\\\"text\\\": \\\"2025\\\"}\"}]",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 554,
"gen_ai.usage.output_tokens": 14,
"gen_ai.usage.input_cost": 0.0000554,
"gen_ai.usage.output_cost": 4.2e-6
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "execute_tool write_file",
"kind": "internal",
"parent": {
"trace_id": 167072354449669612179569273318124318336,
"span_id": 18272850298833688173,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042004091777743,
"end_time": 1754042004092823232,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 167072354449669612179569273318124318336,
"span_id": 7155786602528740707,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "execute_tool",
"gen_ai.tool.name": "write_file",
"gen_ai.tool.description": "write the text to a file in the tmp_path directory",
"gen_ai.tool.args": "{\"text\": \"2025\"}",
"gen_ai.output": "{}",
"gen_ai.output.type": "json"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "execute_tool write_file",
"kind": "internal",
"parent": {
"trace_id": 167072354449669612179569273318124318336,
"span_id": 18272850298833688173,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042004091777743,
"end_time": 1754042004092823232,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 167072354449669612179569273318124318336,
"span_id": 7155786602528740707,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "execute_tool",
"gen_ai.tool.name": "write_file",
"gen_ai.tool.description": "write the text to a file in the tmp_path directory",
"gen_ai.tool.args": "{\"text\": \"2025\"}",
"gen_ai.output": "{}",
"gen_ai.output.type": "json"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 167072354449669612179569273318124318336,
"span_id": 18272850298833688173,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042004096622305,
"end_time": 1754042092791709460,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 167072354449669612179569273318124318336,
"span_id": 5960161599686783280,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.output": "{\"steps\": [{\"number\": 1, \"description\": \"Get current time in the America/New_York timezone\"}, {\"number\": 2, \"description\": \"Write the year to a file\"}]}",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 589,
"gen_ai.usage.output_tokens": 44,
"gen_ai.usage.input_cost": 0.000058899999999999995,
"gen_ai.usage.output_cost": 0.000013199999999999999
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "invoke_agent [any_agent]",
"kind": "internal",
"parent": {
"trace_id": null,
"span_id": null,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754041983835677045,
"end_time": 1754042092792612314,
"status": {
"status_code": "unset",
"description": null
},
"context": {
"trace_id": 167072354449669612179569273318124318336,
"span_id": 18272850298833688173,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "invoke_agent",
"gen_ai.agent.name": "any_agent",
"gen_ai.agent.description": "No description.",
"gen_ai.request.model": "mistral/mistral-small-latest"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
}
],
"final_output": {
"steps": [
{
"number": 1,
"description": "Get current time in the America/New_York timezone"
},
{
"number": 2,
"description": "Write the year to a file"
}
]
}
}
{
"spans": [
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 111184580844907911044195549614456321268,
"span_id": 5206514433809648240,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042104555927562,
"end_time": 1754042138292432966,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 111184580844907911044195549614456321268,
"span_id": 381021499183520677,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.input.messages": "[{\"role\": \"system\", \"content\": \"Use the available tools to answer.You must call the final_output tool when finished.The 'answer' argument passed to the final_output tool must be a JSON string that matches the following schema:\\n{'$defs': {'Step': {'properties': {'number': {'title': 'Number', 'type': 'integer'}, 'description': {'title': 'Description', 'type': 'string'}}, 'required': ['number', 'description'], 'title': 'Step', 'type': 'object'}}, 'additionalProperties': False, 'properties': {'steps': {'items': {'$ref': '#/$defs/Step'}, 'title': 'Steps', 'type': 'array'}}, 'required': ['steps'], 'title': 'Steps', 'type': 'object'}\"}, {\"role\": \"user\", \"content\": \"New task:\\nFind what year it is in the America/New_York timezone and write the value (single number) to a file. Finally, return a list of the steps you have taken.\"}]",
"gen_ai.output": "[{\"tool.name\": \"get_current_time\", \"tool.args\": \"{\\\"timezone\\\": \\\"America/New_York\\\"}\"}]",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 689,
"gen_ai.usage.output_tokens": 16,
"gen_ai.usage.input_cost": 0.0000689,
"gen_ai.usage.output_cost": 4.8e-6
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "execute_tool get_current_time",
"kind": "internal",
"parent": {
"trace_id": 111184580844907911044195549614456321268,
"span_id": 5206514433809648240,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042138293967767,
"end_time": 1754042138299458816,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 111184580844907911044195549614456321268,
"span_id": 15721330364403057546,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "execute_tool",
"gen_ai.tool.name": "get_current_time",
"gen_ai.tool.description": "Get current time in a specific timezones",
"gen_ai.tool.args": "{\"timezone\": \"America/New_York\"}",
"gen_ai.output": "{\n \"timezone\": \"America/New_York\",\n \"datetime\": \"2025-08-01T05:55:38-04:00\",\n \"is_dst\": true\n}",
"gen_ai.output.type": "json"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 111184580844907911044195549614456321268,
"span_id": 5206514433809648240,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042138300140888,
"end_time": 1754042170149199163,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 111184580844907911044195549614456321268,
"span_id": 11852227009788716198,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.output": "[{\"tool.name\": \"write_file\", \"tool.args\": \"{\\\"text\\\": \\\"2025\\\"}\"}]",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 821,
"gen_ai.usage.output_tokens": 14,
"gen_ai.usage.input_cost": 0.00008209999999999999,
"gen_ai.usage.output_cost": 4.2e-6
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "execute_tool write_file",
"kind": "internal",
"parent": {
"trace_id": 111184580844907911044195549614456321268,
"span_id": 5206514433809648240,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042170149568314,
"end_time": 1754042170150602062,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 111184580844907911044195549614456321268,
"span_id": 16558072673449483608,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "execute_tool",
"gen_ai.tool.name": "write_file",
"gen_ai.tool.description": "write the text to a file in the tmp_path directory",
"gen_ai.tool.args": "{\"text\": \"2025\"}",
"gen_ai.output": "{}",
"gen_ai.output.type": "json"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 111184580844907911044195549614456321268,
"span_id": 5206514433809648240,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042170151189260,
"end_time": 1754042267376247719,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 111184580844907911044195549614456321268,
"span_id": 5170289786442278025,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.output": "[{\"tool.name\": \"final_answer\", \"tool.args\": \"{\\\"answer\\\": \\\"{\\\\\\\"steps\\\\\\\": [{\\\\\\\"number\\\\\\\": 1, \\\\\\\"description\\\\\\\": \\\\\\\"Get current time in the America/New_York timezone.\\\\\\\"}, {\\\\\\\"number\\\\\\\": 2, \\\\\\\"description\\\\\\\": \\\\\\\"Write the year to a file.\\\\\\\"}]}\\\"}\"}]",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 902,
"gen_ai.usage.output_tokens": 56,
"gen_ai.usage.input_cost": 0.0000902,
"gen_ai.usage.output_cost": 0.0000168
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "execute_tool final_answer",
"kind": "internal",
"parent": {
"trace_id": 111184580844907911044195549614456321268,
"span_id": 5206514433809648240,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042267376586371,
"end_time": 1754042267377965995,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 111184580844907911044195549614456321268,
"span_id": 9768476570201977417,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "execute_tool",
"gen_ai.tool.name": "final_answer",
"gen_ai.tool.description": "Provides a final answer to the given problem.",
"gen_ai.tool.args": "{\"answer\": \"{\\\"steps\\\": [{\\\"number\\\": 1, \\\"description\\\": \\\"Get current time in the America/New_York timezone.\\\"}, {\\\"number\\\": 2, \\\"description\\\": \\\"Write the year to a file.\\\"}]}\"}",
"gen_ai.output": "{\"steps\": [{\"number\": 1, \"description\": \"Get current time in the America/New_York timezone.\"}, {\"number\": 2, \"description\": \"Write the year to a file.\"}]}",
"gen_ai.output.type": "json"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "invoke_agent [any_agent]",
"kind": "internal",
"parent": {
"trace_id": null,
"span_id": null,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042104555354245,
"end_time": 1754042267378259779,
"status": {
"status_code": "unset",
"description": null
},
"context": {
"trace_id": 111184580844907911044195549614456321268,
"span_id": 5206514433809648240,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "invoke_agent",
"gen_ai.agent.name": "any_agent",
"gen_ai.agent.description": "No description.",
"gen_ai.request.model": "mistral/mistral-small-latest"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
}
],
"final_output": {
"steps": [
{
"number": 1,
"description": "Get current time in the America/New_York timezone."
},
{
"number": 2,
"description": "Write the year to a file."
}
]
}
}
{
"spans": [
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 131669361373961773340168485551870481325,
"span_id": 16904063532107017587,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042267748534730,
"end_time": 1754042271608568789,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 131669361373961773340168485551870481325,
"span_id": 17940903810497739093,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.input.messages": "[{\"role\": \"system\", \"content\": \"Use the available tools to answer.\"}, {\"role\": \"user\", \"content\": \"Find what year it is in the America/New_York timezone and write the value (single number) to a file. Finally, return a list of the steps you have taken.\"}]",
"gen_ai.output": "[{\"tool.name\": \"get_current_time\", \"tool.args\": \"{\\\"timezone\\\": \\\"America/New_York\\\"}\"}]",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 315,
"gen_ai.usage.output_tokens": 16,
"gen_ai.usage.input_cost": 0.0000315,
"gen_ai.usage.output_cost": 4.8e-6
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "execute_tool get_current_time",
"kind": "internal",
"parent": {
"trace_id": 131669361373961773340168485551870481325,
"span_id": 16904063532107017587,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042271608748713,
"end_time": 1754042271612961053,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 131669361373961773340168485551870481325,
"span_id": 17323707942427741641,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "execute_tool",
"gen_ai.tool.name": "get_current_time",
"gen_ai.tool.args": "{\"timezone\": \"America/New_York\"}",
"gen_ai.output": "{\n \"timezone\": \"America/New_York\",\n \"datetime\": \"2025-08-01T05:57:51-04:00\",\n \"is_dst\": true\n}",
"gen_ai.output.type": "json"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 131669361373961773340168485551870481325,
"span_id": 16904063532107017587,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042271613066253,
"end_time": 1754042272969523451,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 131669361373961773340168485551870481325,
"span_id": 9659725628114952891,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.output": "[{\"tool.name\": \"write_file\", \"tool.args\": \"{\\\"text\\\": \\\"2025\\\"}\"}]",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 401,
"gen_ai.usage.output_tokens": 14,
"gen_ai.usage.input_cost": 0.0000401,
"gen_ai.usage.output_cost": 4.2e-6
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "execute_tool write_file",
"kind": "internal",
"parent": {
"trace_id": 131669361373961773340168485551870481325,
"span_id": 16904063532107017587,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042272969693820,
"end_time": 1754042272970970621,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 131669361373961773340168485551870481325,
"span_id": 2091825378634755405,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "execute_tool",
"gen_ai.tool.name": "write_file",
"gen_ai.tool.args": "{\"text\": \"2025\"}",
"gen_ai.output": "None",
"gen_ai.output.type": "text"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 131669361373961773340168485551870481325,
"span_id": 16904063532107017587,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042272971069354,
"end_time": 1754042275176165614,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 131669361373961773340168485551870481325,
"span_id": 89897182056549668,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.output": "[{\"tool.name\": \"final_answer\", \"tool.args\": \"{\\\"answer\\\": \\\"1. Found the current time in the America/New_York timezone. 2. Wrote the year to a file. 3. Returned a list of the steps taken.\\\"}\"}]",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 432,
"gen_ai.usage.output_tokens": 47,
"gen_ai.usage.input_cost": 0.0000432,
"gen_ai.usage.output_cost": 0.000014099999999999999
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "execute_tool final_answer",
"kind": "internal",
"parent": {
"trace_id": 131669361373961773340168485551870481325,
"span_id": 16904063532107017587,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042275176429980,
"end_time": 1754042275178189365,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 131669361373961773340168485551870481325,
"span_id": 11636694419491394406,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "execute_tool",
"gen_ai.tool.name": "final_answer",
"gen_ai.tool.args": "{\"answer\": \"1. Found the current time in the America/New_York timezone. 2. Wrote the year to a file. 3. Returned a list of the steps taken.\"}",
"gen_ai.output": "1. Found the current time in the America/New_York timezone. 2. Wrote the year to a file. 3. Returned a list of the steps taken.",
"gen_ai.output.type": "text"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "call_llm mistral/mistral-small-latest",
"kind": "internal",
"parent": {
"trace_id": 131669361373961773340168485551870481325,
"span_id": 16904063532107017587,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042275178865590,
"end_time": 1754042287291585035,
"status": {
"status_code": "ok",
"description": null
},
"context": {
"trace_id": 131669361373961773340168485551870481325,
"span_id": 18329388715909142061,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "call_llm",
"gen_ai.request.model": "mistral/mistral-small-latest",
"gen_ai.output": "{\n \"steps\": [\n {\n \"number\": 1,\n \"description\": \"Found the current time in the America/New_York timezone.\"\n },\n {\n \"number\": 2,\n \"description\": \"Wrote the year to a file.\"\n },\n {\n \"number\": 3,\n \"description\": \"Returned a list of the steps taken.\"\n }\n ]\n}",
"gen_ai.output.type": "json",
"gen_ai.usage.input_tokens": 188,
"gen_ai.usage.output_tokens": 87,
"gen_ai.usage.input_cost": 0.0000188,
"gen_ai.usage.output_cost": 0.000026099999999999997
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
},
{
"name": "invoke_agent [any_agent]",
"kind": "internal",
"parent": {
"trace_id": null,
"span_id": null,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"start_time": 1754042267748419990,
"end_time": 1754042287291807146,
"status": {
"status_code": "unset",
"description": null
},
"context": {
"trace_id": 131669361373961773340168485551870481325,
"span_id": 16904063532107017587,
"is_remote": false,
"trace_flags": {
"value": 0
},
"trace_state": {
"entries": {}
}
},
"attributes": {
"gen_ai.operation.name": "invoke_agent",
"gen_ai.agent.name": "any_agent",
"gen_ai.agent.description": "No description.",
"gen_ai.request.model": "mistral/mistral-small-latest"
},
"links": [],
"events": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.36.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
}
],
"final_output": {
"steps": [
{
"number": 1,
"description": "Found the current time in the America/New_York timezone."
},
{
"number": 2,
"description": "Wrote the year to a file."
},
{
"number": 3,
"description": "Returned a list of the steps taken."
}
]
}
}
Dumping to File
The AgentTrace object is a pydantic model and can be saved to disk via standard pydantic practices:
from any_agent import AgentConfig, AnyAgent
from any_agent.tools import search_web
agent = AnyAgent.create(
"openai",
agent_config=AgentConfig(
model_id="mistral/mistral-small-latest",
tools=[search_web],
)
)
agent_trace = agent.run("Which agent framework is the best?")
with open("agent_trace.json", "w", encoding="utf-8") as f:
f.write(agent_trace.model_dump_json(indent=2, serialize_as_any=True))
Tip
Passing serialize_as_any=True
makes sure that the final_output
gets dumped
even when AgentConfig.output_type
is used.
Adding an OpenTelemetry exporter
Before starting to use the library, you can add new OpenTelemetry exporters and processors as needed. Note that this does not affect the existing processor that returns the traces to the user, and optionally prints them on stdout
.
The following code will use the OpenTelemetry Python SDK to send the agent traces to an additional endpoint using OTLP over HTTP in the indicated URL:
from opentelemetry.trace import get_tracer_provider
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
tp = get_tracer_provider()
http_exporter = OTLPSpanExporter(endpoint="http://localhost:4318/v1/traces")
tp.add_span_processor(SimpleSpanProcessor(http_exporter))