adding function calling llm support

This commit is contained in:
João Moura
2024-02-13 02:57:12 -08:00
parent b72eb838c2
commit e55cee7372
11 changed files with 4378 additions and 14 deletions

View File

@@ -32,6 +32,7 @@ class Crew(BaseModel):
tasks: List of tasks assigned to the crew.
agents: List of agents part of this crew.
manager_llm: The language model that will run manager agent.
function_calling_llm: The language model that will run the tool calling for all the agents.
process: The process flow that the crew will follow (e.g., sequential).
verbose: Indicates the verbosity level for logging during execution.
config: Configuration settings for the crew.
@@ -60,6 +61,9 @@ class Crew(BaseModel):
manager_llm: Optional[Any] = Field(
description="Language model that will run the agent.", default=None
)
function_calling_llm: Optional[Any] = Field(
description="Language model that will run the agent.", default=None
)
config: Optional[Union[Json, Dict[str, Any]]] = Field(default=None)
id: UUID4 = Field(default_factory=uuid.uuid4, frozen=True)
share_crew: Optional[bool] = Field(default=False)
@@ -176,7 +180,11 @@ class Crew(BaseModel):
for agent in self.agents:
agent.i18n = I18N(language=self.language)
if (self.step_callback) and (not agent.step_callback):
if not agent.function_calling_llm:
agent.function_calling_llm = self.function_calling_llm
agent.create_agent_executor()
if not agent.step_callback:
agent.step_callback = self.step_callback
agent.create_agent_executor()