mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-10 07:43:10 -05:00
[PR #4974] [MERGED] feat: Add support for SearchApi as alternative to WebSearch #8399
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/4974
Author: @raju249
Created: 8/28/2024
Status: ✅ Merged
Merged: 8/30/2024
Merged by: @tjbck
Base:
dev← Head:add-search-api📝 Commits (1)
7e1923fAdd searchapi as an alternative web search📊 Changes
7 files changed (+504 additions, -2 deletions)
View changed files
📝
README.md(+1 -1)📝
backend/apps/rag/main.py(+27 -0)📝
backend/apps/rag/search/main.py(+2 -1)➕
backend/apps/rag/search/searchapi.py(+50 -0)➕
backend/apps/rag/search/testdata/searchapi.json(+383 -0)📝
backend/config.py(+12 -0)📝
src/lib/components/admin/Settings/WebSearch.svelte(+29 -0)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Added SearchApi Google Search Api as an option for web search alternatives. Based on our customer requests we are raising the PR to add SearchAPI as an option. We are ready to invest time in adding open-source integrations. This can be a great addition to the Open WebUI web search. I have opened the docs PR too. Please feel free to mention @raju249 and @SebastjanPrachovskij for any future reviews for PR related to SearchApi. We would be happy to help.
The end user can change the search engine used on the SearchApi side via the
SEARCHAPI_ENGINEparameter. Organic results share the same structure across all existing and upcoming SERP engines, so we will always have atitle,snippet, andlink. Google, Bing, Baidu, Google News, Bing News, Google Videos, Google Scholar, and Google Patents are already supported. Yandex and Yahoo are coming soon as well.Added
SEARCHAPI_API_KEYAPI key to the config.SEARCHAPI_ENGINEkey to the config to change engine based on user preferences.searchapias an option forwebSearchEngines.backend/apps/rag/search/searchapi.pywhich is the main function for calling SearchApi Google Search Api by default ifSEARCHAPI_ENGINEis not present from the config.SEARCHAPI_API_KEYin the config.Changed
Screenshots or Videos
Selecting the search and setting the API key and Engine
Performing the search
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.