mirror of
https://github.com/HKUDS/OpenSpace.git
synced 2026-09-06 08:16:07 +00:00
fix: use resolved tool_obj for fallback tool execution
When the LLM returns a short tool name that doesn't match the deduped key in tool_map, the fallback scan correctly resolves tool_obj via schema.name. However the execution branch still checked `tool_name not in tool_map` and passed `tool_map[tool_name]`, so fallback-resolved tools were never executed. Change the condition to check `tool_obj is None` and pass `tool_obj` directly to _execute_tool_call. Closes #15 Made-with: Cursor
This commit is contained in:
parent
6f581f6de4
commit
f89ea89ffb
1 changed files with 2 additions and 2 deletions
|
|
@ -754,7 +754,7 @@ class LLMClient:
|
|||
except:
|
||||
pass
|
||||
|
||||
if tool_name not in tool_map:
|
||||
if tool_obj is None:
|
||||
result = ToolResult(
|
||||
status=ToolStatus.ERROR,
|
||||
error=f"Tool '{tool_name}' not found"
|
||||
|
|
@ -762,7 +762,7 @@ class LLMClient:
|
|||
else:
|
||||
try:
|
||||
result = await _execute_tool_call(
|
||||
tool=tool_map[tool_name],
|
||||
tool=tool_obj,
|
||||
openai_tool_call={
|
||||
"id": tool_call.id,
|
||||
"type": "function",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue