mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-05 18:38:17 -05:00
[GH-ISSUE #14115] issue: Native Tool Calling with OpenAPI Spec with Array Query Parameter Generates Invalid AI Functions for OpenAI (OpenAI returns 400) #32676
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @alexaytov on GitHub (May 21, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/14115
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.6.10
Ollama Version (if applicable)
No response
Operating System
macos
Browser (if applicable)
No response
Confirmation
README.md.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:
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:
The response is:
The invalid function:
Steps to Reproduce
Logs & Screenshots
Browser Console Logs:
Open WebUI Logs:
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
@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.
@0rangeMan commented on GitHub (May 24, 2025):
Oh, I might have found the problem, see the following error:
@pim2ict commented on GitHub (Aug 1, 2025):
I’m experiencing a similar issue when making native tool calls to an OpenAPI (FastAPI) server.
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.