outline tests I need to create going forward

This commit is contained in:
Brandon Hancock
2024-06-20 15:39:59 -04:00
parent 26489ced1a
commit 5c504f4087
3 changed files with 20 additions and 10 deletions

View File

@@ -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=[]
)

View File

@@ -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."