updating manager llm pydantic error

This commit is contained in:
João Moura
2024-05-02 23:39:56 -03:00
parent 3f1fda6a63
commit 68e1444ed8
2 changed files with 2 additions and 5 deletions

View File

@@ -175,8 +175,8 @@ class Crew(BaseModel):
not self.manager_llm and not self.manager_agent
):
raise PydanticCustomError(
"missing_manager_llm",
"Attribute `manager_llm` is required when using hierarchical process.",
"missing_manager_llm_or_manager_agent",
"Attribute `manager_llm` or `manager_agent` is required when using hierarchical process.",
{},
)
return self

View File

@@ -918,8 +918,6 @@ def test_crew_log_file_output(tmp_path):
def test_manager_agent():
from unittest.mock import patch
from langchain_openai import ChatOpenAI
task = Task(
description="Come up with a list of 5 interesting ideas to explore for an article, then write one amazing paragraph highlight for each idea that showcases how good an article about this topic could be. Return the list of ideas with their paragraph and your notes.",
expected_output="5 bullet points with a paragraph for each idea.",
@@ -930,7 +928,6 @@ def test_manager_agent():
goal="Manage the crew and ensure the tasks are completed efficiently.",
backstory="You're an experienced manager, skilled in overseeing complex projects and guiding teams to success. Your role is to coordinate the efforts of the crew members, ensuring that each task is completed on time and to the highest standard.",
allow_delegation=False,
llm=ChatOpenAI(temperature=0, model="gpt-4"),
)
crew = Crew(