Reliability improvements (#77)

* fixing identation for AgentTools
* updating gitignore to exclude quick test script
* startingprompt translation
* supporting individual task output
* adding agent to task output
* cutting new version
* Updating README example
This commit is contained in:
João Moura
2024-01-07 12:43:23 -03:00
committed by GitHub
parent ca8c7266ed
commit 2ef682edf3
11 changed files with 124 additions and 122 deletions

View File

@@ -111,21 +111,21 @@ class Crew(BaseModel):
Returns:
Output of the crew.
"""
task_outcome = None
task_output = None
for task in self.tasks:
# Add delegation tools to the task if the agent allows it
if task.agent.allow_delegation:
tools = AgentTools(agents=self.agents).tools()
task.tools += tools
agent_tools = AgentTools(agents=self.agents).tools()
task.tools += agent_tools
self.__log("debug", f"Working Agent: {task.agent.role}")
self.__log("info", f"Starting Task: {task.description} ...")
self.__log("info", f"Starting Task: {task.description}")
task_outcome = task.execute(task_outcome)
self.__log("debug", f"Task output: {task_outcome}")
return task_outcome
task_output = task.execute(task_output)
self.__log(
"debug", f"\n\n[{task.agent.role}] Task output: {task_output}\n\n"
)
return task_output
def __log(self, level, message):
"""Log a message"""