mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-17 14:55:23 +00:00
Merge pull request #5777 from smonux/dev
Fix: sanitize function calling json
This commit is contained in:
commit
9636913de0
1 changed files with 1 additions and 0 deletions
|
|
@ -448,6 +448,7 @@ async def chat_completion_tools_handler(
|
||||||
if not content:
|
if not content:
|
||||||
return body, {}
|
return body, {}
|
||||||
|
|
||||||
|
content = content[content.find("{") : content.rfind("}") + 1]
|
||||||
result = json.loads(content)
|
result = json.loads(content)
|
||||||
|
|
||||||
tool_function_name = result.get("name", None)
|
tool_function_name = result.get("name", None)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue