Fix: LLM tool does not exist in multiple retrieval case (#12143)

### What problem does this PR solve?

 Fix LLM tool does not exist in multiple retrieval case

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
TeslaZY
2025-12-24 13:26:48 +08:00
committed by GitHub
parent f239bc02d3
commit 6400bf87ba
2 changed files with 12 additions and 5 deletions

View File

@ -339,7 +339,7 @@ def tool_schema(tools_description: list[dict], complete_task=False):
}
for idx, tool in enumerate(tools_description):
name = tool["function"]["name"]
desc[f"{name}_{idx}"] = tool
desc[name] = tool
return "\n\n".join([f"## {i+1}. {fnm}\n{json.dumps(des, ensure_ascii=False, indent=4)}" for i, (fnm, des) in enumerate(desc.items())])