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:
João Moura
2024-05-13 02:29:04 -03:00
committed by GitHub
parent 7a4d3dd496
commit 7fd8850ddb
21 changed files with 204252 additions and 3737 deletions

View File

@@ -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()