Files
crewAI/lib
Joao Moura 2c13b72d5b fix(output): expose token usage under both names on agent and crew results
Agent.kickoff() returned LiteAgentOutput with a plain dict at
.usage_metrics and no token_usage attribute, while Crew.kickoff()
returned CrewOutput with a UsageMetrics object at .token_usage and no
usage_metrics attribute — so a usage accessor written for one path
raised AttributeError on the other, and every consumer had to
duck-type both shapes.

Give both result types both surfaces, each name with one consistent
shape everywhere: .token_usage is a UsageMetrics object and
.usage_metrics is a plain dict, on both LiteAgentOutput and CrewOutput.
Added as read-only properties, so existing fields, serialization, and
constructors are unchanged.

Fixes EPD-178.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 23:07:34 -07:00
..
2026-07-07 18:59:59 -07:00