mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
fix: use Any type for TaskOutput.raw to support both string and dict
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -482,7 +482,7 @@ class Task(BaseModel):
|
||||
elif isinstance(guardrail_result.result, dict):
|
||||
task_output.raw = guardrail_result.result
|
||||
task_output.json_dict = guardrail_result.result
|
||||
pydantic_output, json_output = self._export_output(
|
||||
pydantic_output, _ = self._export_output(
|
||||
json.dumps(guardrail_result.result)
|
||||
)
|
||||
task_output.pydantic = pydantic_output
|
||||
|
||||
@@ -15,7 +15,7 @@ class TaskOutput(BaseModel):
|
||||
description="Expected output of the task", default=None
|
||||
)
|
||||
summary: Optional[str] = Field(description="Summary of the task", default=None)
|
||||
raw: Union[str, Dict[str, Any]] = Field(description="Raw output of the task", default="")
|
||||
raw: Any = Field(description="Raw output of the task", default="")
|
||||
pydantic: Optional[BaseModel] = Field(
|
||||
description="Pydantic output of task", default=None
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user