[GH-ISSUE #14115] issue: Native Tool Calling with OpenAPI Spec with Array Query Parameter Generates Invalid AI Functions for OpenAI (OpenAI returns 400) #17147

Closed
opened 2026-04-19 22:53:46 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @alexaytov on GitHub (May 21, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/14115

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

v0.6.10

Ollama Version (if applicable)

No response

Operating System

macos

Browser (if applicable)

No response

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have listed steps to reproduce the bug in detail.

Expected Behavior

When using OpenAPI tool server for the generated functions for OpenAI to be valid so the LLM can work with them. Specifically about query parameters with type array:

{
            "name": "tags",
            "in": "query",
            "description": "Tags to filter by",
            "required": false,
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }

Actual Behavior

The generated functions from OpenAPI server for OpenAI are invalid and the LLM returns 400 bad request with this error: 400: Invalid schema for function 'findPetsByTags': In context=('properties', 'tags'), array schema missing items.

The generated request to OpenAPI has invalid function definitions:

{
    "stream": true,
    "model": "gpt-4o-mini",
    "messages": [
        {
            "role": "user",
            "content": "Hello"
        }
    ],
    "tools": [
        {
            "type": "function",
            "function": {
                "type": "function",
                "name": "updatePet",
                "description": "Update an existing pet by Id.",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "id": {
                            "type": "integer",
                            "format": "int64",
                            "example": 10
                        },
                        "name": {
                            "type": "string",
                            "example": "doggie"
                        },
                        "category": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "integer",
                                    "format": "int64",
                                    "example": 1
                                },
                                "name": {
                                    "type": "string",
                                    "example": "Dogs"
                                }
                            },
                            "xml": {
                                "name": "category"
                            }
                        },
                        "photoUrls": {
                            "type": "array",
                            "xml": {
                                "wrapped": true
                            },
                            "items": {
                                "type": "string",
                                "xml": {
                                    "name": "photoUrl"
                                }
                            }
                        },
                        "tags": {
                            "type": "array",
                            "xml": {
                                "wrapped": true
                            },
                            "items": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "integer",
                                        "format": "int64"
                                    },
                                    "name": {
                                        "type": "string"
                                    }
                                },
                                "xml": {
                                    "name": "tag"
                                }
                            }
                        },
                        "status": {
                            "type": "string",
                            "description": "pet status in the store",
                            "enum": [
                                "available",
                                "pending",
                                "sold"
                            ]
                        }
                    },
                    "required": [
                        "photoUrls",
                        "name"
                    ]
                }
            }
        },
        {
            "type": "function",
            "function": {
                "type": "function",
                "name": "addPet",
                "description": "Add a new pet to the store.",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "id": {
                            "type": "integer",
                            "format": "int64",
                            "example": 10
                        },
                        "name": {
                            "type": "string",
                            "example": "doggie"
                        },
                        "category": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "integer",
                                    "format": "int64",
                                    "example": 1
                                },
                                "name": {
                                    "type": "string",
                                    "example": "Dogs"
                                }
                            },
                            "xml": {
                                "name": "category"
                            }
                        },
                        "photoUrls": {
                            "type": "array",
                            "xml": {
                                "wrapped": true
                            },
                            "items": {
                                "type": "string",
                                "xml": {
                                    "name": "photoUrl"
                                }
                            }
                        },
                        "tags": {
                            "type": "array",
                            "xml": {
                                "wrapped": true
                            },
                            "items": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "integer",
                                        "format": "int64"
                                    },
                                    "name": {
                                        "type": "string"
                                    }
                                },
                                "xml": {
                                    "name": "tag"
                                }
                            }
                        },
                        "status": {
                            "type": "string",
                            "description": "pet status in the store",
                            "enum": [
                                "available",
                                "pending",
                                "sold"
                            ]
                        }
                    },
                    "required": [
                        "photoUrls",
                        "name"
                    ]
                }
            }
        },
        {
            "type": "function",
            "function": {
                "type": "function",
                "name": "findPetsByStatus",
                "description": "Multiple status values can be provided with comma separated strings.",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "status": {
                            "type": "string",
                            "description": "Status values that need to be considered for filter. Possible values: available, pending, sold"
                        }
                    },
                    "required": []
                }
            }
        },
        {
            "type": "function",
            "function": {
                "type": "function",
                "name": "findPetsByTags",
                "description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "tags": {
                            "type": "array",
                            "description": "Tags to filter by"
                        }
                    },
                    "required": []
                }
            }
        },
        {
            "type": "function",
            "function": {
                "type": "function",
                "name": "getPetById",
                "description": "Returns a single pet.",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "petId": {
                            "type": "integer",
                            "description": "ID of pet to return"
                        }
                    },
                    "required": [
                        "petId"
                    ]
                }
            }
        },
        {
            "type": "function",
            "function": {
                "type": "function",
                "name": "updatePetWithForm",
                "description": "Updates a pet resource based on the form data.",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "petId": {
                            "type": "integer",
                            "description": "ID of pet that needs to be updated"
                        },
                        "name": {
                            "type": "string",
                            "description": "Name of pet that needs to be updated"
                        },
                        "status": {
                            "type": "string",
                            "description": "Status of pet that needs to be updated"
                        }
                    },
                    "required": [
                        "petId"
                    ]
                }
            }
        },
        {
            "type": "function",
            "function": {
                "type": "function",
                "name": "deletePet",
                "description": "Delete a pet.",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "api_key": {
                            "type": "string",
                            "description": ""
                        },
                        "petId": {
                            "type": "integer",
                            "description": "Pet id to delete"
                        }
                    },
                    "required": [
                        "petId"
                    ]
                }
            }
        },
        {
            "type": "function",
            "function": {
                "type": "function",
                "name": "uploadFile",
                "description": "Upload image of the pet.",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "petId": {
                            "type": "integer",
                            "description": "ID of pet to update"
                        },
                        "additionalMetadata": {
                            "type": "string",
                            "description": "Additional Metadata"
                        }
                    },
                    "required": [
                        "petId"
                    ]
                }
            }
        },
        {
            "type": "function",
            "function": {
                "type": "function",
                "name": "getInventory",
                "description": "Returns a map of status codes to quantities.",
                "parameters": {
                    "type": "object",
                    "properties": {},
                    "required": []
                }
            }
        },
        {
            "type": "function",
            "function": {
                "type": "function",
                "name": "placeOrder",
                "description": "Place a new order in the store.",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "id": {
                            "type": "integer",
                            "format": "int64",
                            "example": 10
                        },
                        "petId": {
                            "type": "integer",
                            "format": "int64",
                            "example": 198772
                        },
                        "quantity": {
                            "type": "integer",
                            "format": "int32",
                            "example": 7
                        },
                        "shipDate": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "status": {
                            "type": "string",
                            "description": "Order Status",
                            "example": "approved",
                            "enum": [
                                "placed",
                                "approved",
                                "delivered"
                            ]
                        },
                        "complete": {
                            "type": "boolean"
                        }
                    },
                    "required": []
                }
            }
        },
        {
            "type": "function",
            "function": {
                "type": "function",
                "name": "getOrderById",
                "description": "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "orderId": {
                            "type": "integer",
                            "description": "ID of order that needs to be fetched"
                        }
                    },
                    "required": [
                        "orderId"
                    ]
                }
            }
        },
        {
            "type": "function",
            "function": {
                "type": "function",
                "name": "deleteOrder",
                "description": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors.",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "orderId": {
                            "type": "integer",
                            "description": "ID of the order that needs to be deleted"
                        }
                    },
                    "required": [
                        "orderId"
                    ]
                }
            }
        },
        {
            "type": "function",
            "function": {
                "type": "function",
                "name": "createUser",
                "description": "This can only be done by the logged in user.",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "id": {
                            "type": "integer",
                            "format": "int64",
                            "example": 10
                        },
                        "username": {
                            "type": "string",
                            "example": "theUser"
                        },
                        "firstName": {
                            "type": "string",
                            "example": "John"
                        },
                        "lastName": {
                            "type": "string",
                            "example": "James"
                        },
                        "email": {
                            "type": "string",
                            "example": "john@email.com"
                        },
                        "password": {
                            "type": "string",
                            "example": "12345"
                        },
                        "phone": {
                            "type": "string",
                            "example": "12345"
                        },
                        "userStatus": {
                            "type": "integer",
                            "description": "User Status",
                            "format": "int32",
                            "example": 1
                        }
                    },
                    "required": []
                }
            }
        },
        {
            "type": "function",
            "function": {
                "type": "function",
                "name": "createUsersWithListInput",
                "description": "Creates list of users with given input array.",
                "parameters": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer",
                                "format": "int64",
                                "example": 10
                            },
                            "username": {
                                "type": "string",
                                "example": "theUser"
                            },
                            "firstName": {
                                "type": "string",
                                "example": "John"
                            },
                            "lastName": {
                                "type": "string",
                                "example": "James"
                            },
                            "email": {
                                "type": "string",
                                "example": "john@email.com"
                            },
                            "password": {
                                "type": "string",
                                "example": "12345"
                            },
                            "phone": {
                                "type": "string",
                                "example": "12345"
                            },
                            "userStatus": {
                                "type": "integer",
                                "description": "User Status",
                                "format": "int32",
                                "example": 1
                            }
                        },
                        "xml": {
                            "name": "user"
                        }
                    }
                }
            }
        },
        {
            "type": "function",
            "function": {
                "type": "function",
                "name": "loginUser",
                "description": "Log into the system.",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "username": {
                            "type": "string",
                            "description": "The user name for login"
                        },
                        "password": {
                            "type": "string",
                            "description": "The password for login in clear text"
                        }
                    },
                    "required": []
                }
            }
        },
        {
            "type": "function",
            "function": {
                "type": "function",
                "name": "logoutUser",
                "description": "Log user out of the system.",
                "parameters": {
                    "type": "object",
                    "properties": {},
                    "required": []
                }
            }
        },
        {
            "type": "function",
            "function": {
                "type": "function",
                "name": "getUserByName",
                "description": "Get user detail based on username.",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "username": {
                            "type": "string",
                            "description": "The name that needs to be fetched. Use user1 for testing"
                        }
                    },
                    "required": [
                        "username"
                    ]
                }
            }
        },
        {
            "type": "function",
            "function": {
                "type": "function",
                "name": "updateUser",
                "description": "This can only be done by the logged in user.",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "username": {
                            "type": "string",
                            "example": "theUser"
                        },
                        "id": {
                            "type": "integer",
                            "format": "int64",
                            "example": 10
                        },
                        "firstName": {
                            "type": "string",
                            "example": "John"
                        },
                        "lastName": {
                            "type": "string",
                            "example": "James"
                        },
                        "email": {
                            "type": "string",
                            "example": "john@email.com"
                        },
                        "password": {
                            "type": "string",
                            "example": "12345"
                        },
                        "phone": {
                            "type": "string",
                            "example": "12345"
                        },
                        "userStatus": {
                            "type": "integer",
                            "description": "User Status",
                            "format": "int32",
                            "example": 1
                        }
                    },
                    "required": [
                        "username"
                    ]
                }
            }
        },
        {
            "type": "function",
            "function": {
                "type": "function",
                "name": "deleteUser",
                "description": "This can only be done by the logged in user.",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "username": {
                            "type": "string",
                            "description": "The name that needs to be deleted"
                        }
                    },
                    "required": [
                        "username"
                    ]
                }
            }
        }
    ]
}

The response is:

{
    "error": {
        "code": "invalid_function_parameters",
        "message": "Invalid schema for function 'findPetsByTags': In context=('properties', 'tags'), array schema missing items.",
        "param": "tools[3].function.parameters",
        "type": "invalid_request_error"
    }
}

The invalid function:

{
            "type": "function",
            "function": {
                "type": "function",
                "name": "findPetsByTags",
                "description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "tags": {
                            "type": "array",
                            "description": "Tags to filter by"
                        }
                    },
                    "required": []
                }
            }
        }

Steps to Reproduce

  1. Have an OpenAPI tool server with a query parameter defined as follows:
{
            "name": "tags",
            "in": "query",
            "description": "Tags to filter by",
            "required": false,
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
  1. Add the tool server to Open WebUI
  2. Start a new chat with an OpenAI backend
  3. Enable native function calling
  4. Type a message in the chat
  5. Observe the error response

Logs & Screenshots

Browser Console Logs:

ResponseMessage.svelte:566 <div class=​"flex justify-start overflow-x-auto buttons text-gray-600 dark:​text-gray-500 mt-0.5 svelte-1u5gq5j">​…​</div>​
MessageInput.svelte:378 destroy
RichTextInput.svelte:185 content 
RichTextInput.svelte:187 [tiptap warn]: Duplicate extension names found: ['codeBlock']. This can lead to issues.
resolve @ index.js:1183
tn @ index.js:1169
createExtensionManager @ index.js:4580
BE @ index.js:4412
(anonymous) @ RichTextInput.svelte:187
await in (anonymous)
J @ utils.js:41
(anonymous) @ Component.js:47
_t @ scheduler.js:99
Promise.then
ut @ scheduler.js:20
ht @ Component.js:81
(anonymous) @ Component.js:139
we @ Chat.svelte:761
await in we
Q @ Navbar.svelte:145
Chat.svelte:475 Assertion failed!
x @ assert.js:6
I @ paneforge.js:68
collapse @ pane.svelte:55
(anonymous) @ Chat.svelte:475
o @ index.js:56
j @ ChatControls.svelte:183
(anonymous) @ lifecycle.js:105
(anonymous) @ lifecycle.js:104
d @ Controls.svelte:26
Chat.svelte:475 Assertion failed!
x @ assert.js:6
I @ paneforge.js:68
collapse @ pane.svelte:55
(anonymous) @ Chat.svelte:475
o @ index.js:56
j @ ChatControls.svelte:183
(anonymous) @ lifecycle.js:105
(anonymous) @ lifecycle.js:104
d @ Controls.svelte:26
Chat.svelte:1294 submitPrompt Hello 
Chat.svelte:193 saveSessionSelectedModels ['gpt-4o-mini'] ["gpt-4o-mini"]
MessageInput.svelte:378 destroy
ResponseMessage.svelte:566 <div class=​"flex justify-start overflow-x-auto buttons text-gray-600 dark:​text-gray-500 mt-0.5 svelte-1u5gq5j">​</div>​
RichTextInput.svelte:185 content 
RichTextInput.svelte:187 [tiptap warn]: Duplicate extension names found: ['codeBlock']. This can lead to issues.
resolve @ index.js:1183
tn @ index.js:1169
createExtensionManager @ index.js:4580
BE @ index.js:4412
(anonymous) @ RichTextInput.svelte:187
await in (anonymous)
J @ utils.js:41
(anonymous) @ Component.js:47
_t @ scheduler.js:99
Promise.then
ut @ scheduler.js:20
ht @ Component.js:81
(anonymous) @ Component.js:139
Fe @ Chat.svelte:1346
Fo @ Chat.svelte:2169
await in Fo
(anonymous) @ lifecycle.js:105
(anonymous) @ lifecycle.js:104
J @ Placeholder.svelte:218
(anonymous) @ lifecycle.js:105
(anonymous) @ lifecycle.js:104
Yt @ MessageInput.svelte:801
(anonymous) @ lifecycle.js:105
(anonymous) @ lifecycle.js:104
keydown @ RichTextInput.svelte:330
(anonymous) @ index.js:3108
someProp @ index.js:5502
ji @ index.js:3106
Pu.t.dom.addEventListener.t.input.eventHandlers.<computed> @ index.js:3075
ResponseMessage.svelte:566 <div class=​"flex justify-start overflow-x-auto buttons text-gray-600 dark:​text-gray-500 mt-0.5 svelte-1u5gq5j">​</div>​flex
Chat.svelte:1468 modelId gpt-4o-mini
index.ts:369 
            
            
           POST http://localhost:3000/api/chat/completions 400 (Bad Request)
window.fetch @ fetcher.js:76
A @ index.ts:369
Tt @ Chat.svelte:1627
await in Tt
(anonymous) @ Chat.svelte:1517
await in (anonymous)
et @ Chat.svelte:1467
await in et
Fe @ Chat.svelte:1394
Fo @ Chat.svelte:2169
await in Fo
(anonymous) @ lifecycle.js:105
(anonymous) @ lifecycle.js:104
J @ Placeholder.svelte:218
(anonymous) @ lifecycle.js:105
(anonymous) @ lifecycle.js:104
Yt @ MessageInput.svelte:801
(anonymous) @ lifecycle.js:105
(anonymous) @ lifecycle.js:104
keydown @ RichTextInput.svelte:330
(anonymous) @ index.js:3108
someProp @ index.js:5502
ji @ index.js:3106
Pu.t.dom.addEventListener.t.input.eventHandlers.<computed> @ index.js:3075

Open WebUI Logs:

2025-05-21 08:22:43 2025-05-21 05:22:43.793 | INFO     | open_webui.routers.openai:get_all_models:391 - get_all_models() - {}
2025-05-21 08:22:44 2025-05-21 05:22:44.231 | ERROR    | open_webui.routers.openai:generate_chat_completion:866 - 400, message='Bad Request', url='http://mtimproxyweb:9096/chat/completions' - {}
2025-05-21 08:22:44 Traceback (most recent call last):
2025-05-21 08:22:44 
2025-05-21 08:22:44   File "<frozen runpy>", line 198, in _run_module_as_main
2025-05-21 08:22:44   File "<frozen runpy>", line 88, in _run_code
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/site-packages/uvicorn/__main__.py", line 4, in <module>
2025-05-21 08:22:44     uvicorn.main()
2025-05-21 08:22:44     │       └ <Command main>
2025-05-21 08:22:44     └ <module 'uvicorn' from '/usr/local/lib/python3.11/site-packages/uvicorn/__init__.py'>
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1442, in __call__
2025-05-21 08:22:44     return self.main(*args, **kwargs)
2025-05-21 08:22:44            │    │     │       └ {}
2025-05-21 08:22:44            │    │     └ ()
2025-05-21 08:22:44            │    └ <function Command.main at 0xffffa9c4a700>
2025-05-21 08:22:44            └ <Command main>
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1363, in main
2025-05-21 08:22:44     rv = self.invoke(ctx)
2025-05-21 08:22:44          │    │      └ <click.core.Context object at 0xffffaac7c750>
2025-05-21 08:22:44          │    └ <function Command.invoke at 0xffffa9c4a3e0>
2025-05-21 08:22:44          └ <Command main>
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1226, in invoke
2025-05-21 08:22:44     return ctx.invoke(self.callback, **ctx.params)
2025-05-21 08:22:44            │   │      │    │           │   └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ...
2025-05-21 08:22:44            │   │      │    │           └ <click.core.Context object at 0xffffaac7c750>
2025-05-21 08:22:44            │   │      │    └ <function main at 0xffffa9778cc0>
2025-05-21 08:22:44            │   │      └ <Command main>
2025-05-21 08:22:44            │   └ <function Context.invoke at 0xffffa9c49620>
2025-05-21 08:22:44            └ <click.core.Context object at 0xffffaac7c750>
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 794, in invoke
2025-05-21 08:22:44     return callback(*args, **kwargs)
2025-05-21 08:22:44            │         │       └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ...
2025-05-21 08:22:44            │         └ ()
2025-05-21 08:22:44            └ <function main at 0xffffa9778cc0>
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 412, in main
2025-05-21 08:22:44     run(
2025-05-21 08:22:44     └ <function run at 0xffffa9d1f740>
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 579, in run
2025-05-21 08:22:44     server.run()
2025-05-21 08:22:44     │      └ <function Server.run at 0xffffa9b64860>
2025-05-21 08:22:44     └ <uvicorn.server.Server object at 0xffffa9d23a90>
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 66, in run
2025-05-21 08:22:44     return asyncio.run(self.serve(sockets=sockets))
2025-05-21 08:22:44            │       │   │    │             └ None
2025-05-21 08:22:44            │       │   │    └ <function Server.serve at 0xffffa9b64900>
2025-05-21 08:22:44            │       │   └ <uvicorn.server.Server object at 0xffffa9d23a90>
2025-05-21 08:22:44            │       └ <function run at 0xffffaa1b5300>
2025-05-21 08:22:44            └ <module 'asyncio' from '/usr/local/lib/python3.11/asyncio/__init__.py'>
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
2025-05-21 08:22:44     return runner.run(main)
2025-05-21 08:22:44            │      │   └ <coroutine object Server.serve at 0xffffa99488b0>
2025-05-21 08:22:44            │      └ <function Runner.run at 0xffffa9f64ea0>
2025-05-21 08:22:44            └ <asyncio.runners.Runner object at 0xffffa976f6d0>
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
2025-05-21 08:22:44     return self._loop.run_until_complete(task)
2025-05-21 08:22:44            │    │     │                  └ <Task pending name='Task-1' coro=<Server.serve() running at /usr/local/lib/python3.11/site-packages/uvicorn/server.py:70> wai...
2025-05-21 08:22:44            │    │     └ <cyfunction Loop.run_until_complete at 0xffffa9773370>
2025-05-21 08:22:44            │    └ <uvloop.Loop running=True closed=False debug=False>
2025-05-21 08:22:44            └ <asyncio.runners.Runner object at 0xffffa976f6d0>
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 141, in coro
2025-05-21 08:22:44     await self.app(scope, receive_or_disconnect, send_no_error)
2025-05-21 08:22:44           │    │   │      │                      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0xffff11744900>
2025-05-21 08:22:44           │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff11746c00>
2025-05-21 08:22:44           │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
2025-05-21 08:22:44           │    └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0xffff1ab76390>
2025-05-21 08:22:44           └ <open_webui.main.RedirectMiddleware object at 0xffff1abe8210>
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
2025-05-21 08:22:44     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
2025-05-21 08:22:44           │                            │    │    │     │      │        └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0xffff11744900>
2025-05-21 08:22:44           │                            │    │    │     │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff11746c00>
2025-05-21 08:22:44           │                            │    │    │     └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
2025-05-21 08:22:44           │                            │    │    └ <starlette.requests.Request object at 0xffff1354c390>
2025-05-21 08:22:44           │                            │    └ <fastapi.routing.APIRouter object at 0xffff519e4250>
2025-05-21 08:22:44           │                            └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0xffff1ab76390>
2025-05-21 08:22:44           └ <function wrap_app_handling_exceptions at 0xffffa69a8b80>
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
2025-05-21 08:22:44     await app(scope, receive, sender)
2025-05-21 08:22:44           │   │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0xffff117465c0>
2025-05-21 08:22:44           │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff11746c00>
2025-05-21 08:22:44           │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
2025-05-21 08:22:44           └ <fastapi.routing.APIRouter object at 0xffff519e4250>
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
2025-05-21 08:22:44     await self.middleware_stack(scope, receive, send)
2025-05-21 08:22:44           │    │                │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0xffff117465c0>
2025-05-21 08:22:44           │    │                │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff11746c00>
2025-05-21 08:22:44           │    │                └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
2025-05-21 08:22:44           │    └ <bound method Router.app of <fastapi.routing.APIRouter object at 0xffff519e4250>>
2025-05-21 08:22:44           └ <fastapi.routing.APIRouter object at 0xffff519e4250>
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
2025-05-21 08:22:44     await route.handle(scope, receive, send)
2025-05-21 08:22:44           │     │      │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0xffff117465c0>
2025-05-21 08:22:44           │     │      │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff11746c00>
2025-05-21 08:22:44           │     │      └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
2025-05-21 08:22:44           │     └ <function Route.handle at 0xffffa69aa200>
2025-05-21 08:22:44           └ APIRoute(path='/api/chat/completions', name='chat_completion', methods=['POST'])
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
2025-05-21 08:22:44     await self.app(scope, receive, send)
2025-05-21 08:22:44           │    │   │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0xffff117465c0>
2025-05-21 08:22:44           │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff11746c00>
2025-05-21 08:22:44           │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
2025-05-21 08:22:44           │    └ <function request_response.<locals>.app at 0xffff1a7e1bc0>
2025-05-21 08:22:44           └ APIRoute(path='/api/chat/completions', name='chat_completion', methods=['POST'])
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
2025-05-21 08:22:44     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
2025-05-21 08:22:44           │                            │    │        │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0xffff117465c0>
2025-05-21 08:22:44           │                            │    │        │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff11746c00>
2025-05-21 08:22:44           │                            │    │        └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
2025-05-21 08:22:44           │                            │    └ <starlette.requests.Request object at 0xffff1354e5d0>
2025-05-21 08:22:44           │                            └ <function request_response.<locals>.app.<locals>.app at 0xffff11745a80>
2025-05-21 08:22:44           └ <function wrap_app_handling_exceptions at 0xffffa69a8b80>
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
2025-05-21 08:22:44     await app(scope, receive, sender)
2025-05-21 08:22:44           │   │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0xffff1357b9c0>
2025-05-21 08:22:44           │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff11746c00>
2025-05-21 08:22:44           │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
2025-05-21 08:22:44           └ <function request_response.<locals>.app.<locals>.app at 0xffff11745a80>
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
2025-05-21 08:22:44     response = await f(request)
2025-05-21 08:22:44                      │ └ <starlette.requests.Request object at 0xffff1354e5d0>
2025-05-21 08:22:44                      └ <function get_request_handler.<locals>.app at 0xffff1a7e1940>
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 301, in app
2025-05-21 08:22:44     raw_response = await run_endpoint_function(
2025-05-21 08:22:44                          └ <function run_endpoint_function at 0xffffa6958040>
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 212, in run_endpoint_function
2025-05-21 08:22:44     return await dependant.call(**values)
2025-05-21 08:22:44                  │         │      └ {'user': UserModel(id='14bcc998-5a6c-4a32-960a-1343e5cb1bc3', name='User', email='admin@localhost', role='admin', profile_ima...
2025-05-21 08:22:44                  │         └ <function chat_completion at 0xffff1a7e2340>
2025-05-21 08:22:44                  └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant...
2025-05-21 08:22:44 
2025-05-21 08:22:44   File "/app/backend/open_webui/main.py", line 1234, in chat_completion
2025-05-21 08:22:44     response = await chat_completion_handler(request, form_data, user)
2025-05-21 08:22:44                      │                       │        │          └ UserModel(id='14bcc998-5a6c-4a32-960a-1343e5cb1bc3', name='User', email='admin@localhost', role='admin', profile_image_url='/...
2025-05-21 08:22:44                      │                       │        └ {'stream': True, 'model': 'gpt-4o-mini', 'messages': [{'role': 'user', 'content': 'Hello'}], 'metadata': {'user_id': '14bcc99...
2025-05-21 08:22:44                      │                       └ <starlette.requests.Request object at 0xffff1354e5d0>
2025-05-21 08:22:44                      └ <function generate_chat_completion at 0xffff53025760>
2025-05-21 08:22:44 
2025-05-21 08:22:44   File "/app/backend/open_webui/utils/chat.py", line 275, in generate_chat_completion
2025-05-21 08:22:44     return await generate_openai_chat_completion(
2025-05-21 08:22:44                  └ <function generate_chat_completion at 0xffff53024b80>
2025-05-21 08:22:44 
2025-05-21 08:22:44 > File "/app/backend/open_webui/routers/openai.py", line 863, in generate_chat_completion
2025-05-21 08:22:44     r.raise_for_status()
2025-05-21 08:22:44     │ └ <function ClientResponse.raise_for_status at 0xffffa7223740>
2025-05-21 08:22:44     └ <ClientResponse(http://mtimproxyweb:9096/chat/completions) [400 Bad Request]>
2025-05-21 08:22:44       <CIMultiDictProxy('Date': 'Wed, 21 May 2025 05:...
2025-05-21 08:22:44 
2025-05-21 08:22:44   File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1161, in raise_for_status
2025-05-21 08:22:44     raise ClientResponseError(
2025-05-21 08:22:44           └ <class 'aiohttp.client_exceptions.ClientResponseError'>
2025-05-21 08:22:44 
2025-05-21 08:22:44 aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url='http://mtimproxyweb:9096/chat/completions'
2025-05-21 08:22:44 2025-05-21 05:22:44.240 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 172.18.0.1:59238 - "POST /api/chat/completions HTTP/1.1" 400 - {}
2025-05-21 08:22:44 2025-05-21 05:22:44.270 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 172.18.0.1:59238 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 - {}
2025-05-21 08:23:06 2025-05-21 05:23:06.294 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 172.18.0.1:62090 - "GET /_app/version.json HTTP/1.1" 200 - {}
2025-05-21 08:23:06 2025-05-21 05:23:06.298 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 172.18.0.1:62080 - "GET /_app/version.json HTTP/1.1" 200 - {}
2025-05-21 08:23:35 2025-05-21 05:23:35.249 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 172.18.0.1:64850 - "GET /_app/version.json HTTP/1.1" 200 - {}
2025-05-21 08:24:06 2025-05-21 05:24:06.251 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 172.18.0.1:65320 - "GET /_app/version.json HTTP/1.1" 200 - {}
2025-05-21 08:24:36 2025-05-21 05:24:36.260 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 172.18.0.1:63304 - "GET /_app/version.json HTTP/1.1" 200 - {}
Image

Additional Information

I am using the petstore openapi definition from: https://editor.swagger.io/ which then I translated to json with https://onlineyamltools.com/convert-yaml-to-json

Originally created by @alexaytov on GitHub (May 21, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/14115 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version v0.6.10 ### Ollama Version (if applicable) _No response_ ### Operating System macos ### Browser (if applicable) _No response_ ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have listed steps to reproduce the bug in detail. ### Expected Behavior When using OpenAPI tool server for the generated functions for OpenAI to be valid so the LLM can work with them. Specifically about query parameters with type array: ```json { "name": "tags", "in": "query", "description": "Tags to filter by", "required": false, "explode": true, "schema": { "type": "array", "items": { "type": "string" } } } ``` ### Actual Behavior The generated functions from OpenAPI server for OpenAI are invalid and the LLM returns 400 bad request with this error: 400: Invalid schema for function 'findPetsByTags': In context=('properties', 'tags'), array schema missing items. The generated request to OpenAPI has invalid function definitions: ``` { "stream": true, "model": "gpt-4o-mini", "messages": [ { "role": "user", "content": "Hello" } ], "tools": [ { "type": "function", "function": { "type": "function", "name": "updatePet", "description": "Update an existing pet by Id.", "parameters": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 10 }, "name": { "type": "string", "example": "doggie" }, "category": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 1 }, "name": { "type": "string", "example": "Dogs" } }, "xml": { "name": "category" } }, "photoUrls": { "type": "array", "xml": { "wrapped": true }, "items": { "type": "string", "xml": { "name": "photoUrl" } } }, "tags": { "type": "array", "xml": { "wrapped": true }, "items": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" } }, "xml": { "name": "tag" } } }, "status": { "type": "string", "description": "pet status in the store", "enum": [ "available", "pending", "sold" ] } }, "required": [ "photoUrls", "name" ] } } }, { "type": "function", "function": { "type": "function", "name": "addPet", "description": "Add a new pet to the store.", "parameters": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 10 }, "name": { "type": "string", "example": "doggie" }, "category": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 1 }, "name": { "type": "string", "example": "Dogs" } }, "xml": { "name": "category" } }, "photoUrls": { "type": "array", "xml": { "wrapped": true }, "items": { "type": "string", "xml": { "name": "photoUrl" } } }, "tags": { "type": "array", "xml": { "wrapped": true }, "items": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" } }, "xml": { "name": "tag" } } }, "status": { "type": "string", "description": "pet status in the store", "enum": [ "available", "pending", "sold" ] } }, "required": [ "photoUrls", "name" ] } } }, { "type": "function", "function": { "type": "function", "name": "findPetsByStatus", "description": "Multiple status values can be provided with comma separated strings.", "parameters": { "type": "object", "properties": { "status": { "type": "string", "description": "Status values that need to be considered for filter. Possible values: available, pending, sold" } }, "required": [] } } }, { "type": "function", "function": { "type": "function", "name": "findPetsByTags", "description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", "parameters": { "type": "object", "properties": { "tags": { "type": "array", "description": "Tags to filter by" } }, "required": [] } } }, { "type": "function", "function": { "type": "function", "name": "getPetById", "description": "Returns a single pet.", "parameters": { "type": "object", "properties": { "petId": { "type": "integer", "description": "ID of pet to return" } }, "required": [ "petId" ] } } }, { "type": "function", "function": { "type": "function", "name": "updatePetWithForm", "description": "Updates a pet resource based on the form data.", "parameters": { "type": "object", "properties": { "petId": { "type": "integer", "description": "ID of pet that needs to be updated" }, "name": { "type": "string", "description": "Name of pet that needs to be updated" }, "status": { "type": "string", "description": "Status of pet that needs to be updated" } }, "required": [ "petId" ] } } }, { "type": "function", "function": { "type": "function", "name": "deletePet", "description": "Delete a pet.", "parameters": { "type": "object", "properties": { "api_key": { "type": "string", "description": "" }, "petId": { "type": "integer", "description": "Pet id to delete" } }, "required": [ "petId" ] } } }, { "type": "function", "function": { "type": "function", "name": "uploadFile", "description": "Upload image of the pet.", "parameters": { "type": "object", "properties": { "petId": { "type": "integer", "description": "ID of pet to update" }, "additionalMetadata": { "type": "string", "description": "Additional Metadata" } }, "required": [ "petId" ] } } }, { "type": "function", "function": { "type": "function", "name": "getInventory", "description": "Returns a map of status codes to quantities.", "parameters": { "type": "object", "properties": {}, "required": [] } } }, { "type": "function", "function": { "type": "function", "name": "placeOrder", "description": "Place a new order in the store.", "parameters": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 10 }, "petId": { "type": "integer", "format": "int64", "example": 198772 }, "quantity": { "type": "integer", "format": "int32", "example": 7 }, "shipDate": { "type": "string", "format": "date-time" }, "status": { "type": "string", "description": "Order Status", "example": "approved", "enum": [ "placed", "approved", "delivered" ] }, "complete": { "type": "boolean" } }, "required": [] } } }, { "type": "function", "function": { "type": "function", "name": "getOrderById", "description": "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.", "parameters": { "type": "object", "properties": { "orderId": { "type": "integer", "description": "ID of order that needs to be fetched" } }, "required": [ "orderId" ] } } }, { "type": "function", "function": { "type": "function", "name": "deleteOrder", "description": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors.", "parameters": { "type": "object", "properties": { "orderId": { "type": "integer", "description": "ID of the order that needs to be deleted" } }, "required": [ "orderId" ] } } }, { "type": "function", "function": { "type": "function", "name": "createUser", "description": "This can only be done by the logged in user.", "parameters": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 10 }, "username": { "type": "string", "example": "theUser" }, "firstName": { "type": "string", "example": "John" }, "lastName": { "type": "string", "example": "James" }, "email": { "type": "string", "example": "john@email.com" }, "password": { "type": "string", "example": "12345" }, "phone": { "type": "string", "example": "12345" }, "userStatus": { "type": "integer", "description": "User Status", "format": "int32", "example": 1 } }, "required": [] } } }, { "type": "function", "function": { "type": "function", "name": "createUsersWithListInput", "description": "Creates list of users with given input array.", "parameters": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 10 }, "username": { "type": "string", "example": "theUser" }, "firstName": { "type": "string", "example": "John" }, "lastName": { "type": "string", "example": "James" }, "email": { "type": "string", "example": "john@email.com" }, "password": { "type": "string", "example": "12345" }, "phone": { "type": "string", "example": "12345" }, "userStatus": { "type": "integer", "description": "User Status", "format": "int32", "example": 1 } }, "xml": { "name": "user" } } } } }, { "type": "function", "function": { "type": "function", "name": "loginUser", "description": "Log into the system.", "parameters": { "type": "object", "properties": { "username": { "type": "string", "description": "The user name for login" }, "password": { "type": "string", "description": "The password for login in clear text" } }, "required": [] } } }, { "type": "function", "function": { "type": "function", "name": "logoutUser", "description": "Log user out of the system.", "parameters": { "type": "object", "properties": {}, "required": [] } } }, { "type": "function", "function": { "type": "function", "name": "getUserByName", "description": "Get user detail based on username.", "parameters": { "type": "object", "properties": { "username": { "type": "string", "description": "The name that needs to be fetched. Use user1 for testing" } }, "required": [ "username" ] } } }, { "type": "function", "function": { "type": "function", "name": "updateUser", "description": "This can only be done by the logged in user.", "parameters": { "type": "object", "properties": { "username": { "type": "string", "example": "theUser" }, "id": { "type": "integer", "format": "int64", "example": 10 }, "firstName": { "type": "string", "example": "John" }, "lastName": { "type": "string", "example": "James" }, "email": { "type": "string", "example": "john@email.com" }, "password": { "type": "string", "example": "12345" }, "phone": { "type": "string", "example": "12345" }, "userStatus": { "type": "integer", "description": "User Status", "format": "int32", "example": 1 } }, "required": [ "username" ] } } }, { "type": "function", "function": { "type": "function", "name": "deleteUser", "description": "This can only be done by the logged in user.", "parameters": { "type": "object", "properties": { "username": { "type": "string", "description": "The name that needs to be deleted" } }, "required": [ "username" ] } } } ] } ``` The response is: ``` { "error": { "code": "invalid_function_parameters", "message": "Invalid schema for function 'findPetsByTags': In context=('properties', 'tags'), array schema missing items.", "param": "tools[3].function.parameters", "type": "invalid_request_error" } } ``` The invalid function: ``` { "type": "function", "function": { "type": "function", "name": "findPetsByTags", "description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", "parameters": { "type": "object", "properties": { "tags": { "type": "array", "description": "Tags to filter by" } }, "required": [] } } } ``` ### Steps to Reproduce 1. Have an OpenAPI tool server with a query parameter defined as follows: ``` { "name": "tags", "in": "query", "description": "Tags to filter by", "required": false, "explode": true, "schema": { "type": "array", "items": { "type": "string" } } } ``` 2. Add the tool server to Open WebUI 3. Start a new chat with an OpenAI backend 4. Enable native function calling 5. Type a message in the chat 6. Observe the error response ### Logs & Screenshots Browser Console Logs: ``` ResponseMessage.svelte:566 <div class=​"flex justify-start overflow-x-auto buttons text-gray-600 dark:​text-gray-500 mt-0.5 svelte-1u5gq5j">​…​</div>​ MessageInput.svelte:378 destroy RichTextInput.svelte:185 content RichTextInput.svelte:187 [tiptap warn]: Duplicate extension names found: ['codeBlock']. This can lead to issues. resolve @ index.js:1183 tn @ index.js:1169 createExtensionManager @ index.js:4580 BE @ index.js:4412 (anonymous) @ RichTextInput.svelte:187 await in (anonymous) J @ utils.js:41 (anonymous) @ Component.js:47 _t @ scheduler.js:99 Promise.then ut @ scheduler.js:20 ht @ Component.js:81 (anonymous) @ Component.js:139 we @ Chat.svelte:761 await in we Q @ Navbar.svelte:145 Chat.svelte:475 Assertion failed! x @ assert.js:6 I @ paneforge.js:68 collapse @ pane.svelte:55 (anonymous) @ Chat.svelte:475 o @ index.js:56 j @ ChatControls.svelte:183 (anonymous) @ lifecycle.js:105 (anonymous) @ lifecycle.js:104 d @ Controls.svelte:26 Chat.svelte:475 Assertion failed! x @ assert.js:6 I @ paneforge.js:68 collapse @ pane.svelte:55 (anonymous) @ Chat.svelte:475 o @ index.js:56 j @ ChatControls.svelte:183 (anonymous) @ lifecycle.js:105 (anonymous) @ lifecycle.js:104 d @ Controls.svelte:26 Chat.svelte:1294 submitPrompt Hello Chat.svelte:193 saveSessionSelectedModels ['gpt-4o-mini'] ["gpt-4o-mini"] MessageInput.svelte:378 destroy ResponseMessage.svelte:566 <div class=​"flex justify-start overflow-x-auto buttons text-gray-600 dark:​text-gray-500 mt-0.5 svelte-1u5gq5j">​</div>​ RichTextInput.svelte:185 content RichTextInput.svelte:187 [tiptap warn]: Duplicate extension names found: ['codeBlock']. This can lead to issues. resolve @ index.js:1183 tn @ index.js:1169 createExtensionManager @ index.js:4580 BE @ index.js:4412 (anonymous) @ RichTextInput.svelte:187 await in (anonymous) J @ utils.js:41 (anonymous) @ Component.js:47 _t @ scheduler.js:99 Promise.then ut @ scheduler.js:20 ht @ Component.js:81 (anonymous) @ Component.js:139 Fe @ Chat.svelte:1346 Fo @ Chat.svelte:2169 await in Fo (anonymous) @ lifecycle.js:105 (anonymous) @ lifecycle.js:104 J @ Placeholder.svelte:218 (anonymous) @ lifecycle.js:105 (anonymous) @ lifecycle.js:104 Yt @ MessageInput.svelte:801 (anonymous) @ lifecycle.js:105 (anonymous) @ lifecycle.js:104 keydown @ RichTextInput.svelte:330 (anonymous) @ index.js:3108 someProp @ index.js:5502 ji @ index.js:3106 Pu.t.dom.addEventListener.t.input.eventHandlers.<computed> @ index.js:3075 ResponseMessage.svelte:566 <div class=​"flex justify-start overflow-x-auto buttons text-gray-600 dark:​text-gray-500 mt-0.5 svelte-1u5gq5j">​</div>​flex Chat.svelte:1468 modelId gpt-4o-mini index.ts:369 POST http://localhost:3000/api/chat/completions 400 (Bad Request) window.fetch @ fetcher.js:76 A @ index.ts:369 Tt @ Chat.svelte:1627 await in Tt (anonymous) @ Chat.svelte:1517 await in (anonymous) et @ Chat.svelte:1467 await in et Fe @ Chat.svelte:1394 Fo @ Chat.svelte:2169 await in Fo (anonymous) @ lifecycle.js:105 (anonymous) @ lifecycle.js:104 J @ Placeholder.svelte:218 (anonymous) @ lifecycle.js:105 (anonymous) @ lifecycle.js:104 Yt @ MessageInput.svelte:801 (anonymous) @ lifecycle.js:105 (anonymous) @ lifecycle.js:104 keydown @ RichTextInput.svelte:330 (anonymous) @ index.js:3108 someProp @ index.js:5502 ji @ index.js:3106 Pu.t.dom.addEventListener.t.input.eventHandlers.<computed> @ index.js:3075 ``` Open WebUI Logs: ``` 2025-05-21 08:22:43 2025-05-21 05:22:43.793 | INFO | open_webui.routers.openai:get_all_models:391 - get_all_models() - {} 2025-05-21 08:22:44 2025-05-21 05:22:44.231 | ERROR | open_webui.routers.openai:generate_chat_completion:866 - 400, message='Bad Request', url='http://mtimproxyweb:9096/chat/completions' - {} 2025-05-21 08:22:44 Traceback (most recent call last): 2025-05-21 08:22:44 2025-05-21 08:22:44 File "<frozen runpy>", line 198, in _run_module_as_main 2025-05-21 08:22:44 File "<frozen runpy>", line 88, in _run_code 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/site-packages/uvicorn/__main__.py", line 4, in <module> 2025-05-21 08:22:44 uvicorn.main() 2025-05-21 08:22:44 │ └ <Command main> 2025-05-21 08:22:44 └ <module 'uvicorn' from '/usr/local/lib/python3.11/site-packages/uvicorn/__init__.py'> 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1442, in __call__ 2025-05-21 08:22:44 return self.main(*args, **kwargs) 2025-05-21 08:22:44 │ │ │ └ {} 2025-05-21 08:22:44 │ │ └ () 2025-05-21 08:22:44 │ └ <function Command.main at 0xffffa9c4a700> 2025-05-21 08:22:44 └ <Command main> 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1363, in main 2025-05-21 08:22:44 rv = self.invoke(ctx) 2025-05-21 08:22:44 │ │ └ <click.core.Context object at 0xffffaac7c750> 2025-05-21 08:22:44 │ └ <function Command.invoke at 0xffffa9c4a3e0> 2025-05-21 08:22:44 └ <Command main> 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1226, in invoke 2025-05-21 08:22:44 return ctx.invoke(self.callback, **ctx.params) 2025-05-21 08:22:44 │ │ │ │ │ └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ... 2025-05-21 08:22:44 │ │ │ │ └ <click.core.Context object at 0xffffaac7c750> 2025-05-21 08:22:44 │ │ │ └ <function main at 0xffffa9778cc0> 2025-05-21 08:22:44 │ │ └ <Command main> 2025-05-21 08:22:44 │ └ <function Context.invoke at 0xffffa9c49620> 2025-05-21 08:22:44 └ <click.core.Context object at 0xffffaac7c750> 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/site-packages/click/core.py", line 794, in invoke 2025-05-21 08:22:44 return callback(*args, **kwargs) 2025-05-21 08:22:44 │ │ └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ... 2025-05-21 08:22:44 │ └ () 2025-05-21 08:22:44 └ <function main at 0xffffa9778cc0> 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 412, in main 2025-05-21 08:22:44 run( 2025-05-21 08:22:44 └ <function run at 0xffffa9d1f740> 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 579, in run 2025-05-21 08:22:44 server.run() 2025-05-21 08:22:44 │ └ <function Server.run at 0xffffa9b64860> 2025-05-21 08:22:44 └ <uvicorn.server.Server object at 0xffffa9d23a90> 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 66, in run 2025-05-21 08:22:44 return asyncio.run(self.serve(sockets=sockets)) 2025-05-21 08:22:44 │ │ │ │ └ None 2025-05-21 08:22:44 │ │ │ └ <function Server.serve at 0xffffa9b64900> 2025-05-21 08:22:44 │ │ └ <uvicorn.server.Server object at 0xffffa9d23a90> 2025-05-21 08:22:44 │ └ <function run at 0xffffaa1b5300> 2025-05-21 08:22:44 └ <module 'asyncio' from '/usr/local/lib/python3.11/asyncio/__init__.py'> 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run 2025-05-21 08:22:44 return runner.run(main) 2025-05-21 08:22:44 │ │ └ <coroutine object Server.serve at 0xffffa99488b0> 2025-05-21 08:22:44 │ └ <function Runner.run at 0xffffa9f64ea0> 2025-05-21 08:22:44 └ <asyncio.runners.Runner object at 0xffffa976f6d0> 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run 2025-05-21 08:22:44 return self._loop.run_until_complete(task) 2025-05-21 08:22:44 │ │ │ └ <Task pending name='Task-1' coro=<Server.serve() running at /usr/local/lib/python3.11/site-packages/uvicorn/server.py:70> wai... 2025-05-21 08:22:44 │ │ └ <cyfunction Loop.run_until_complete at 0xffffa9773370> 2025-05-21 08:22:44 │ └ <uvloop.Loop running=True closed=False debug=False> 2025-05-21 08:22:44 └ <asyncio.runners.Runner object at 0xffffa976f6d0> 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 141, in coro 2025-05-21 08:22:44 await self.app(scope, receive_or_disconnect, send_no_error) 2025-05-21 08:22:44 │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0xffff11744900> 2025-05-21 08:22:44 │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff11746c00> 2025-05-21 08:22:44 │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... 2025-05-21 08:22:44 │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0xffff1ab76390> 2025-05-21 08:22:44 └ <open_webui.main.RedirectMiddleware object at 0xffff1abe8210> 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__ 2025-05-21 08:22:44 await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) 2025-05-21 08:22:44 │ │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0xffff11744900> 2025-05-21 08:22:44 │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff11746c00> 2025-05-21 08:22:44 │ │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... 2025-05-21 08:22:44 │ │ │ └ <starlette.requests.Request object at 0xffff1354c390> 2025-05-21 08:22:44 │ │ └ <fastapi.routing.APIRouter object at 0xffff519e4250> 2025-05-21 08:22:44 │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0xffff1ab76390> 2025-05-21 08:22:44 └ <function wrap_app_handling_exceptions at 0xffffa69a8b80> 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app 2025-05-21 08:22:44 await app(scope, receive, sender) 2025-05-21 08:22:44 │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0xffff117465c0> 2025-05-21 08:22:44 │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff11746c00> 2025-05-21 08:22:44 │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... 2025-05-21 08:22:44 └ <fastapi.routing.APIRouter object at 0xffff519e4250> 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__ 2025-05-21 08:22:44 await self.middleware_stack(scope, receive, send) 2025-05-21 08:22:44 │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0xffff117465c0> 2025-05-21 08:22:44 │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff11746c00> 2025-05-21 08:22:44 │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... 2025-05-21 08:22:44 │ └ <bound method Router.app of <fastapi.routing.APIRouter object at 0xffff519e4250>> 2025-05-21 08:22:44 └ <fastapi.routing.APIRouter object at 0xffff519e4250> 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 735, in app 2025-05-21 08:22:44 await route.handle(scope, receive, send) 2025-05-21 08:22:44 │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0xffff117465c0> 2025-05-21 08:22:44 │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff11746c00> 2025-05-21 08:22:44 │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... 2025-05-21 08:22:44 │ └ <function Route.handle at 0xffffa69aa200> 2025-05-21 08:22:44 └ APIRoute(path='/api/chat/completions', name='chat_completion', methods=['POST']) 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle 2025-05-21 08:22:44 await self.app(scope, receive, send) 2025-05-21 08:22:44 │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0xffff117465c0> 2025-05-21 08:22:44 │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff11746c00> 2025-05-21 08:22:44 │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... 2025-05-21 08:22:44 │ └ <function request_response.<locals>.app at 0xffff1a7e1bc0> 2025-05-21 08:22:44 └ APIRoute(path='/api/chat/completions', name='chat_completion', methods=['POST']) 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 76, in app 2025-05-21 08:22:44 await wrap_app_handling_exceptions(app, request)(scope, receive, send) 2025-05-21 08:22:44 │ │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0xffff117465c0> 2025-05-21 08:22:44 │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff11746c00> 2025-05-21 08:22:44 │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... 2025-05-21 08:22:44 │ │ └ <starlette.requests.Request object at 0xffff1354e5d0> 2025-05-21 08:22:44 │ └ <function request_response.<locals>.app.<locals>.app at 0xffff11745a80> 2025-05-21 08:22:44 └ <function wrap_app_handling_exceptions at 0xffffa69a8b80> 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app 2025-05-21 08:22:44 await app(scope, receive, sender) 2025-05-21 08:22:44 │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0xffff1357b9c0> 2025-05-21 08:22:44 │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff11746c00> 2025-05-21 08:22:44 │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... 2025-05-21 08:22:44 └ <function request_response.<locals>.app.<locals>.app at 0xffff11745a80> 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app 2025-05-21 08:22:44 response = await f(request) 2025-05-21 08:22:44 │ └ <starlette.requests.Request object at 0xffff1354e5d0> 2025-05-21 08:22:44 └ <function get_request_handler.<locals>.app at 0xffff1a7e1940> 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 301, in app 2025-05-21 08:22:44 raw_response = await run_endpoint_function( 2025-05-21 08:22:44 └ <function run_endpoint_function at 0xffffa6958040> 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 212, in run_endpoint_function 2025-05-21 08:22:44 return await dependant.call(**values) 2025-05-21 08:22:44 │ │ └ {'user': UserModel(id='14bcc998-5a6c-4a32-960a-1343e5cb1bc3', name='User', email='admin@localhost', role='admin', profile_ima... 2025-05-21 08:22:44 │ └ <function chat_completion at 0xffff1a7e2340> 2025-05-21 08:22:44 └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant... 2025-05-21 08:22:44 2025-05-21 08:22:44 File "/app/backend/open_webui/main.py", line 1234, in chat_completion 2025-05-21 08:22:44 response = await chat_completion_handler(request, form_data, user) 2025-05-21 08:22:44 │ │ │ └ UserModel(id='14bcc998-5a6c-4a32-960a-1343e5cb1bc3', name='User', email='admin@localhost', role='admin', profile_image_url='/... 2025-05-21 08:22:44 │ │ └ {'stream': True, 'model': 'gpt-4o-mini', 'messages': [{'role': 'user', 'content': 'Hello'}], 'metadata': {'user_id': '14bcc99... 2025-05-21 08:22:44 │ └ <starlette.requests.Request object at 0xffff1354e5d0> 2025-05-21 08:22:44 └ <function generate_chat_completion at 0xffff53025760> 2025-05-21 08:22:44 2025-05-21 08:22:44 File "/app/backend/open_webui/utils/chat.py", line 275, in generate_chat_completion 2025-05-21 08:22:44 return await generate_openai_chat_completion( 2025-05-21 08:22:44 └ <function generate_chat_completion at 0xffff53024b80> 2025-05-21 08:22:44 2025-05-21 08:22:44 > File "/app/backend/open_webui/routers/openai.py", line 863, in generate_chat_completion 2025-05-21 08:22:44 r.raise_for_status() 2025-05-21 08:22:44 │ └ <function ClientResponse.raise_for_status at 0xffffa7223740> 2025-05-21 08:22:44 └ <ClientResponse(http://mtimproxyweb:9096/chat/completions) [400 Bad Request]> 2025-05-21 08:22:44 <CIMultiDictProxy('Date': 'Wed, 21 May 2025 05:... 2025-05-21 08:22:44 2025-05-21 08:22:44 File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1161, in raise_for_status 2025-05-21 08:22:44 raise ClientResponseError( 2025-05-21 08:22:44 └ <class 'aiohttp.client_exceptions.ClientResponseError'> 2025-05-21 08:22:44 2025-05-21 08:22:44 aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url='http://mtimproxyweb:9096/chat/completions' 2025-05-21 08:22:44 2025-05-21 05:22:44.240 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 172.18.0.1:59238 - "POST /api/chat/completions HTTP/1.1" 400 - {} 2025-05-21 08:22:44 2025-05-21 05:22:44.270 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 172.18.0.1:59238 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 - {} 2025-05-21 08:23:06 2025-05-21 05:23:06.294 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 172.18.0.1:62090 - "GET /_app/version.json HTTP/1.1" 200 - {} 2025-05-21 08:23:06 2025-05-21 05:23:06.298 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 172.18.0.1:62080 - "GET /_app/version.json HTTP/1.1" 200 - {} 2025-05-21 08:23:35 2025-05-21 05:23:35.249 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 172.18.0.1:64850 - "GET /_app/version.json HTTP/1.1" 200 - {} 2025-05-21 08:24:06 2025-05-21 05:24:06.251 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 172.18.0.1:65320 - "GET /_app/version.json HTTP/1.1" 200 - {} 2025-05-21 08:24:36 2025-05-21 05:24:36.260 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 172.18.0.1:63304 - "GET /_app/version.json HTTP/1.1" 200 - {} ``` <img width="344" alt="Image" src="https://github.com/user-attachments/assets/23fe0a36-de25-4e15-97ee-e2ed5c5b5495" /> ### Additional Information I am using the petstore openapi definition from: https://editor.swagger.io/ which then I translated to json with https://onlineyamltools.com/convert-yaml-to-json
GiteaMirror added the buggood first issuehelp wanted labels 2026-04-19 22:53:47 -05:00
Author
Owner

@0rangeMan commented on GitHub (May 24, 2025):

I would like to share my error on this:

If I turn Function Calling as Native, I got:
Error: 400 Client Error: Bad Request

If I turn off, I got response without any issue.

This only happens when I deploy the service in Kubernetes.
If I run the service locally, I have no problem for Native function calling.

Not sure if this helps.

<!-- gh-comment-id:2906783372 --> @0rangeMan commented on GitHub (May 24, 2025): I would like to share my error on this: If I turn Function Calling as Native, I got: Error: 400 Client Error: Bad Request If I turn off, I got response without any issue. This only happens when I deploy the service in Kubernetes. If I run the service locally, I have no problem for Native function calling. Not sure if this helps.
Author
Owner

@0rangeMan commented on GitHub (May 24, 2025):

Oh, I might have found the problem, see the following error:

Image
<!-- gh-comment-id:2906787633 --> @0rangeMan commented on GitHub (May 24, 2025): Oh, I might have found the problem, see the following error: <img width="642" alt="Image" src="https://github.com/user-attachments/assets/f966fde1-9861-406d-aacb-71f26ebbe2a1" />
Author
Owner

@pim2ict commented on GitHub (Aug 1, 2025):

I’m experiencing a similar issue when making native tool calls to an OpenAPI (FastAPI) server.

Image

Everything works as expected when I don’t use native function calling.

Additionally, as @0rangeMan mentioned, native tool calling works perfectly when running the server locally as a User Tool Server. However, when deploying it as a Global tool in a container, I start seeing this error.

I’ve tried removing all instances of 'none' (primarily by removing Optional[] types) from my FastAPI app in various ways, but unfortunately, that hasn’t resolved the issue.

<!-- gh-comment-id:3143990160 --> @pim2ict commented on GitHub (Aug 1, 2025): I’m experiencing a similar issue when making native tool calls to an OpenAPI (FastAPI) server. <img width="1077" height="209" alt="Image" src="https://github.com/user-attachments/assets/1c64f79a-7b08-412e-a9f9-535bee3108df" /> Everything works as expected when I don’t use native function calling. Additionally, as @0rangeMan mentioned, native tool calling works perfectly when running the server locally as a _User Tool Server_. However, when deploying it as a Global tool in a container, I start seeing this error. I’ve tried removing all instances of 'none' (primarily by removing Optional[] types) from my FastAPI app in various ways, but unfortunately, that hasn’t resolved the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#17147