mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-21 22:08:21 +00:00
outline tests I need to create going forward
This commit is contained in:
@@ -7,7 +7,9 @@ from crewai.tasks.task_output import TaskOutput
|
||||
|
||||
# TODO: Potentially add in JSON_OUTPUT, PYDANTIC_OUTPUT, etc.
|
||||
class CrewOutput(BaseModel):
|
||||
final_output: str = Field(description="Final output of the crew")
|
||||
final_output: Union[str, Dict, BaseModel] = Field(
|
||||
description="Final output of the crew"
|
||||
)
|
||||
tasks_output: list[TaskOutput] = Field(
|
||||
description="Output of each task", default=[]
|
||||
)
|
||||
|
||||
@@ -4,7 +4,7 @@ import threading
|
||||
import uuid
|
||||
from concurrent.futures import Future
|
||||
from copy import deepcopy
|
||||
from typing import Any, Dict, List, Optional, Type
|
||||
from typing import Any, Dict, List, Optional, Type, Union
|
||||
|
||||
from langchain_openai import ChatOpenAI
|
||||
from pydantic import UUID4, BaseModel, Field, field_validator, model_validator
|
||||
@@ -292,7 +292,7 @@ class Task(BaseModel):
|
||||
)
|
||||
return copied_task
|
||||
|
||||
def _export_output(self, result: str) -> Any:
|
||||
def _export_output(self, result: str) -> Union[str, dict, BaseModel]:
|
||||
exported_result = result
|
||||
instructions = "I'm gonna convert this raw text into valid JSON."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user