mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-02 07:42:40 +00:00
adding more specific guidelines to agent delegation tools
This commit is contained in:
@@ -17,7 +17,7 @@ class AgentTools(BaseModel):
|
||||
description=dedent(f"""Useful to delegate a specific task to one of the
|
||||
following co-workers: [{', '.join([agent.role for agent in self.agents])}].
|
||||
The input to this tool should be a pipe (|) separated text of length
|
||||
three, representing the role you want to delegate it to, the task and
|
||||
three, representing the role you want to delegate it to, the task and
|
||||
information necessary. For example, `coworker|task|information`.
|
||||
""")
|
||||
),
|
||||
@@ -27,7 +27,7 @@ class AgentTools(BaseModel):
|
||||
description=dedent(f"""Useful to ask a question, opinion or take from on
|
||||
of the following co-workers: [{', '.join([agent.role for agent in self.agents])}].
|
||||
The input to this tool should be a pipe (|) separated text of length
|
||||
three, representing the role you want to ask it to, the question and
|
||||
three, representing the role you want to ask it to, the question and
|
||||
information necessary. For example, `coworker|question|information`.
|
||||
""")
|
||||
),
|
||||
@@ -46,10 +46,10 @@ class AgentTools(BaseModel):
|
||||
try:
|
||||
agent, task, information = command.split("|")
|
||||
except ValueError:
|
||||
return "Error executing tool. Missing exact 3 pipe (|) separated values."
|
||||
return "Error executing tool. Missing exact 3 pipe (|) separated values. For example, `coworker|task|information`."
|
||||
|
||||
if not agent or not task or not information:
|
||||
return "Error executing tool. Missing exact 3 pipe (|) separated values."
|
||||
return "Error executing tool. Missing exact 3 pipe (|) separated values. For example, `coworker|question|information`."
|
||||
|
||||
agent = [available_agent for available_agent in self.agents if available_agent.role == agent]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user