Understanding team run and session metrics in Agno
TeamRunResponse
aggregates metrics across all team leader messages.TeamRunResponse.metrics
: Aggregated metrics for the team leader’s run, as a dictionary.TeamRunResponse.member_responses
: Individual member responses with their own metrics.ToolExecution.metrics
: Metrics for each tool call.Message.metrics
: Metrics for each message (assistant, tool, etc.).Team.session_metrics
: Session-level metrics for the team leader.Team.full_team_session_metrics
: Session-level metrics including all team member metrics.team.run_response.member_responses
. This allows you to analyze the performance of individual team members.
messages
: List of messages with individual metricsmetrics
: Aggregated metrics for that member’s runtools
: Tool executions with their own metricsteam.session_metrics
provides aggregated metrics across all runs in the session for the team leader only.
team.full_team_session_metrics
provides comprehensive metrics that include both the team leader and all team members across all runs in the session.
TeamRunResponse.metrics
is a dictionary where each key (e.g., input_tokens) maps to a list of values from all assistant messages in the run.team.session_metrics
aggregates metrics across all team leader runs in the session.RunResponse
objects.team.full_team_session_metrics
combines metrics from the team leader and all team members.team.full_team_session_metrics
provides a complete view of all token usage and performance metrics across the entire team.Metric Level | Access Method | Description |
---|---|---|
Team Leader Run | team.run_response.metrics | Aggregated metrics for the current run |
Team Leader Session | team.session_metrics | Aggregated metrics across all team leader runs |
Individual Member | member_response.metrics | Metrics for a specific team member’s run |
Full Team Session | team.full_team_session_metrics | Complete team metrics including all members |
MessageMetrics
ParamsField | Description |
---|---|
input_tokens | Number of tokens in the prompt/input to the model. |
output_tokens | Number of tokens generated by the model as output. |
total_tokens | Total tokens used (input + output). |
prompt_tokens | Tokens in the prompt (same as input_tokens in the case of OpenAI). |
completion_tokens | Tokens in the completion (same as output_tokens in the case of OpenAI). |
audio_tokens | Total audio tokens (if using audio input/output). |
input_audio_tokens | Audio tokens in the input. |
output_audio_tokens | Audio tokens in the output. |
cached_tokens | Tokens served from cache (if caching is used). |
cache_write_tokens | Tokens written to cache. |
reasoning_tokens | Tokens used for reasoning steps (if enabled). |
prompt_tokens_details | Dict with detailed breakdown of prompt tokens (used by OpenAI). |
completion_tokens_details | Dict with detailed breakdown of completion tokens (used by OpenAI). |
additional_metrics | Any extra metrics provided by the model/tool (e.g., latency, cost, etc.). |
time | Time taken to generate the message (in seconds). |
time_to_first_token | Time until the first token is generated (in seconds). |
Note: Not all fields are always present; it depends on the model/tool and the run.
SessionMetrics
ParamsField | Description |
---|---|
input_tokens | Number of tokens in the prompt/input to the model. |
output_tokens | Number of tokens generated by the model as output. |
total_tokens | Total tokens used (input + output). |
prompt_tokens | Tokens in the prompt (same as input_tokens in the case of OpenAI). |
completion_tokens | Tokens in the completion (same as output_tokens in the case of OpenAI). |
audio_tokens | Total audio tokens (if using audio input/output). |
input_audio_tokens | Audio tokens in the input. |
output_audio_tokens | Audio tokens in the output. |
cached_tokens | Tokens served from cache (if caching is used). |
cache_write_tokens | Tokens written to cache. |
reasoning_tokens | Tokens used for reasoning steps (if enabled). |
prompt_tokens_details | Dict with detailed breakdown of prompt tokens (used by OpenAI). |
completion_tokens_details | Dict with detailed breakdown of completion tokens (used by OpenAI). |
additional_metrics | Any extra metrics provided by the model/tool (e.g., latency, cost, etc.). |
time | Time taken to generate the message (in seconds). |
time_to_first_token | Time until the first token is generated (in seconds). |
Note: Not all fields are always present; it depends on the model/tool and the run.