mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 16:18:30 +00:00
Small RC Fixes (#608)
* mentioning ollama on the docs as embedder * lowering barrier to match tool with simialr name * Fixing agent tools to support co_worker * Adding new tests * Fixing type" * updating tests * fixing conflict
This commit is contained in:
@@ -219,13 +219,20 @@ class ToolUsage:
|
||||
)
|
||||
|
||||
def _select_tool(self, tool_name: str) -> BaseTool:
|
||||
for tool in self.tools:
|
||||
order_tools = sorted(
|
||||
self.tools,
|
||||
key=lambda tool: SequenceMatcher(
|
||||
None, tool.name.lower().strip(), tool_name.lower().strip()
|
||||
).ratio(),
|
||||
reverse=True,
|
||||
)
|
||||
for tool in order_tools:
|
||||
if (
|
||||
tool.name.lower().strip() == tool_name.lower().strip()
|
||||
or SequenceMatcher(
|
||||
None, tool.name.lower().strip(), tool_name.lower().strip()
|
||||
).ratio()
|
||||
> 0.9
|
||||
> 0.85
|
||||
):
|
||||
return tool
|
||||
self.task.increment_tools_errors()
|
||||
|
||||
Reference in New Issue
Block a user