mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
fix: Use UsageMetrics as default_factory for token_usage
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -23,7 +23,7 @@ class CrewOutput(BaseModel):
|
|||||||
tasks_output: list[TaskOutput] = Field(
|
tasks_output: list[TaskOutput] = Field(
|
||||||
description="Output of each task", default=[]
|
description="Output of each task", default=[]
|
||||||
)
|
)
|
||||||
token_usage: UsageMetrics = Field(description="Processed token summary", default_factory=lambda: {})
|
token_usage: UsageMetrics = Field(description="Processed token summary", default_factory=UsageMetrics)
|
||||||
|
|
||||||
def model_json(self) -> str:
|
def model_json(self) -> str:
|
||||||
"""Get the JSON representation of the output."""
|
"""Get the JSON representation of the output."""
|
||||||
|
|||||||
Reference in New Issue
Block a user