refactoring task execution

This commit is contained in:
João Moura
2024-02-10 11:28:08 -08:00
parent 5a102251cf
commit bbbd976fe3
5 changed files with 62 additions and 26 deletions

View File

@@ -4,6 +4,7 @@ from langchain.tools import StructuredTool
from pydantic import BaseModel, Field
from crewai.agent import Agent
from crewai.task import Task
from crewai.utilities import I18N
@@ -53,4 +54,5 @@ class AgentTools(BaseModel):
)
agent = agent[0]
task = Task(description=task, agent=agent)
return agent.execute_task(task, context)