[PR #24056] [CLOSED] feat: OpenAI Responses API native web_search tool support #66350

Closed
opened 2026-05-06 12:40:13 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/24056
Author: @mcowger
Created: 4/23/2026
Status: Closed

Base: devHead: feat/openai-native-web-search


📝 Commits (1)

  • 863694b feat: add OpenAI Responses API native web_search tool support

📊 Changes

5 files changed (+86 additions, -6 deletions)

View changed files

📝 backend/open_webui/main.py (+4 -0)
📝 backend/open_webui/routers/openai.py (+37 -4)
📝 backend/open_webui/utils/payload.py (+1 -0)
📝 src/lib/components/admin/Settings/WebSearch.svelte (+14 -2)
📝 src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte (+30 -0)

📄 Description

Description

This PR adds support for OpenAI's native server-side web_search tool when using the Responses API (e.g. GPT-5.4). Users can now choose between OpenAI's native web search and OpenWebUI's built-in web search implementations. This addresses the web search support request raised in Discussion #11874.

How it works

The existing Web Search capability (set in Model Editor → Capabilities) acts as the master switch. When enabled, the new "OpenAI Web Search (Responses API)" toggle in Advanced Params selects the implementation:

  • Enabled → Native {"type": "web_search"} tool is injected into the Responses API payload; built-in search_web/fetch_url tools are suppressed
  • Disabled (default/null) → Existing behavior: built-in search_web/fetch_url tools are active

Backend changes

  • Added openai_responses_web_search to metadata params in generate_chat_completion
  • Updated convert_to_responses_payload() to accept and use metadata for feature/param detection
  • Injects native {"type": "web_search"} tool into Responses API payload when web_search capability is enabled AND openai_responses_web_search is true
  • Suppresses built-in search_web/fetch_url tools when native mode is active
  • Added openai_responses_web_search to remove_open_webui_params() so it is stripped before upstream API calls

Frontend changes

  • Added model_native option to Admin → Settings → Web Search engine dropdown
  • Added "OpenAI Web Search (Responses API)" toggle to Chat → Advanced Params (Enabled/Disabled button, matches Function Calling UI pattern)

Testing performed

  • Verified with local backend: openai_responses_web_search=true correctly injects native web_search tool into the Responses API payload
  • Verified openai_responses_web_search=false/null falls back to built-in search_web/fetch_url tools
  • Verified Web Search capability OFF suppresses both implementations
  • Verified openai_responses_web_search is stripped from upstream API request
  • No new dependencies introduced
  • Single atomic commit, rebased onto dev

Changelog

Added

  • OpenAI Responses API native web_search support. Added openai_responses_web_search parameter (Advanced Params toggle) that routes web search requests through OpenAI's native web_search tool in the Responses API instead of the built-in search_web/fetch_url tools. The existing Web Search capability acts as the master switch; the toggle selects the implementation. (#11874)

  • Target branch: This PR targets the dev branch.
  • Description: Provided above.
  • Changelog: Entry added above following Keep a Changelog format.
  • Documentation: Will be submitted as a follow-up PR to the Open WebUI Docs Repository documenting the new model_native engine option and the Advanced Params toggle.
  • Dependencies: No new or upgraded dependencies.
  • Testing: Manual E2E tests performed. Repro steps and results documented above.
  • Agentic AI Code: This change was AI-assisted. It was manually reviewed and tested on a live local deployment before submitting.
  • Code review: Self-review performed. Change is scoped to one feature and adheres to project coding standards.
  • Design & Architecture: Localized to OpenAI Responses API provider-specific handling. No generic message reconstruction changed.
  • Git Hygiene: Single atomic commit, rebased onto dev.
  • Title Prefix: Uses feat: prefix.


Screenshots:

Chat UI:
Screenshot 2026-04-23 at 4 10 38 PM

Admin Web Search:

Screenshot 2026-04-23 at 4 11 12 PM

Model Advanced Configs:

Screenshot 2026-04-23 at 4 10 56 PM

🔄 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/24056 **Author:** [@mcowger](https://github.com/mcowger) **Created:** 4/23/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `feat/openai-native-web-search` --- ### 📝 Commits (1) - [`863694b`](https://github.com/open-webui/open-webui/commit/863694bfba09aa9091eece98b1e09b246d63e227) feat: add OpenAI Responses API native web_search tool support ### 📊 Changes **5 files changed** (+86 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/main.py` (+4 -0) 📝 `backend/open_webui/routers/openai.py` (+37 -4) 📝 `backend/open_webui/utils/payload.py` (+1 -0) 📝 `src/lib/components/admin/Settings/WebSearch.svelte` (+14 -2) 📝 `src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte` (+30 -0) </details> ### 📄 Description ## Description This PR adds support for OpenAI's native server-side `web_search` tool when using the Responses API (e.g. GPT-5.4). Users can now choose between OpenAI's native web search and OpenWebUI's built-in web search implementations. This addresses the web search support request raised in Discussion #11874. ## How it works The existing **Web Search capability** (set in Model Editor → Capabilities) acts as the master switch. When enabled, the new **"OpenAI Web Search (Responses API)"** toggle in Advanced Params selects the implementation: - **Enabled** → Native `{"type": "web_search"}` tool is injected into the Responses API payload; built-in `search_web`/`fetch_url` tools are suppressed - **Disabled** (default/null) → Existing behavior: built-in `search_web`/`fetch_url` tools are active ## Backend changes - Added `openai_responses_web_search` to metadata params in `generate_chat_completion` - Updated `convert_to_responses_payload()` to accept and use metadata for feature/param detection - Injects native `{"type": "web_search"}` tool into Responses API payload when web_search capability is enabled AND `openai_responses_web_search` is true - Suppresses built-in `search_web`/`fetch_url` tools when native mode is active - Added `openai_responses_web_search` to `remove_open_webui_params()` so it is stripped before upstream API calls ## Frontend changes - Added `model_native` option to Admin → Settings → Web Search engine dropdown - Added "OpenAI Web Search (Responses API)" toggle to Chat → Advanced Params (Enabled/Disabled button, matches Function Calling UI pattern) ## Testing performed - [x] Verified with local backend: `openai_responses_web_search=true` correctly injects native `web_search` tool into the Responses API payload - [x] Verified `openai_responses_web_search=false/null` falls back to built-in `search_web`/`fetch_url` tools - [x] Verified Web Search capability OFF suppresses both implementations - [x] Verified `openai_responses_web_search` is stripped from upstream API request - [x] No new dependencies introduced - [x] Single atomic commit, rebased onto `dev` ## Related - Discussion #11874 — [feat: Support for OpenAI's new Responses API](https://github.com/open-webui/open-webui/discussions/11874) ## Changelog ### Added - **OpenAI Responses API native web_search support.** Added `openai_responses_web_search` parameter (Advanced Params toggle) that routes web search requests through OpenAI's native `web_search` tool in the Responses API instead of the built-in `search_web`/`fetch_url` tools. The existing Web Search capability acts as the master switch; the toggle selects the implementation. ([#11874](https://github.com/open-webui/open-webui/discussions/11874)) --- - [x] **Target branch:** This PR targets the `dev` branch. - [x] **Description:** Provided above. - [x] **Changelog:** Entry added above following Keep a Changelog format. - [x] **Documentation:** Will be submitted as a follow-up PR to the [Open WebUI Docs Repository](https://github.com/open-webui/docs) documenting the new `model_native` engine option and the Advanced Params toggle. - [x] **Dependencies:** No new or upgraded dependencies. - [x] **Testing:** Manual E2E tests performed. Repro steps and results documented above. - [x] **Agentic AI Code:** This change was AI-assisted. It was manually reviewed and tested on a live local deployment before submitting. - [x] **Code review:** Self-review performed. Change is scoped to one feature and adheres to project coding standards. - [x] **Design & Architecture:** Localized to OpenAI Responses API provider-specific handling. No generic message reconstruction changed. - [x] **Git Hygiene:** Single atomic commit, rebased onto `dev`. - [x] **Title Prefix:** Uses `feat:` prefix. --- - [x] By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. --- Screenshots: Chat UI: <img width="882" height="348" alt="Screenshot 2026-04-23 at 4 10 38 PM" src="https://github.com/user-attachments/assets/eab566a1-92c6-499b-8ebe-8993b6586737" /> Admin Web Search: <img width="830" height="367" alt="Screenshot 2026-04-23 at 4 11 12 PM" src="https://github.com/user-attachments/assets/1606a3b9-08c7-404b-9bc7-4b602f93600a" /> Model Advanced Configs: <img width="838" height="291" alt="Screenshot 2026-04-23 at 4 10 56 PM" src="https://github.com/user-attachments/assets/336b5fc0-6e6f-4927-bc44-4e34093eb0e0" /> --- <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-05-06 12:40:13 -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#66350