Przeglądaj źródła

Merge pull request #5777 from smonux/dev

Fix: sanitize function calling json
Timothy Jaeryang Baek 7 miesięcy temu
rodzic
commit
9636913de0
1 zmienionych plików z 1 dodań i 0 usunięć
  1. 1 0
      backend/open_webui/main.py

+ 1 - 0
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)