Add docs for crewoutput and taskoutput (#943)

* Add docs for crewoutput and taskoutput

* Add reference to change log
This commit is contained in:
Brandon Hancock (bhancock_ai)
2024-07-15 20:39:15 -04:00
committed by GitHub
parent 02f6da700a
commit c1be369566
5 changed files with 166 additions and 70 deletions

View File

@@ -30,20 +30,6 @@ class TaskOutput(BaseModel):
self.summary = f"{excerpt}..."
return self
# @property
# def pydantic(self) -> Optional[BaseModel]:
# # Check if the final task output included a pydantic model
# if self.output_format != OutputFormat.PYDANTIC:
# raise ValueError(
# """
# Invalid output format requested.
# If you would like to access the pydantic model,
# please make sure to set the output_pydantic property for the task.
# """
# )
# return self._pydantic
@property
def json(self) -> Optional[str]:
if self.output_format != OutputFormat.JSON:
@@ -62,7 +48,7 @@ class TaskOutput(BaseModel):
output_dict = {}
if self.json_dict:
output_dict.update(self.json_dict)
if self.pydantic:
elif self.pydantic:
output_dict.update(self.pydantic.model_dump())
return output_dict