mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 22:18:10 -05:00
using .casefold() instead of lower
This commit is contained in:
@@ -47,16 +47,20 @@ class AgentTools(BaseModel):
|
|||||||
agent = [
|
agent = [
|
||||||
available_agent
|
available_agent
|
||||||
for available_agent in self.agents
|
for available_agent in self.agents
|
||||||
if available_agent.role.strip().lower() == agent.strip().lower()
|
if available_agent.role.casefold().strip() == agent.casefold().strip()
|
||||||
]
|
]
|
||||||
except:
|
except:
|
||||||
return self.i18n.errors("agent_tool_unexsiting_coworker").format(
|
return self.i18n.errors("agent_tool_unexsiting_coworker").format(
|
||||||
coworkers="\n".join([f"- {agent.role}" for agent in self.agents])
|
coworkers="\n".join(
|
||||||
|
[f"- {agent.role.casefold()}" for agent in self.agents]
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if not agent:
|
if not agent:
|
||||||
return self.i18n.errors("agent_tool_unexsiting_coworker").format(
|
return self.i18n.errors("agent_tool_unexsiting_coworker").format(
|
||||||
coworkers="\n".join([f"- {agent.role}" for agent in self.agents])
|
coworkers="\n".join(
|
||||||
|
[f"- {agent.role.casefold()}" for agent in self.agents]
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
agent = agent[0]
|
agent = agent[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user