Преглед на файлове

refac/fix: optional tool param type

Timothy Jaeryang Baek преди 4 месеца
родител
ревизия
787987d2f0
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      backend/open_webui/utils/tools.py

+ 1 - 1
backend/open_webui/utils/tools.py

@@ -160,7 +160,7 @@ def get_tools(
                 # TODO: Fix hack for OpenAI API
                 # Some times breaks OpenAI but others don't. Leaving the comment
                 for val in spec.get("parameters", {}).get("properties", {}).values():
-                    if val["type"] == "str":
+                    if val.get("type") == "str":
                         val["type"] = "string"
 
                 # Remove internal reserved parameters (e.g. __id__, __user__)