diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 4c1a2053d..40fac171f 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -448,6 +448,7 @@ async def chat_completion_tools_handler( if not content: return body, {} + content = content[content.find("{") : content.rfind("}") + 1] result = json.loads(content) tool_function_name = result.get("name", None)