From 787987d2f03ceb2b7de2da8a8cbc12c30a11ce72 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 22 May 2025 12:41:00 +0400 Subject: [PATCH] refac/fix: optional tool param type --- backend/open_webui/utils/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/utils/tools.py b/backend/open_webui/utils/tools.py index f0b37b605..481e1e6e6 100644 --- a/backend/open_webui/utils/tools.py +++ b/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__)