Skip to content

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.

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
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── EXECUTE_TOOL: get_current_time ───────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York"
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York",                                        │
"datetime": "2025-07-08T07:32:53-04:00",                               │
"is_dst": true
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
[
{
"tool.name": "write_file",                                           │
"tool.args": "{\"text\": \"2025\"}"
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 483,                                                   │
"output_tokens": 14
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── 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": 516,                                                   │
"output_tokens": 60
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯

╭─────────────────── 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": 661,                                                   │
"output_tokens": 16
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── 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": 790,                                                   │
"output_tokens": 14
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── 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": 827,                                                   │
"output_tokens": 56
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────── EXECUTE_TOOL: final_output ─────────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"answer": "{\"steps\": [{\"number\": 1, \"description\": \"Get current
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{
"success": true,                                                       │
"result": "{\"steps\": [{\"number\": 1, \"description\": \"Get current
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯

╭─────────────────── 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
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── EXECUTE_TOOL: get_current_time ───────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York"
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York",                                        │
"datetime": "2025-07-08T07:32:37-04:00",                               │
"is_dst": true
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
[
{
"tool.name": "write_file",                                           │
"tool.args": {
"text": "2025"
}
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 327,                                                   │
"output_tokens": 14
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── EXECUTE_TOOL: write_file ──────────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"text": "2025"
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
null
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
│ Here is the list of the steps I have taken:                              │
│                                                                          │
 1 Found the current year in the America/New_York timezone.              │
 2 Wrote the year to a file.                                             │
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 358,                                                   │
"output_tokens": 36
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯

╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ INPUT ──────────────────────────────────────────────────────────────────╮
[
{
"role": "system",                                                    │
"content": "Use the available tools to answer.You must return a Step
},                                                                     │
{
"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": 207,                                                   │
"output_tokens": 35
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── EXECUTE_TOOL: get_current_time ───────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York"
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York",                                        │
"datetime": "2025-07-08T07:33:05-04:00",                               │
"is_dst": true
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
[
{
"tool.name": "write_file",                                           │
"tool.args": "{}"
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 299,                                                   │
"output_tokens": 32
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── 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": 321,                                                   │
"output_tokens": 127
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────── EXECUTE_TOOL: final_output ─────────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"answer": "{\n  \"steps\": [\n    {\n      \"number\": 1,\n      \"des
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{
"success": true,                                                       │
"result": "{\n  \"steps\": [\n    {\n      \"number\": 1,\n      \"des
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
│ Here is the final 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": 498,                                                   │
"output_tokens": 69
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯

╭─────────────────── 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
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── 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": 556,                                                   │
"output_tokens": 14
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── 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": 46
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯

╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ INPUT ──────────────────────────────────────────────────────────────────╮
[
{
"role": "system",                                                    │
"content": "Use the available tools to answer.\n\nYour final answer 
},                                                                     │
{
"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": 457,                                                   │
"output_tokens": 16
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── EXECUTE_TOOL: get_current_time ───────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York"
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York",                                        │
"datetime": "2025-07-08T07:32:54-04:00",                               │
"is_dst": true
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
[
{
"tool.name": "write_file",                                           │
"tool.args": "{\"text\": \"2025\"}"
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 584,                                                   │
"output_tokens": 14
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── 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, \"descriptio
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 655,                                                   │
"output_tokens": 59
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
[
{
"tool.name": "final_answer",                                         │
"tool.args": "{\"answer\": \"{\\"steps\\": [{\\"number\\": 1, \
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 835,                                                   │
"output_tokens": 63
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────── EXECUTE_TOOL: final_answer ─────────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"answer": "{\"steps\": [{\"number\": 1, \"description\": \"Get the cur
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{
"steps": [
{
"number": 1,                                                       │
"description": "Get the current time in the America/New_York timez
},                                                                   │
{
"number": 2,                                                       │
"description": "Write the year 2025 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": 250,                                                   │
"output_tokens": 16
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── EXECUTE_TOOL: get_current_time ───────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York"
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York",                                        │
"datetime": "2025-07-08T07:32:57-04:00",                               │
"is_dst": true
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
[
{
"tool.name": "write_file",                                           │
"tool.args": "{\"text\": \"2025\"}"
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 334,                                                   │
"output_tokens": 14
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── EXECUTE_TOOL: write_file ──────────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"text": "2025"
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
│ None                                                                     │
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── 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 Extracted the year from the current time.                             │
 3 Wrote the year to a file.                                             │
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 367,                                                   │
"output_tokens": 44
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯

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": 330008117380762187083381322541040191233,
        "span_id": 16826223754115896609,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974372965166000,
      "end_time": 1751974373315068000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 330008117380762187083381322541040191233,
        "span_id": 10158083766882735126,
        "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
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool get_current_time",
      "kind": "internal",
      "parent": {
        "trace_id": 330008117380762187083381322541040191233,
        "span_id": 16826223754115896609,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974373315707000,
      "end_time": 1751974373323537000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 330008117380762187083381322541040191233,
        "span_id": 457533250421869186,
        "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": "wdsD5Zp2w",
        "gen_ai.output": "{\n  \"timezone\": \"America/New_York\",\n  \"datetime\": \"2025-07-08T07:32:53-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.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 330008117380762187083381322541040191233,
        "span_id": 16826223754115896609,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974373324061000,
      "end_time": 1751974376277677000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 330008117380762187083381322541040191233,
        "span_id": 4859057670693565598,
        "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": 483,
        "gen_ai.usage.output_tokens": 14
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool write_file",
      "kind": "internal",
      "parent": {
        "trace_id": 330008117380762187083381322541040191233,
        "span_id": 16826223754115896609,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974376278365000,
      "end_time": 1751974376281675000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 330008117380762187083381322541040191233,
        "span_id": 16626075910985617161,
        "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": "YTTRUs8Dh",
        "gen_ai.output": "{}",
        "gen_ai.output.type": "json"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 330008117380762187083381322541040191233,
        "span_id": 16826223754115896609,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974376282153000,
      "end_time": 1751974378851236000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 330008117380762187083381322541040191233,
        "span_id": 11359857824189106067,
        "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 to a file\"\n    }\n  ]\n}",
        "gen_ai.output.type": "text",
        "gen_ai.usage.input_tokens": 516,
        "gen_ai.usage.output_tokens": 60
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "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": 1751974372961351000,
      "end_time": 1751974378953877000,
      "status": {
        "status_code": "unset",
        "description": null
      },
      "context": {
        "trace_id": 330008117380762187083381322541040191233,
        "span_id": 16826223754115896609,
        "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.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    }
  ],
  "final_output": {}
}
{
  "spans": [
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 291035710612677748006208696553016571699,
        "span_id": 5570945481273396504,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974352886990000,
      "end_time": 1751974354091180000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 291035710612677748006208696553016571699,
        "span_id": 5089008003696208018,
        "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": 661,
        "gen_ai.usage.output_tokens": 16
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool get_current_time",
      "kind": "internal",
      "parent": {
        "trace_id": 291035710612677748006208696553016571699,
        "span_id": 4754485227359525453,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974354092048000,
      "end_time": 1751974354099471000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 291035710612677748006208696553016571699,
        "span_id": 12527461002370398846,
        "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": "45FjTWv57",
        "gen_ai.output": "\"meta=None content=[TextContent(type='text', text='{\\\\n  \\\"timezone\\\": \\\"America/New_York\\\",\\\\n  \\\"datetime\\\": \\\"2025-07-08T07:32:34-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.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 291035710612677748006208696553016571699,
        "span_id": 5570945481273396504,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974354100754000,
      "end_time": 1751974354976278000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 291035710612677748006208696553016571699,
        "span_id": 16085518707278550711,
        "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": 790,
        "gen_ai.usage.output_tokens": 14
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool write_file",
      "kind": "internal",
      "parent": {
        "trace_id": 291035710612677748006208696553016571699,
        "span_id": 9359080566277664082,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974354977169000,
      "end_time": 1751974354981025000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 291035710612677748006208696553016571699,
        "span_id": 11069525376270782861,
        "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": "LGp8GVq1O",
        "gen_ai.output": "{}",
        "gen_ai.output.type": "json"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 291035710612677748006208696553016571699,
        "span_id": 5570945481273396504,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974354983018000,
      "end_time": 1751974367931678000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 291035710612677748006208696553016571699,
        "span_id": 169022457368773096,
        "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": 827,
        "gen_ai.usage.output_tokens": 56
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool final_output",
      "kind": "internal",
      "parent": {
        "trace_id": 291035710612677748006208696553016571699,
        "span_id": 2315245742124441067,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974367932390000,
      "end_time": 1751974367934390000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 291035710612677748006208696553016571699,
        "span_id": 10379350421026327695,
        "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": "You must call this tool in order to return the final answer.\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": "ffiZoeuV5",
        "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.34.1",
          "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": 1751974352885786000,
      "end_time": 1751974367934815000,
      "status": {
        "status_code": "unset",
        "description": null
      },
      "context": {
        "trace_id": 291035710612677748006208696553016571699,
        "span_id": 14198400161396661473,
        "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.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    }
  ],
  "final_output": {}
}
{
  "spans": [
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 231171238887064373055723779927836700424,
        "span_id": 8270418037442671461,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974356546443000,
      "end_time": 1751974357476442000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 231171238887064373055723779927836700424,
        "span_id": 15156327052350081302,
        "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
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool get_current_time",
      "kind": "internal",
      "parent": {
        "trace_id": 231171238887064373055723779927836700424,
        "span_id": 8270418037442671461,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974357478337000,
      "end_time": 1751974357480914000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 231171238887064373055723779927836700424,
        "span_id": 2474401665397289612,
        "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-07-08T07:32:37-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.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 231171238887064373055723779927836700424,
        "span_id": 8270418037442671461,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974357482157000,
      "end_time": 1751974358554821000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 231171238887064373055723779927836700424,
        "span_id": 204801152359135281,
        "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": 327,
        "gen_ai.usage.output_tokens": 14
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool write_file",
      "kind": "internal",
      "parent": {
        "trace_id": 231171238887064373055723779927836700424,
        "span_id": 8270418037442671461,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974358556355000,
      "end_time": 1751974358557803000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 231171238887064373055723779927836700424,
        "span_id": 15772862876862078971,
        "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.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 231171238887064373055723779927836700424,
        "span_id": 8270418037442671461,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974358559201000,
      "end_time": 1751974360436032000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 231171238887064373055723779927836700424,
        "span_id": 6894408651482638639,
        "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 is the list of the steps I have taken:\n\n1. Found the current year in the America/New_York timezone.\n2. Wrote the year to a file.",
        "gen_ai.output.type": "text",
        "gen_ai.usage.input_tokens": 358,
        "gen_ai.usage.output_tokens": 36
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "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": 1751974356542816000,
      "end_time": 1751974363199119000,
      "status": {
        "status_code": "unset",
        "description": null
      },
      "context": {
        "trace_id": 231171238887064373055723779927836700424,
        "span_id": 8270418037442671461,
        "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.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    }
  ],
  "final_output": {}
}
{
  "spans": [
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 252586920601735166526180333658072189001,
        "span_id": 4917042611672162830,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974384920293000,
      "end_time": 1751974385612164000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 252586920601735166526180333658072189001,
        "span_id": 1697277798337904521,
        "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 return a Steps JSON string.\\n            This object must match 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            You can use the 'final_output' tool to help verify your output\\n            \"}, {\"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": 207,
        "gen_ai.usage.output_tokens": 35
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool get_current_time",
      "kind": "internal",
      "parent": {
        "trace_id": 252586920601735166526180333658072189001,
        "span_id": 4917042611672162830,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974385613491000,
      "end_time": 1751974385827919000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 252586920601735166526180333658072189001,
        "span_id": 15457064648849615848,
        "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-07-08T07:33:05-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.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 252586920601735166526180333658072189001,
        "span_id": 4917042611672162830,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974385828777000,
      "end_time": 1751974386275074000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 252586920601735166526180333658072189001,
        "span_id": 1419149949014443587,
        "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": 299,
        "gen_ai.usage.output_tokens": 32
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool write_file",
      "kind": "internal",
      "parent": {
        "trace_id": 252586920601735166526180333658072189001,
        "span_id": 4917042611672162830,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974386276338000,
      "end_time": 1751974386278072000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 252586920601735166526180333658072189001,
        "span_id": 14036824227226641366,
        "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.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 252586920601735166526180333658072189001,
        "span_id": 4917042611672162830,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974386278912000,
      "end_time": 1751974387212744000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 252586920601735166526180333658072189001,
        "span_id": 9516004571352443469,
        "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": 321,
        "gen_ai.usage.output_tokens": 127
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool final_output",
      "kind": "internal",
      "parent": {
        "trace_id": 252586920601735166526180333658072189001,
        "span_id": 4917042611672162830,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974387214378000,
      "end_time": 1751974387216777000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 252586920601735166526180333658072189001,
        "span_id": 16097762527399686800,
        "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\nYou must call this tool in order to return the final answer.\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\": \"{\\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 to a file.\\\"\\n    }\\n  ]\\n}\"}",
        "gen_ai.output": "{\"success\": true, \"result\": \"{\\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 to a file.\\\"\\n    }\\n  ]\\n}\"}",
        "gen_ai.output.type": "json"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 252586920601735166526180333658072189001,
        "span_id": 4917042611672162830,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974387218414000,
      "end_time": 1751974387806721000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 252586920601735166526180333658072189001,
        "span_id": 12179479903703287340,
        "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 is the final output:\n\n```json\n{\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 to a file.\"\n    }\n  ]\n}\n```",
        "gen_ai.output.type": "text",
        "gen_ai.usage.input_tokens": 498,
        "gen_ai.usage.output_tokens": 69
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "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": 1751974384918734000,
      "end_time": 1751974389611726000,
      "status": {
        "status_code": "unset",
        "description": null
      },
      "context": {
        "trace_id": 252586920601735166526180333658072189001,
        "span_id": 4917042611672162830,
        "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.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    }
  ],
  "final_output": {}
}
{
  "spans": [
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 308126731157821440625050127471944438972,
        "span_id": 17931159706082391548,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974354411700000,
      "end_time": 1751974355319868000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 308126731157821440625050127471944438972,
        "span_id": 9856932643305308359,
        "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
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool get_current_time",
      "kind": "internal",
      "parent": {
        "trace_id": 308126731157821440625050127471944438972,
        "span_id": 17931159706082391548,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974355321415000,
      "end_time": 1751974355327570000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 308126731157821440625050127471944438972,
        "span_id": 3147877582517592475,
        "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-07-08T07:32:35-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.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 308126731157821440625050127471944438972,
        "span_id": 17931159706082391548,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974355330087000,
      "end_time": 1751974356855921000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 308126731157821440625050127471944438972,
        "span_id": 11916590601677738444,
        "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": 556,
        "gen_ai.usage.output_tokens": 14
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool write_file",
      "kind": "internal",
      "parent": {
        "trace_id": 308126731157821440625050127471944438972,
        "span_id": 17931159706082391548,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974356856778000,
      "end_time": 1751974356858487000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 308126731157821440625050127471944438972,
        "span_id": 7155850322354656759,
        "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.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool write_file",
      "kind": "internal",
      "parent": {
        "trace_id": 308126731157821440625050127471944438972,
        "span_id": 17931159706082391548,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974356856778000,
      "end_time": 1751974356858487000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 308126731157821440625050127471944438972,
        "span_id": 7155850322354656759,
        "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.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 308126731157821440625050127471944438972,
        "span_id": 17931159706082391548,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974356861643000,
      "end_time": 1751974358555096000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 308126731157821440625050127471944438972,
        "span_id": 8301354682509369025,
        "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": "text",
        "gen_ai.usage.input_tokens": 589,
        "gen_ai.usage.output_tokens": 46
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "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": 1751974354409697000,
      "end_time": 1751974358555634000,
      "status": {
        "status_code": "unset",
        "description": null
      },
      "context": {
        "trace_id": 308126731157821440625050127471944438972,
        "span_id": 17931159706082391548,
        "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.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    }
  ],
  "final_output": {}
}
{
  "spans": [
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 308051117207069154348077785883813334567,
        "span_id": 12737475786203216450,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974372967742000,
      "end_time": 1751974374316526000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 308051117207069154348077785883813334567,
        "span_id": 17190546858340115776,
        "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.\\n\\nYour final answer must be a Steps object.\\n            This object must match 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            \"}, {\"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": 457,
        "gen_ai.usage.output_tokens": 16
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool get_current_time",
      "kind": "internal",
      "parent": {
        "trace_id": 308051117207069154348077785883813334567,
        "span_id": 12737475786203216450,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974374317327000,
      "end_time": 1751974374321496000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 308051117207069154348077785883813334567,
        "span_id": 7958778840035120301,
        "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-07-08T07:32: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.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 308051117207069154348077785883813334567,
        "span_id": 12737475786203216450,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974374321728000,
      "end_time": 1751974375591866000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 308051117207069154348077785883813334567,
        "span_id": 11354158200945444474,
        "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": 584,
        "gen_ai.usage.output_tokens": 14
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool write_file",
      "kind": "internal",
      "parent": {
        "trace_id": 308051117207069154348077785883813334567,
        "span_id": 12737475786203216450,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974375592101000,
      "end_time": 1751974375592946000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 308051117207069154348077785883813334567,
        "span_id": 7321844398664802533,
        "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.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 308051117207069154348077785883813334567,
        "span_id": 12737475786203216450,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974375593354000,
      "end_time": 1751974379455888000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 308051117207069154348077785883813334567,
        "span_id": 11755965945828577315,
        "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 the current time in the America/New_York timezone.\\\"}, {\\\"number\\\": 2, \\\"description\\\": \\\"Write the year 2025 to a file.\\\"}]}}\"}]",
        "gen_ai.output.type": "json",
        "gen_ai.usage.input_tokens": 655,
        "gen_ai.usage.output_tokens": 59
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 308051117207069154348077785883813334567,
        "span_id": 12737475786203216450,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974379457182000,
      "end_time": 1751974381497053000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 308051117207069154348077785883813334567,
        "span_id": 1793455715569333420,
        "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 the current time in the America/New_York timezone.\\\\\\\"}, {\\\\\\\"number\\\\\\\": 2, \\\\\\\"description\\\\\\\": \\\\\\\"Write the year 2025 to a file.\\\\\\\"}]}\\\"}\"}]",
        "gen_ai.output.type": "json",
        "gen_ai.usage.input_tokens": 835,
        "gen_ai.usage.output_tokens": 63
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool final_answer",
      "kind": "internal",
      "parent": {
        "trace_id": 308051117207069154348077785883813334567,
        "span_id": 12737475786203216450,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974381497650000,
      "end_time": 1751974381500472000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 308051117207069154348077785883813334567,
        "span_id": 4871706224066311599,
        "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 the current time in the America/New_York timezone.\\\"}, {\\\"number\\\": 2, \\\"description\\\": \\\"Write the year 2025 to a file.\\\"}]}\"}",
        "gen_ai.output": "{\"steps\": [{\"number\": 1, \"description\": \"Get the 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.34.1",
          "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": 1751974372967417000,
      "end_time": 1751974381500746000,
      "status": {
        "status_code": "unset",
        "description": null
      },
      "context": {
        "trace_id": 308051117207069154348077785883813334567,
        "span_id": 12737475786203216450,
        "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.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    }
  ],
  "final_output": {}
}
{
  "spans": [
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 234388736351612748113813546242163058983,
        "span_id": 3838847384053540692,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974375612413000,
      "end_time": 1751974377138836000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 234388736351612748113813546242163058983,
        "span_id": 2068684051804274005,
        "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": 250,
        "gen_ai.usage.output_tokens": 16
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool get_current_time",
      "kind": "internal",
      "parent": {
        "trace_id": 234388736351612748113813546242163058983,
        "span_id": 3838847384053540692,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974377139301000,
      "end_time": 1751974377148996000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 234388736351612748113813546242163058983,
        "span_id": 4558152802022532646,
        "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-07-08T07:32:57-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.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 234388736351612748113813546242163058983,
        "span_id": 3838847384053540692,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974377149281000,
      "end_time": 1751974378013908000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 234388736351612748113813546242163058983,
        "span_id": 18044528029364797813,
        "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": 334,
        "gen_ai.usage.output_tokens": 14
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool write_file",
      "kind": "internal",
      "parent": {
        "trace_id": 234388736351612748113813546242163058983,
        "span_id": 3838847384053540692,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974378014341000,
      "end_time": 1751974378018175000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 234388736351612748113813546242163058983,
        "span_id": 15158535883764786779,
        "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.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 234388736351612748113813546242163058983,
        "span_id": 3838847384053540692,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1751974378018425000,
      "end_time": 1751974380891892000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 234388736351612748113813546242163058983,
        "span_id": 12433258763617452790,
        "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. Extracted the year from the current time.\n3. Wrote the year to a file.",
        "gen_ai.output.type": "text",
        "gen_ai.usage.input_tokens": 367,
        "gen_ai.usage.output_tokens": 44
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.34.1",
          "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": 1751974375612278000,
      "end_time": 1751974388603308000,
      "status": {
        "status_code": "unset",
        "description": null
      },
      "context": {
        "trace_id": 234388736351612748113813546242163058983,
        "span_id": 3838847384053540692,
        "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.34.1",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    }
  ],
  "final_output": {}
}

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))

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))