mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #12822] [MERGED] feat: Support for Self-Hosted/External Web Search/Loader Engines #23028
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/12822
Author: @tth37
Created: 4/13/2025
Status: ✅ Merged
Merged: 4/19/2025
Merged by: @tjbck
Base:
dev← Head:feat_external_search_loader📝 Commits (5)
839ba22feat: Backend for Self-Hosted/External Web Search/Loader Engines22f0365format008fec8fix: Update external search/loader method to POST85f8e91feat: Allow admin editing external search/loader settingsdcb3f18refac: styling📊 Changes
7 files changed (+237 additions, -2 deletions)
View changed files
📝
backend/open_webui/config.py(+23 -0)📝
backend/open_webui/main.py(+8 -0)➕
backend/open_webui/retrieval/loaders/external.py(+53 -0)➕
backend/open_webui/retrieval/web/external.py(+47 -0)📝
backend/open_webui/retrieval/web/utils.py(+8 -0)📝
backend/open_webui/routers/retrieval.py(+33 -0)📝
src/lib/components/admin/Settings/WebSearch.svelte(+65 -2)📄 Description
Related discussion: #12783
Issues reported: #8843 #9646 #12711
This PR aims at introducing the capability to configure and utilize self-hosted or external web search and web loader engines within Open WebUI.
Roadmap
WebSearch.sveltecorrespondingly to allow admin editing of these settings via UIProposed Solution
This PR adds new configuration options and logic to enable routing web search and web loading requests to user-defined external HTTP endpoints. When the
externalengine is selected, Open WebUI will send POST request to the specified service url for operations.POST <EXTERNAL_WEB_SEARCH_URL>Bearer <EXTERNAL_WEB_SEARCH_API_KEY>{"query": str, "count": int}list[{"link": str, "title": str, "snippet": str}]POST <EXTERNAL_WEB_LOADER_URL>Bearer <EXTERNAL_WEB_LOADER_API_KEY>{"urls": list[str]}list[{"page_content": str, "metadata": object}]Changes
config.py: Added the new configuration variablesmain.py: Incorporateed new configs intoapp.state.configobjectretrieval/web/external.py: Implementedsearch_externalfunction to call the external search endpointrouters/retrieval.py: Modifiedsearch_webhandler to delegate tosearch_externalwhen the engine isexternalretrieval/loaders/external.py: AddedExternalLoaderclass to handle calls to the external loader endpointretrieval/web/utils.py: Updatedget_web_loaderto returnExternalLoaderwhen the loader engine isexternal🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.