[PR #16343] [CLOSED] fix: include items property in OpenAPI array parameters for OpenAI function calling #24106

Closed
opened 2026-04-20 05:14:31 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/16343
Author: @Rain6435
Created: 8/7/2025
Status: Closed

Base: mainHead: fix-openapi-array-parameters-clean


📝 Commits (10+)

  • 58cbf5a Update for Polish translation
  • 5c59c50 more prgoress on s3 vector
  • fa3c3c2 i18n: Update & Improve & Fix zh-CN
  • 8f655ec i18n: Fix zh-CN
  • e95a93d Merge pull request #15894 from qingchunnh/Update_zh-CN-25721
  • 1e2ae1d Merge pull request #15888 from macnow/patch-2
  • a26607c refac: styling
  • d8b80ca refac/fix: remove insecure arg for otel http exporter
  • 14c6f8b added a check for admins to avoid 404 errors on feedbacks get and post
  • 1ff2ad0 ci fix

📊 Changes

219 files changed (+9226 additions, -3328 deletions)

View changed files

📝 .gitignore (+4 -1)
📝 README.md (+2 -0)
📝 backend/dev.sh (+1 -1)
📝 backend/open_webui/config.py (+96 -10)
📝 backend/open_webui/env.py (+51 -1)
📝 backend/open_webui/main.py (+42 -7)
📝 backend/open_webui/models/chats.py (+45 -3)
📝 backend/open_webui/models/memories.py (+13 -4)
📝 backend/open_webui/models/models.py (+44 -0)
📝 backend/open_webui/models/users.py (+4 -0)
📝 backend/open_webui/retrieval/loaders/datalab_marker.py (+95 -68)
📝 backend/open_webui/retrieval/loaders/main.py (+8 -2)
📝 backend/open_webui/retrieval/utils.py (+5 -1)
📝 backend/open_webui/retrieval/vector/dbs/chroma.py (+4 -2)
📝 backend/open_webui/retrieval/vector/dbs/elasticsearch.py (+4 -2)
📝 backend/open_webui/retrieval/vector/dbs/milvus.py (+4 -2)
📝 backend/open_webui/retrieval/vector/dbs/opensearch.py (+3 -2)
backend/open_webui/retrieval/vector/dbs/oracle23ai.py (+888 -0)
📝 backend/open_webui/retrieval/vector/dbs/pgvector.py (+5 -3)
backend/open_webui/retrieval/vector/dbs/s3vector.py (+745 -0)

...and 80 more files

📄 Description

Summary

Fixes OpenAPI array parameter conversion for OpenAI function calling by ensuring the 'items' property is
included in generated function schemas.

Problem

  • OpenAPI specs with array query parameters were generating invalid OpenAI function schemas
  • Missing 'items' property caused OpenAI to return 400 Bad Request: 'array schema missing items'
  • Issue affected tool servers using array parameters like tags filtering

Solution

  • Modified convert_openapi_to_tool_payload() in backend/open_webui/utils/tools.py
  • Added logic to copy 'items' property for array-type parameters
  • Ensures generated schemas are valid for OpenAI function calling

Test Plan

  • Tested with exact example from issue #14115
  • Verified generated schema now includes required 'items' property
  • Syntax validation passed

Fixes #14115


���� This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/16343 **Author:** [@Rain6435](https://github.com/Rain6435) **Created:** 8/7/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-openapi-array-parameters-clean` --- ### 📝 Commits (10+) - [`58cbf5a`](https://github.com/open-webui/open-webui/commit/58cbf5aba2bd24b67345fd09f69078b70bc74997) Update for Polish translation - [`5c59c50`](https://github.com/open-webui/open-webui/commit/5c59c50e2d530779b27c4f892531ec00caab191d) more prgoress on s3 vector - [`fa3c3c2`](https://github.com/open-webui/open-webui/commit/fa3c3c24436a29b0288685682edbcbeaed981d81) i18n: Update & Improve & Fix zh-CN - [`8f655ec`](https://github.com/open-webui/open-webui/commit/8f655ec0a6a6beb26a32b5bfb81beb231940e29b) i18n: Fix zh-CN - [`e95a93d`](https://github.com/open-webui/open-webui/commit/e95a93d80bff2d9c334b4bddfb7f63ca9b49a425) Merge pull request #15894 from qingchunnh/Update_zh-CN-25721 - [`1e2ae1d`](https://github.com/open-webui/open-webui/commit/1e2ae1da1d3dd05b08446658ec5eb9ce3132e162) Merge pull request #15888 from macnow/patch-2 - [`a26607c`](https://github.com/open-webui/open-webui/commit/a26607c7200e3ba2fd67cf18df118dfecccebb3b) refac: styling - [`d8b80ca`](https://github.com/open-webui/open-webui/commit/d8b80caff3c8479ed5e594516c1468d5fce1ab15) refac/fix: remove insecure arg for otel http exporter - [`14c6f8b`](https://github.com/open-webui/open-webui/commit/14c6f8bf806261b87b1b7ed8a8e47ece329e6d01) added a check for admins to avoid 404 errors on feedbacks get and post - [`1ff2ad0`](https://github.com/open-webui/open-webui/commit/1ff2ad0c08c4587999a143a15f23fa111d9c0e4e) ci fix ### 📊 Changes **219 files changed** (+9226 additions, -3328 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+4 -1) 📝 `README.md` (+2 -0) 📝 `backend/dev.sh` (+1 -1) 📝 `backend/open_webui/config.py` (+96 -10) 📝 `backend/open_webui/env.py` (+51 -1) 📝 `backend/open_webui/main.py` (+42 -7) 📝 `backend/open_webui/models/chats.py` (+45 -3) 📝 `backend/open_webui/models/memories.py` (+13 -4) 📝 `backend/open_webui/models/models.py` (+44 -0) 📝 `backend/open_webui/models/users.py` (+4 -0) 📝 `backend/open_webui/retrieval/loaders/datalab_marker.py` (+95 -68) 📝 `backend/open_webui/retrieval/loaders/main.py` (+8 -2) 📝 `backend/open_webui/retrieval/utils.py` (+5 -1) 📝 `backend/open_webui/retrieval/vector/dbs/chroma.py` (+4 -2) 📝 `backend/open_webui/retrieval/vector/dbs/elasticsearch.py` (+4 -2) 📝 `backend/open_webui/retrieval/vector/dbs/milvus.py` (+4 -2) 📝 `backend/open_webui/retrieval/vector/dbs/opensearch.py` (+3 -2) ➕ `backend/open_webui/retrieval/vector/dbs/oracle23ai.py` (+888 -0) 📝 `backend/open_webui/retrieval/vector/dbs/pgvector.py` (+5 -3) ➕ `backend/open_webui/retrieval/vector/dbs/s3vector.py` (+745 -0) _...and 80 more files_ </details> ### 📄 Description ## Summary Fixes OpenAPI array parameter conversion for OpenAI function calling by ensuring the 'items' property is included in generated function schemas. ## Problem - OpenAPI specs with array query parameters were generating invalid OpenAI function schemas - Missing 'items' property caused OpenAI to return 400 Bad Request: 'array schema missing items' - Issue affected tool servers using array parameters like tags filtering ## Solution - Modified `convert_openapi_to_tool_payload()` in `backend/open_webui/utils/tools.py` - Added logic to copy 'items' property for array-type parameters - Ensures generated schemas are valid for OpenAI function calling ## Test Plan - [x] Tested with exact example from issue #14115 - [x] Verified generated schema now includes required 'items' property - [x] Syntax validation passed Fixes #14115 --- <sub>���� This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 05:14:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#24106