Browse Source

refac/fix: optional tool param type

Timothy Jaeryang Baek 1 month ago
parent
commit
787987d2f0
1 changed files with 1 additions and 1 deletions
  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__)