Skip to content

Commit 28d16a9

Browse files
Pass tool not available back to the model (#709)
* Change * Fix
1 parent 939189e commit 28d16a9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/backend/chat/custom/tool_calls.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,16 @@ async def _call_tool_async(
7878
) -> List[Dict[str, Any]]:
7979
tool = AVAILABLE_TOOLS.get(tool_call["name"])
8080
if not tool:
81-
return []
81+
logger.info(
82+
event=f"[Custom Chat] Tool not included in tools parameter: {tool_call['name']}",
83+
)
84+
outputs = [
85+
{
86+
"call": tool_call,
87+
"outputs": [{"text": f"Tool {tool_call['name']} not found", "success": False}],
88+
}
89+
]
90+
return outputs
8291

8392
try:
8493
outputs = await tool.implementation().call(

0 commit comments

Comments
 (0)