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.

Info

Check the exposed attributes in GenAI

You can try to 🔍 find 🔍 the subtle differences (regarding the content) across frameworks in the examples below.

Tip

The following are real traces generated by executing one of our integration tests.

Console

Here is what the console output looks like:

╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ INPUT ──────────────────────────────────────────────────────────────────╮
[
{
"role": "system",                                                    │
"content": "<instructions>\nUse the available tools to answer.\n</in
},                                                                     │
{
"role": "user",                                                      │
"content": "Find what year it is in the America/New_York timezone an
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
[
{
"tool.name": "get_current_time",                                     │
"tool.args": "{\"timezone\": \"America/New_York\"}"
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 395,                                                   │
"output_tokens": 16,                                                   │
"input_cost": 3.95e-05,                                                │
"output_cost": 4.8e-06
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── EXECUTE_TOOL: get_current_time ───────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York"
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York",                                        │
"datetime": "2025-09-16T08:43:15-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,                                                   │
"input_cost": 4.8299999999999995e-05,                                  │
"output_cost": 4.2e-06
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── EXECUTE_TOOL: write_file ──────────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"text": "2025"
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{
"steps": [
{
"number": 1,                                                       │
"description": "Get current time in the America/New_York timezone"
},                                                                   │
{
"number": 2,                                                       │
"description": "Write the year to a file"
}
]
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 518,                                                   │
"output_tokens": 44,                                                   │
"input_cost": 5.18e-05,                                                │
"output_cost": 1.3199999999999999e-05
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯

╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ INPUT ──────────────────────────────────────────────────────────────────╮
[
{
"role": "system",                                                    │
"content": "Use the available tools to answer.You must call the fina
},                                                                     │
{
"role": "user",                                                      │
"content": "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": 672,                                                   │
"output_tokens": 16,                                                   │
"input_cost": 6.72e-05,                                                │
"output_cost": 4.8e-06
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── EXECUTE_TOOL: get_current_time ───────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York"
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York",                                        │
"datetime": "2025-09-16T08:43:06-04:00",                               │
"is_dst": true
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
[
{
"tool.name": "write_file",                                           │
"tool.args": {
"text": "2025"
}
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 770,                                                   │
"output_tokens": 14,                                                   │
"input_cost": 7.7e-05,                                                 │
"output_cost": 4.2e-06
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── EXECUTE_TOOL: write_file ──────────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"text": "2025"
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
[
{
"tool.name": "final_output",                                         │
"tool.args": {
"answer": "{\"steps\": [{\"number\": 1, \"description\": \"Get cur
}
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 809,                                                   │
"output_tokens": 56,                                                   │
"input_cost": 8.09e-05,                                                │
"output_cost": 1.68e-05
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────── EXECUTE_TOOL: final_output ─────────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"answer": "{\"steps\": [{\"number\": 1, \"description\": \"Get current
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{
"success": true,                                                       │
"result": {
"steps": [
{
"number": 1,                                                     │
"description": "Get current time in the America/New_York timezon
},                                                                 │
{
"number": 2,                                                     │
"description": "Write the year to a file."
}
]
}
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯

╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ INPUT ──────────────────────────────────────────────────────────────────╮
[
{
"role": "system",                                                    │
"content": "Use the available tools to answer."
},                                                                     │
{
"role": "user",                                                      │
"content": "Find what year it is in the America/New_York timezone an
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
[
{
"tool.name": "get_current_time",                                     │
"tool.args": {
"timezone": "America/New_York"
}
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 245,                                                   │
"output_tokens": 16,                                                   │
"input_cost": 2.45e-05,                                                │
"output_cost": 4.8e-06
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── EXECUTE_TOOL: get_current_time ───────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York"
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York",                                        │
"datetime": "2025-09-16T09:16:41-04:00",                               │
"is_dst": true
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
[
{
"tool.name": "write_file",                                           │
"tool.args": {
"text": "2025"
}
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 331,                                                   │
"output_tokens": 14,                                                   │
"input_cost": 3.31e-05,                                                │
"output_cost": 4.2e-06
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── EXECUTE_TOOL: write_file ──────────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"text": "2025"
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
null
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
│ Here are the steps I have taken:                                         │
│                                                                          │
 1 Found the current time in the America/New_York timezone.              │
 2 Wrote the year to a file.                                             │
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 366,                                                   │
"output_tokens": 33,                                                   │
"input_cost": 3.6599999999999995e-05,                                  │
"output_cost": 9.9e-06
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{
"steps": [
{
"number": 1,                                                       │
"description": "Found the current time in the America/New_York tim
},                                                                   │
{
"number": 2,                                                       │
"description": "Wrote the year to a file."
}
]
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 320,                                                   │
"output_tokens": 62,                                                   │
"input_cost": 3.2e-05,                                                 │
"output_cost": 1.8599999999999998e-05
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯

╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ INPUT ──────────────────────────────────────────────────────────────────╮
[
{
"role": "system",                                                    │
"content": "Use the available tools to answer.You must call the fina
},                                                                     │
{
"role": "user",                                                      │
"content": "Find what year it is in the America/New_York timezone an
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
[
{
"tool.name": "get_current_time",                                     │
"tool.args": "{}"
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 197,                                                   │
"output_tokens": 36,                                                   │
"input_cost": 1.9699999999999998e-05,                                  │
"output_cost": 1.08e-05
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── EXECUTE_TOOL: get_current_time ───────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York"
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York",                                        │
"datetime": "2025-09-16T09:14:59-04:00",                               │
"is_dst": true
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
[
{
"tool.name": "write_file",                                           │
"tool.args": "{}"
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 262,                                                   │
"output_tokens": 33,                                                   │
"input_cost": 2.62e-05,                                                │
"output_cost": 9.9e-06
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── 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": 285,                                                   │
"output_tokens": 94,                                                   │
"input_cost": 2.8499999999999998e-05,                                  │
"output_cost": 2.8199999999999998e-05
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────── EXECUTE_TOOL: final_output ─────────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"answer": "{\"steps\": [{\"number\": 1, \"description\": \"Get current
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{
"success": true,                                                       │
"result": {
"steps": [
{
"number": 1,                                                     │
"description": "Get current time in the America/New_York timezon
},                                                                 │
{
"number": 2,                                                     │
"description": "Write the year to a file."
}
]
}
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
│ Here is the list of steps I have taken:                                  │
│                                                                          │
 1 Get current time in the America/New_York timezone.                    │
 2 Write the year to a file.                                             │
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 403,                                                   │
"output_tokens": 32,                                                   │
"input_cost": 4.03e-05,                                                │
"output_cost": 9.6e-06
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── 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": 161,                                                   │
"output_tokens": 60,                                                   │
"input_cost": 1.61e-05,                                                │
"output_cost": 1.8e-05
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯

╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ INPUT ──────────────────────────────────────────────────────────────────╮
[
{
"role": "system",                                                    │
"content": "Use the available tools to answer."
},                                                                     │
{
"content": "Find what year it is in the America/New_York timezone an
"role": "user"
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
[
{
"tool.name": "get_current_time",                                     │
"tool.args": "{\"timezone\": \"America/New_York\"}"
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 269,                                                   │
"output_tokens": 16,                                                   │
"input_cost": 2.69e-05,                                                │
"output_cost": 4.8e-06
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── EXECUTE_TOOL: get_current_time ───────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York"
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York",                                        │
"datetime": "2025-09-16T08:43:13-04:00",                               │
"is_dst": true
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
[
{
"tool.name": "write_file",                                           │
"tool.args": "{\"text\": \"2025\"}"
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 359,                                                   │
"output_tokens": 14,                                                   │
"input_cost": 3.59e-05,                                                │
"output_cost": 4.2e-06
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── EXECUTE_TOOL: write_file ──────────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"text": "2025"
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{
"steps": [
{
"number": 1,                                                       │
"description": "Get current time in the America/New_York timezone.
},                                                                   │
{
"number": 2,                                                       │
"description": "Write the year to a file."
}
]
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 392,                                                   │
"output_tokens": 46,                                                   │
"input_cost": 3.92e-05,                                                │
"output_cost": 1.38e-05
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯

╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ INPUT ──────────────────────────────────────────────────────────────────╮
[
{
"role": "system",                                                    │
"content": "Use the available tools to answer.You must call the fina
},                                                                     │
{
"role": "user",                                                      │
"content": "New task:\nFind what year it is in the America/New_York 
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
[
{
"tool.name": "get_current_time",                                     │
"tool.args": "{\"timezone\": \"America/New_York\"}"
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 677,                                                   │
"output_tokens": 16,                                                   │
"input_cost": 6.769999999999999e-05,                                   │
"output_cost": 4.8e-06
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── EXECUTE_TOOL: get_current_time ───────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York"
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York",                                        │
"datetime": "2025-09-16T08:43:20-04:00",                               │
"is_dst": true
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
[
{
"tool.name": "write_file",                                           │
"tool.args": "{\"text\": \"2025\"}"
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 782,                                                   │
"output_tokens": 14,                                                   │
"input_cost": 7.819999999999999e-05,                                   │
"output_cost": 4.2e-06
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── EXECUTE_TOOL: write_file ──────────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"text": "2025"
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
[
{
"tool.name": "final_answer",                                         │
"tool.args": "{\"answer\": \"{\\"steps\\": [{\\"number\\": 1, \
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 835,                                                   │
"output_tokens": 57,                                                   │
"input_cost": 8.35e-05,                                                │
"output_cost": 1.71e-05
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────── 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 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": 328,                                                   │
"output_tokens": 16,                                                   │
"input_cost": 3.28e-05,                                                │
"output_cost": 4.8e-06
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── EXECUTE_TOOL: get_current_time ───────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York"
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
{
"timezone": "America/New_York",                                        │
"datetime": "2025-09-16T08:43:21-04:00",                               │
"is_dst": true
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
[
{
"tool.name": "write_file",                                           │
"tool.args": "{\"text\": \"2025\"}"
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 414,                                                   │
"output_tokens": 14,                                                   │
"input_cost": 4.14e-05,                                                │
"output_cost": 4.2e-06
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────── EXECUTE_TOOL: write_file ──────────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"text": "2025"
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
│ None                                                                     │
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── CALL_LLM: mistral/mistral-small-latest ───────────────────╮
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
[
{
"tool.name": "final_answer",                                         │
"tool.args": "{\"answer\": \"1. Get current time in the America/New_
}
]
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 449,                                                   │
"output_tokens": 43,                                                   │
"input_cost": 4.49e-05,                                                │
"output_cost": 1.29e-05
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────── EXECUTE_TOOL: final_answer ─────────────────────────╮
╭─ Input ──────────────────────────────────────────────────────────────────╮
{
"answer": "1. Get current time in the America/New_York timezone. 2. Wr
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ OUTPUT ─────────────────────────────────────────────────────────────────╮
│                                                                          │
 1 Get current time in the America/New_York timezone. 2. Write the year  │
   to a file. 3. Return the list of steps taken.                         │
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── 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."
},                                                                   │
{
"number": 3,                                                       │
"description": "Return the list of steps taken."
}
]
}
╰──────────────────────────────────────────────────────────────────────────╯
╭─ USAGE ──────────────────────────────────────────────────────────────────╮
{
"input_tokens": 178,                                                   │
"output_tokens": 83,                                                   │
"input_cost": 1.78e-05,                                                │
"output_cost": 2.49e-05
}
╰──────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯

Tip

The spans are printed to the console by default, using the callback mechanism.

See Default Callbacks for more information and how to disable this behavior.

Spans

Here's what the returned agent_trace.spans look like when dumped to JSON format:

{
  "spans": [
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 39712373237291850001929057769826244787,
        "span_id": 2795294992452118289,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026594777382000,
      "end_time": 1758026595108941000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 39712373237291850001929057769826244787,
        "span_id": 1807164324042463798,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "attributes": {
        "gen_ai.operation.name": "call_llm",
        "gen_ai.request.model": "mistral/mistral-small-latest",
        "gen_ai.input.messages": "[{\"role\": \"system\", \"content\": \"<instructions>\\nUse the available tools to answer.\\n</instructions>\\n\\nProvide your output as a JSON containing the following fields:\\n<json_fields>\\n[\\\"steps\\\"]\\n</json_fields>\\n\\nHere are the properties for each field:\\n<json_field_properties>\\n{\\n  \\\"steps\\\": {\\n    \\\"items\\\": {\\n      \\\"$ref\\\": \\\"#/$defs/Step\\\"\\n    },\\n    \\\"type\\\": \\\"array\\\"\\n  },\\n  \\\"$defs\\\": {\\n    \\\"Step\\\": {\\n      \\\"number\\\": {\\n        \\\"type\\\": \\\"integer\\\"\\n      },\\n      \\\"description\\\": {\\n        \\\"type\\\": \\\"string\\\"\\n      }\\n    }\\n  }\\n}\\n</json_field_properties>\\nStart your response with `{` and end it with `}`.\\nYour output will be passed to json.loads() to convert it to a Python object.\\nMake sure it only contains valid JSON.\"}, {\"role\": \"user\", \"content\": \"Find what year it is in the America/New_York timezone and write the value (single number) to a file. Finally, return a list of the steps you have taken.\"}]",
        "gen_ai.output": "[{\"tool.name\": \"get_current_time\", \"tool.args\": \"{\\\"timezone\\\": \\\"America/New_York\\\"}\"}]",
        "gen_ai.output.type": "json",
        "gen_ai.usage.input_tokens": 395,
        "gen_ai.usage.output_tokens": 16,
        "gen_ai.usage.input_cost": 0.0000395,
        "gen_ai.usage.output_cost": 4.8e-6
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool get_current_time",
      "kind": "internal",
      "parent": {
        "trace_id": 39712373237291850001929057769826244787,
        "span_id": 2795294992452118289,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026595109197000,
      "end_time": 1758026595112362000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 39712373237291850001929057769826244787,
        "span_id": 10363380192615184096,
        "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": "LlAGPjfO0",
        "gen_ai.output": "{\n  \"timezone\": \"America/New_York\",\n  \"datetime\": \"2025-09-16T08:43:15-04:00\",\n  \"is_dst\": true\n}",
        "gen_ai.output.type": "json"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 39712373237291850001929057769826244787,
        "span_id": 2795294992452118289,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026595112536000,
      "end_time": 1758026595478990000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 39712373237291850001929057769826244787,
        "span_id": 5687879115964223106,
        "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,
        "gen_ai.usage.input_cost": 0.000048299999999999995,
        "gen_ai.usage.output_cost": 4.2e-6
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool write_file",
      "kind": "internal",
      "parent": {
        "trace_id": 39712373237291850001929057769826244787,
        "span_id": 2795294992452118289,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026595479170000,
      "end_time": 1758026595479979000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 39712373237291850001929057769826244787,
        "span_id": 10172050132064111684,
        "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": "wzCUjvRq4",
        "gen_ai.output": "{}",
        "gen_ai.output.type": "json"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 39712373237291850001929057769826244787,
        "span_id": 2795294992452118289,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026595480140000,
      "end_time": 1758026596171980000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 39712373237291850001929057769826244787,
        "span_id": 5885670640581518449,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "attributes": {
        "gen_ai.operation.name": "call_llm",
        "gen_ai.request.model": "mistral/mistral-small-latest",
        "gen_ai.output": "{\"steps\": [{\"number\": 1, \"description\": \"Get current time in the America/New_York timezone\"}, {\"number\": 2, \"description\": \"Write the year to a file\"}]}",
        "gen_ai.output.type": "json",
        "gen_ai.usage.input_tokens": 518,
        "gen_ai.usage.output_tokens": 44,
        "gen_ai.usage.input_cost": 0.0000518,
        "gen_ai.usage.output_cost": 0.000013199999999999999
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "invoke_agent [any_agent]",
      "kind": "internal",
      "parent": {
        "trace_id": null,
        "span_id": null,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026594771631000,
      "end_time": 1758026599652409000,
      "status": {
        "status_code": "unset",
        "description": null
      },
      "context": {
        "trace_id": 39712373237291850001929057769826244787,
        "span_id": 2795294992452118289,
        "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",
        "any_agent.version": "1.9.1.dev0+g8e34f9a88.d20250915"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    }
  ],
  "final_output": {
    "steps": [
      {
        "number": 1,
        "description": "Get current time in the America/New_York timezone"
      },
      {
        "number": 2,
        "description": "Write the year to a file"
      }
    ]
  }
}
{
  "spans": [
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 273475590164507581703505203264503192396,
        "span_id": 17348474965005769013,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026586341103000,
      "end_time": 1758026586853189000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 273475590164507581703505203264503192396,
        "span_id": 2932848494077650092,
        "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'}}, '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": 672,
        "gen_ai.usage.output_tokens": 16,
        "gen_ai.usage.input_cost": 0.0000672,
        "gen_ai.usage.output_cost": 4.8e-6
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool get_current_time",
      "kind": "internal",
      "parent": {
        "trace_id": 273475590164507581703505203264503192396,
        "span_id": 16887867178883245156,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026586853654000,
      "end_time": 1758026586857290000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 273475590164507581703505203264503192396,
        "span_id": 14962216559073945637,
        "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\n\nArgs:\n    timezone: IANA timezone name (e.g., 'America/New_York', 'Europe/London'). Use 'America/New_York' as local timezone if no timezone provided by the user.",
        "gen_ai.tool.args": "{\"timezone\": \"America/New_York\"}",
        "gen_ai.tool.call.id": "jbUWqgIUr",
        "gen_ai.output": "{\n  \"timezone\": \"America/New_York\",\n  \"datetime\": \"2025-09-16T08:43:06-04:00\",\n  \"is_dst\": true\n}",
        "gen_ai.output.type": "json"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 273475590164507581703505203264503192396,
        "span_id": 17348474965005769013,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026586857845000,
      "end_time": 1758026587201860000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 273475590164507581703505203264503192396,
        "span_id": 5619252809477224583,
        "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": 770,
        "gen_ai.usage.output_tokens": 14,
        "gen_ai.usage.input_cost": 0.000077,
        "gen_ai.usage.output_cost": 4.2e-6
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool write_file",
      "kind": "internal",
      "parent": {
        "trace_id": 273475590164507581703505203264503192396,
        "span_id": 10221318138555217448,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026587202619000,
      "end_time": 1758026587204475000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 273475590164507581703505203264503192396,
        "span_id": 7349109554078691264,
        "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": "j5pzf0TaM",
        "gen_ai.output": "{}",
        "gen_ai.output.type": "json"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 273475590164507581703505203264503192396,
        "span_id": 17348474965005769013,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026587207556000,
      "end_time": 1758026587925393000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 273475590164507581703505203264503192396,
        "span_id": 6735089064917818756,
        "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": 809,
        "gen_ai.usage.output_tokens": 56,
        "gen_ai.usage.input_cost": 0.0000809,
        "gen_ai.usage.output_cost": 0.0000168
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool final_output",
      "kind": "internal",
      "parent": {
        "trace_id": 273475590164507581703505203264503192396,
        "span_id": 7027657387019838282,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026587926056000,
      "end_time": 1758026587928967000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 273475590164507581703505203264503192396,
        "span_id": 8045312650763315758,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "attributes": {
        "gen_ai.operation.name": "execute_tool",
        "gen_ai.tool.name": "final_output",
        "gen_ai.tool.description": "This tool is used to validate the final output. It must be called when the final answer is ready in order to ensure that the output is valid.\n\nArgs:\n    answer: The final output that can be loaded as a Pydantic model. This must be a JSON compatible string that matches the following schema:\n        {'$defs': {'Step': {'properties': {'number': {'title': 'Number', 'type': 'integer'}, 'description': {'title': 'Description', 'type': 'string'}}, 'required': ['number', 'description'], 'title': 'Step', 'type': 'object'}}, '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": "Je755BQAS",
        "gen_ai.output": "{\"success\": true, \"result\": {\"steps\": [{\"number\": 1, \"description\": \"Get current time in the America/New_York timezone.\"}, {\"number\": 2, \"description\": \"Write the year to a file.\"}]}}",
        "gen_ai.output.type": "json"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "invoke_agent [any_agent]",
      "kind": "internal",
      "parent": {
        "trace_id": null,
        "span_id": null,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026586339976000,
      "end_time": 1758026587931400000,
      "status": {
        "status_code": "unset",
        "description": null
      },
      "context": {
        "trace_id": 273475590164507581703505203264503192396,
        "span_id": 8588495004904668441,
        "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",
        "any_agent.version": "1.9.1.dev0+g8e34f9a88.d20250915"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    }
  ],
  "final_output": {
    "steps": [
      {
        "number": 1,
        "description": "Get current time in the America/New_York timezone."
      },
      {
        "number": 2,
        "description": "Write the year to a file."
      }
    ]
  }
}
{
  "spans": [
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 115825058289444712299650141807529952578,
        "span_id": 15531323892744358789,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758028600965362000,
      "end_time": 1758028601275757000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 115825058289444712299650141807529952578,
        "span_id": 12072964954527026452,
        "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": 245,
        "gen_ai.usage.output_tokens": 16,
        "gen_ai.usage.input_cost": 0.0000245,
        "gen_ai.usage.output_cost": 4.8e-6
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.37.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool get_current_time",
      "kind": "internal",
      "parent": {
        "trace_id": 115825058289444712299650141807529952578,
        "span_id": 15531323892744358789,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758028601277624000,
      "end_time": 1758028601280591000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 115825058289444712299650141807529952578,
        "span_id": 17250783977442180996,
        "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\n\nArgs:\n    timezone: IANA timezone name (e.g., 'America/New_York', 'Europe/London'). Use 'America/New_York' as local timezone if no timezone provided by the user.",
        "gen_ai.tool.args": "{\"timezone\": \"America/New_York\"}",
        "gen_ai.output": "{\n  \"timezone\": \"America/New_York\",\n  \"datetime\": \"2025-09-16T09:16:41-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.37.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 115825058289444712299650141807529952578,
        "span_id": 15531323892744358789,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758028601281821000,
      "end_time": 1758028601516648000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 115825058289444712299650141807529952578,
        "span_id": 11409606448387202450,
        "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": 331,
        "gen_ai.usage.output_tokens": 14,
        "gen_ai.usage.input_cost": 0.0000331,
        "gen_ai.usage.output_cost": 4.2e-6
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.37.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool write_file",
      "kind": "internal",
      "parent": {
        "trace_id": 115825058289444712299650141807529952578,
        "span_id": 15531323892744358789,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758028601518149000,
      "end_time": 1758028601519026000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 115825058289444712299650141807529952578,
        "span_id": 18344230493271694625,
        "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\n        Args:\n            text (str): The text to write to the file.\n\n        Returns:\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.37.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 115825058289444712299650141807529952578,
        "span_id": 15531323892744358789,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758028601520276000,
      "end_time": 1758028602113531000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 115825058289444712299650141807529952578,
        "span_id": 3673965111321899285,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "attributes": {
        "gen_ai.operation.name": "call_llm",
        "gen_ai.request.model": "mistral/mistral-small-latest",
        "gen_ai.output": "Here are the steps I have taken:\n\n1. Found the current time in the America/New_York timezone.\n2. Wrote the year to a file.",
        "gen_ai.output.type": "text",
        "gen_ai.usage.input_tokens": 366,
        "gen_ai.usage.output_tokens": 33,
        "gen_ai.usage.input_cost": 0.000036599999999999995,
        "gen_ai.usage.output_cost": 9.9e-6
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.37.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 115825058289444712299650141807529952578,
        "span_id": 15531323892744358789,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758028602115388000,
      "end_time": 1758028602753586000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 115825058289444712299650141807529952578,
        "span_id": 17360679537864909106,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "attributes": {
        "gen_ai.operation.name": "call_llm",
        "gen_ai.request.model": "mistral/mistral-small-latest",
        "gen_ai.output": "{\n  \"steps\": [\n    {\n      \"number\": 1,\n      \"description\": \"Found the current time in the America/New_York timezone.\"\n    },\n    {\n      \"number\": 2,\n      \"description\": \"Wrote the year to a file.\"\n    }\n  ]\n}",
        "gen_ai.output.type": "json",
        "gen_ai.usage.input_tokens": 320,
        "gen_ai.usage.output_tokens": 62,
        "gen_ai.usage.input_cost": 0.000032,
        "gen_ai.usage.output_cost": 0.000018599999999999998
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.37.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "invoke_agent [any_agent]",
      "kind": "internal",
      "parent": {
        "trace_id": null,
        "span_id": null,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758028600960730000,
      "end_time": 1758028602753668000,
      "status": {
        "status_code": "unset",
        "description": null
      },
      "context": {
        "trace_id": 115825058289444712299650141807529952578,
        "span_id": 15531323892744358789,
        "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",
        "any_agent.version": "1.9.1.dev3+g8bf65aae1.d20250916"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.37.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    }
  ],
  "final_output": {
    "steps": [
      {
        "number": 1,
        "description": "Found the current time in the America/New_York timezone."
      },
      {
        "number": 2,
        "description": "Wrote the year to a file."
      }
    ]
  }
}
{
  "spans": [
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 183122279777172322684744876400756953563,
        "span_id": 12253070288137891175,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758028498931090000,
      "end_time": 1758028499914934000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 183122279777172322684744876400756953563,
        "span_id": 4679246220570242795,
        "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'}}, 'properties': {'steps': {'items': {'$ref': '#/$defs/Step'}, 'title': 'Steps', 'type': 'array'}}, 'required': ['steps'], 'title': 'Steps', 'type': 'object'}\"}, {\"role\": \"user\", \"content\": \"Find what year it is in the America/New_York timezone and write the value (single number) to a file. Finally, return a list of the steps you have taken.\"}]",
        "gen_ai.output": "[{\"tool.name\": \"get_current_time\", \"tool.args\": \"{}\"}]",
        "gen_ai.output.type": "json",
        "gen_ai.usage.input_tokens": 197,
        "gen_ai.usage.output_tokens": 36,
        "gen_ai.usage.input_cost": 0.000019699999999999998,
        "gen_ai.usage.output_cost": 0.0000108
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.37.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool get_current_time",
      "kind": "internal",
      "parent": {
        "trace_id": 183122279777172322684744876400756953563,
        "span_id": 12253070288137891175,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758028499915928000,
      "end_time": 1758028499919034000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 183122279777172322684744876400756953563,
        "span_id": 10228776255392323169,
        "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(*, timezone: str) -> str\nGet 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-09-16T09:14:59-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.37.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 183122279777172322684744876400756953563,
        "span_id": 12253070288137891175,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758028499920240000,
      "end_time": 1758028500146680000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 183122279777172322684744876400756953563,
        "span_id": 9269503876317208151,
        "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": 262,
        "gen_ai.usage.output_tokens": 33,
        "gen_ai.usage.input_cost": 0.0000262,
        "gen_ai.usage.output_cost": 9.9e-6
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.37.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool write_file",
      "kind": "internal",
      "parent": {
        "trace_id": 183122279777172322684744876400756953563,
        "span_id": 12253070288137891175,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758028500147635000,
      "end_time": 1758028500148457000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 183122279777172322684744876400756953563,
        "span_id": 15403562707434381698,
        "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:param text: The text to write to the file.",
        "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.37.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 183122279777172322684744876400756953563,
        "span_id": 12253070288137891175,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758028500149729000,
      "end_time": 1758028500732051000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 183122279777172322684744876400756953563,
        "span_id": 1726412464743061000,
        "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": 285,
        "gen_ai.usage.output_tokens": 94,
        "gen_ai.usage.input_cost": 0.000028499999999999998,
        "gen_ai.usage.output_cost": 0.000028199999999999998
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.37.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool final_output",
      "kind": "internal",
      "parent": {
        "trace_id": 183122279777172322684744876400756953563,
        "span_id": 12253070288137891175,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758028500733145000,
      "end_time": 1758028500734292000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 183122279777172322684744876400756953563,
        "span_id": 18066273280650095232,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "attributes": {
        "gen_ai.operation.name": "execute_tool",
        "gen_ai.tool.name": "final_output",
        "gen_ai.tool.description": "final_output(answer: str) -> dict[str, str | bool | dict[str, typing.Any] | list[typing.Any]]\nThis tool is used to validate the final output. It must be called when the final answer is ready in order to ensure that the output is valid.",
        "gen_ai.tool.args": "{\"answer\": \"{\\\"steps\\\": [{\\\"number\\\": 1, \\\"description\\\": \\\"Get current time in the America/New_York timezone.\\\"}, {\\\"number\\\": 2, \\\"description\\\": \\\"Write the year to a file.\\\"}]}\"}",
        "gen_ai.output": "{\"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.37.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 183122279777172322684744876400756953563,
        "span_id": 12253070288137891175,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758028500735645000,
      "end_time": 1758028502141305000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 183122279777172322684744876400756953563,
        "span_id": 6597376107037947816,
        "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 steps I have taken:\n\n1. Get current time in the America/New_York timezone.\n2. Write the year to a file.",
        "gen_ai.output.type": "text",
        "gen_ai.usage.input_tokens": 403,
        "gen_ai.usage.output_tokens": 32,
        "gen_ai.usage.input_cost": 0.0000403,
        "gen_ai.usage.output_cost": 9.6e-6
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.37.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 183122279777172322684744876400756953563,
        "span_id": 12253070288137891175,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758028502143530000,
      "end_time": 1758028502855627000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 183122279777172322684744876400756953563,
        "span_id": 15563885816911253146,
        "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": "json",
        "gen_ai.usage.input_tokens": 161,
        "gen_ai.usage.output_tokens": 60,
        "gen_ai.usage.input_cost": 0.0000161,
        "gen_ai.usage.output_cost": 0.000018
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.37.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "invoke_agent [any_agent]",
      "kind": "internal",
      "parent": {
        "trace_id": null,
        "span_id": null,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758028498928802000,
      "end_time": 1758028502855731000,
      "status": {
        "status_code": "unset",
        "description": null
      },
      "context": {
        "trace_id": 183122279777172322684744876400756953563,
        "span_id": 12253070288137891175,
        "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",
        "any_agent.version": "1.9.1.dev3+g8bf65aae1.d20250916"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.37.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    }
  ],
  "final_output": {
    "steps": [
      {
        "number": 1,
        "description": "Get current time in the America/New_York timezone."
      },
      {
        "number": 2,
        "description": "Write the year to a file."
      }
    ]
  }
}
{
  "spans": [
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 100927429609276267646756448943279827607,
        "span_id": 12324293800750531911,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026593210770000,
      "end_time": 1758026593449611000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 100927429609276267646756448943279827607,
        "span_id": 9295669169508793927,
        "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": 269,
        "gen_ai.usage.output_tokens": 16,
        "gen_ai.usage.input_cost": 0.0000269,
        "gen_ai.usage.output_cost": 4.8e-6
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool get_current_time",
      "kind": "internal",
      "parent": {
        "trace_id": 100927429609276267646756448943279827607,
        "span_id": 12324293800750531911,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026593450406000,
      "end_time": 1758026593452926000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 100927429609276267646756448943279827607,
        "span_id": 13687147528289423029,
        "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-09-16T08:43:13-04:00\",\n  \"is_dst\": true\n}",
        "gen_ai.output.type": "json"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 100927429609276267646756448943279827607,
        "span_id": 12324293800750531911,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026593453682000,
      "end_time": 1758026593767325000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 100927429609276267646756448943279827607,
        "span_id": 1954108595464389762,
        "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": 359,
        "gen_ai.usage.output_tokens": 14,
        "gen_ai.usage.input_cost": 0.0000359,
        "gen_ai.usage.output_cost": 4.2e-6
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool write_file",
      "kind": "internal",
      "parent": {
        "trace_id": 100927429609276267646756448943279827607,
        "span_id": 12324293800750531911,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026593769194000,
      "end_time": 1758026593771373000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 100927429609276267646756448943279827607,
        "span_id": 3402142098134531952,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "attributes": {
        "gen_ai.operation.name": "execute_tool",
        "gen_ai.tool.name": "write_file",
        "gen_ai.tool.description": "write the text to a file in the tmp_path directory",
        "gen_ai.tool.args": "{\"text\": \"2025\"}",
        "gen_ai.output": "{}",
        "gen_ai.output.type": "json"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 100927429609276267646756448943279827607,
        "span_id": 12324293800750531911,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026593773377000,
      "end_time": 1758026594435103000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 100927429609276267646756448943279827607,
        "span_id": 10907162358052518539,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "attributes": {
        "gen_ai.operation.name": "call_llm",
        "gen_ai.request.model": "mistral/mistral-small-latest",
        "gen_ai.output": "{\"steps\": [{\"number\": 1, \"description\": \"Get current time in the America/New_York timezone.\"}, {\"number\": 2, \"description\": \"Write the year to a file.\"}]}",
        "gen_ai.output.type": "json",
        "gen_ai.usage.input_tokens": 392,
        "gen_ai.usage.output_tokens": 46,
        "gen_ai.usage.input_cost": 0.0000392,
        "gen_ai.usage.output_cost": 0.0000138
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "invoke_agent [any_agent]",
      "kind": "internal",
      "parent": {
        "trace_id": null,
        "span_id": null,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026593209236000,
      "end_time": 1758026594436486000,
      "status": {
        "status_code": "unset",
        "description": null
      },
      "context": {
        "trace_id": 100927429609276267646756448943279827607,
        "span_id": 12324293800750531911,
        "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",
        "any_agent.version": "1.9.1.dev0+g8e34f9a88.d20250915"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    }
  ],
  "final_output": {
    "steps": [
      {
        "number": 1,
        "description": "Get current time in the America/New_York timezone."
      },
      {
        "number": 2,
        "description": "Write the year to a file."
      }
    ]
  }
}
{
  "spans": [
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 193014249579837554382251753808266698816,
        "span_id": 2377815918452923285,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026599903043000,
      "end_time": 1758026600205276000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 193014249579837554382251753808266698816,
        "span_id": 5217401444604234849,
        "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'}}, 'properties': {'steps': {'items': {'$ref': '#/$defs/Step'}, 'title': 'Steps', 'type': 'array'}}, 'required': ['steps'], 'title': 'Steps', 'type': 'object'}\"}, {\"role\": \"user\", \"content\": \"New task:\\nFind what year it is in the America/New_York timezone and write the value (single number) to a file. Finally, return a list of the steps you have taken.\"}]",
        "gen_ai.output": "[{\"tool.name\": \"get_current_time\", \"tool.args\": \"{\\\"timezone\\\": \\\"America/New_York\\\"}\"}]",
        "gen_ai.output.type": "json",
        "gen_ai.usage.input_tokens": 677,
        "gen_ai.usage.output_tokens": 16,
        "gen_ai.usage.input_cost": 0.00006769999999999999,
        "gen_ai.usage.output_cost": 4.8e-6
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool get_current_time",
      "kind": "internal",
      "parent": {
        "trace_id": 193014249579837554382251753808266698816,
        "span_id": 2377815918452923285,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026600206847000,
      "end_time": 1758026600209406000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 193014249579837554382251753808266698816,
        "span_id": 6362149822438609756,
        "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-09-16T08:43:20-04:00\",\n  \"is_dst\": true\n}",
        "gen_ai.output.type": "json"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 193014249579837554382251753808266698816,
        "span_id": 2377815918452923285,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026600209578000,
      "end_time": 1758026600499567000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 193014249579837554382251753808266698816,
        "span_id": 1718758194134576853,
        "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": 782,
        "gen_ai.usage.output_tokens": 14,
        "gen_ai.usage.input_cost": 0.00007819999999999999,
        "gen_ai.usage.output_cost": 4.2e-6
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool write_file",
      "kind": "internal",
      "parent": {
        "trace_id": 193014249579837554382251753808266698816,
        "span_id": 2377815918452923285,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026600500018000,
      "end_time": 1758026600502243000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 193014249579837554382251753808266698816,
        "span_id": 15036084660665439760,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "attributes": {
        "gen_ai.operation.name": "execute_tool",
        "gen_ai.tool.name": "write_file",
        "gen_ai.tool.description": "write the text to a file in the tmp_path directory",
        "gen_ai.tool.args": "{\"text\": \"2025\"}",
        "gen_ai.output": "{}",
        "gen_ai.output.type": "json"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 193014249579837554382251753808266698816,
        "span_id": 2377815918452923285,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026600502982000,
      "end_time": 1758026601057378000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 193014249579837554382251753808266698816,
        "span_id": 14876458401309029265,
        "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 to a file.\\\\\\\"}]}\\\"}\"}]",
        "gen_ai.output.type": "json",
        "gen_ai.usage.input_tokens": 835,
        "gen_ai.usage.output_tokens": 57,
        "gen_ai.usage.input_cost": 0.0000835,
        "gen_ai.usage.output_cost": 0.0000171
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool final_answer",
      "kind": "internal",
      "parent": {
        "trace_id": 193014249579837554382251753808266698816,
        "span_id": 2377815918452923285,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026601057895000,
      "end_time": 1758026601060767000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 193014249579837554382251753808266698816,
        "span_id": 13738272699182380164,
        "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 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 to a file.\"}]}",
        "gen_ai.output.type": "json"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "invoke_agent [any_agent]",
      "kind": "internal",
      "parent": {
        "trace_id": null,
        "span_id": null,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026599902637000,
      "end_time": 1758026601061025000,
      "status": {
        "status_code": "unset",
        "description": null
      },
      "context": {
        "trace_id": 193014249579837554382251753808266698816,
        "span_id": 2377815918452923285,
        "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",
        "any_agent.version": "1.9.1.dev0+g8e34f9a88.d20250915"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    }
  ],
  "final_output": {
    "steps": [
      {
        "number": 1,
        "description": "Get the current time in the America/New_York timezone."
      },
      {
        "number": 2,
        "description": "Write the year to a file."
      }
    ]
  }
}
{
  "spans": [
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 200754113673326459792359196831899614724,
        "span_id": 10398286333944367643,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026601289496000,
      "end_time": 1758026601631557000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 200754113673326459792359196831899614724,
        "span_id": 17462846557343803630,
        "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": 328,
        "gen_ai.usage.output_tokens": 16,
        "gen_ai.usage.input_cost": 0.0000328,
        "gen_ai.usage.output_cost": 4.8e-6
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool get_current_time",
      "kind": "internal",
      "parent": {
        "trace_id": 200754113673326459792359196831899614724,
        "span_id": 10398286333944367643,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026601631711000,
      "end_time": 1758026601634284000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 200754113673326459792359196831899614724,
        "span_id": 12552362084418536424,
        "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-09-16T08:43:21-04:00\",\n  \"is_dst\": true\n}",
        "gen_ai.output.type": "json"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 200754113673326459792359196831899614724,
        "span_id": 10398286333944367643,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026601634336000,
      "end_time": 1758026602963917000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 200754113673326459792359196831899614724,
        "span_id": 9395046233243236617,
        "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": 414,
        "gen_ai.usage.output_tokens": 14,
        "gen_ai.usage.input_cost": 0.0000414,
        "gen_ai.usage.output_cost": 4.2e-6
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool write_file",
      "kind": "internal",
      "parent": {
        "trace_id": 200754113673326459792359196831899614724,
        "span_id": 10398286333944367643,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026602964206000,
      "end_time": 1758026602967081000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 200754113673326459792359196831899614724,
        "span_id": 13094185588603238916,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "attributes": {
        "gen_ai.operation.name": "execute_tool",
        "gen_ai.tool.name": "write_file",
        "gen_ai.tool.args": "{\"text\": \"2025\"}",
        "gen_ai.output": "None",
        "gen_ai.output.type": "text"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 200754113673326459792359196831899614724,
        "span_id": 10398286333944367643,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026602967229000,
      "end_time": 1758026603465838000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 200754113673326459792359196831899614724,
        "span_id": 12817121744145091219,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "attributes": {
        "gen_ai.operation.name": "call_llm",
        "gen_ai.request.model": "mistral/mistral-small-latest",
        "gen_ai.output": "[{\"tool.name\": \"final_answer\", \"tool.args\": \"{\\\"answer\\\": \\\"1. Get current time in the America/New_York timezone. 2. Write the year to a file. 3. Return the list of steps taken.\\\"}\"}]",
        "gen_ai.output.type": "json",
        "gen_ai.usage.input_tokens": 449,
        "gen_ai.usage.output_tokens": 43,
        "gen_ai.usage.input_cost": 0.0000449,
        "gen_ai.usage.output_cost": 0.0000129
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "execute_tool final_answer",
      "kind": "internal",
      "parent": {
        "trace_id": 200754113673326459792359196831899614724,
        "span_id": 10398286333944367643,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026603470642000,
      "end_time": 1758026603472241000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 200754113673326459792359196831899614724,
        "span_id": 7916564517670538421,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "attributes": {
        "gen_ai.operation.name": "execute_tool",
        "gen_ai.tool.name": "final_answer",
        "gen_ai.tool.args": "{\"answer\": \"1. Get current time in the America/New_York timezone. 2. Write the year to a file. 3. Return the list of steps taken.\"}",
        "gen_ai.output": "1. Get current time in the America/New_York timezone. 2. Write the year to a file. 3. Return the list of steps taken.",
        "gen_ai.output.type": "text"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "call_llm mistral/mistral-small-latest",
      "kind": "internal",
      "parent": {
        "trace_id": 200754113673326459792359196831899614724,
        "span_id": 10398286333944367643,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026603472911000,
      "end_time": 1758026604388771000,
      "status": {
        "status_code": "ok",
        "description": null
      },
      "context": {
        "trace_id": 200754113673326459792359196831899614724,
        "span_id": 549755261599922540,
        "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      \"number\": 3,\n      \"description\": \"Return the list of steps taken.\"\n    }\n  ]\n}",
        "gen_ai.output.type": "json",
        "gen_ai.usage.input_tokens": 178,
        "gen_ai.usage.output_tokens": 83,
        "gen_ai.usage.input_cost": 0.0000178,
        "gen_ai.usage.output_cost": 0.0000249
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    },
    {
      "name": "invoke_agent [any_agent]",
      "kind": "internal",
      "parent": {
        "trace_id": null,
        "span_id": null,
        "is_remote": false,
        "trace_flags": {
          "value": 0
        },
        "trace_state": {
          "entries": {}
        }
      },
      "start_time": 1758026601289354000,
      "end_time": 1758026604388853000,
      "status": {
        "status_code": "unset",
        "description": null
      },
      "context": {
        "trace_id": 200754113673326459792359196831899614724,
        "span_id": 10398286333944367643,
        "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",
        "any_agent.version": "1.9.1.dev0+g8e34f9a88.d20250915"
      },
      "links": [],
      "events": [],
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.36.0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      }
    }
  ],
  "final_output": {
    "steps": [
      {
        "number": 1,
        "description": "Get current time in the America/New_York timezone."
      },
      {
        "number": 2,
        "description": "Write the year to a file."
      },
      {
        "number": 3,
        "description": "Return the list of steps taken."
      }
    ]
  }
}

Dumping to File

The AgentTrace object is a pydantic model and can be saved to disk via standard pydantic practices:

from any_agent import AgentConfig, AnyAgent
from any_agent.tools import search_web

agent = AnyAgent.create(
    "openai",
    agent_config=AgentConfig(
            model_id="mistral/mistral-small-latest",
            tools=[search_web],
    )
)
agent_trace = agent.run("Which agent framework is the best?")
with open("agent_trace.json", "w", encoding="utf-8") as f:
  f.write(agent_trace.model_dump_json(indent=2, serialize_as_any=True))

Tip

Passing serialize_as_any=True makes sure that the final_output gets dumped even when AgentConfig.output_type is used.

Adding an OpenTelemetry exporter

Before starting to use the library, you can add new OpenTelemetry exporters and processors as needed.

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:

Tip

To use custom exporters you need to install their required dependencies, In this example, it would be pip install opentelemetry-exporter-otlp.

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