using .casefold() instead of lower

This commit is contained in:
João Moura
2024-03-31 15:53:55 -03:00
parent 0d70302963
commit 9d7cdd56b5

View File

@@ -47,16 +47,20 @@ class AgentTools(BaseModel):
agent = [
available_agent
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:
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:
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]