Allow blocking and allowing domains in web search.
Added
Added two new env vars RAG_WEB_SEARCH_ALLOWED_DOMAIN_LIST and RAG_WEB_SEARCH_BLOCKED_DOMAIN_LIST
Changed
Created both environment variables in config.py
Changed UI so that they are persisted
Don't try to generate search query if ENABLE_SEARCH_QUERY_GENERATION = False
Changed retrieval/web/main.py to enforce these variables
Created a new class SearchParameters to facilitate integration of search engines and modified search engines implementations accordingly
Detect if no search results are returned and in such case don't try to store them
When informing the UI about searching include the search engine being searched and the query being made
Fix typo when logging in process_web_search
Deprecated
RAG_WEB_SEARCH_DOMAIN_FILTER_LIST is no longer used
Removed
RAG_WEB_SEARCH_DOMAIN_FILTER_LIST is no longer used
Fixed
When no search results are found it doesn't raise an error
Breaking Changes
BREAKING CHANGE: [List any breaking changes affecting compatibility or functionality]
--- stored value for RAG_WEB_SEARCH_DOMAIN_FILTER_LIST may require migration
Additional Information
Refer to issue #9912 where some additional features might come in
🔄 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/10130
**Author:** [@nachogmd](https://github.com/nachogmd)
**Created:** 2/16/2025
**Status:** ❌ Closed
**Base:** `main` ← **Head:** `web_search_domains`
---
### 📝 Commits (10+)
- [`70e8337`](https://github.com/open-webui/open-webui/commit/70e83375360d5d819db418bfc0a9e722adc7a572) Update translation.json
- [`ceef600`](https://github.com/open-webui/open-webui/commit/ceef600223a194568693afad389ce63cfde922a3) support async load for websearch
- [`d3f7193`](https://github.com/open-webui/open-webui/commit/d3f71930f0a129ed7bade3c9cd5c8ed39a67826f) web loader support proxy
- [`85c2288`](https://github.com/open-webui/open-webui/commit/85c22889da1b4816581c0e027ff2c78c4985d75c) Update translation.json
- [`f376a61`](https://github.com/open-webui/open-webui/commit/f376a615785c88905e4e0c88238cccb4fd79c1da) Merge branch 'open-webui:main' into patch-4
- [`42119e2`](https://github.com/open-webui/open-webui/commit/42119e2c5202131ff2e6bf794690b51c42ae3860) Update translation.json
- [`9072959`](https://github.com/open-webui/open-webui/commit/90729598589e99ac5ee7d4a269b1d9f66e4b1dcf) fix: remove whitespace to improve typesetting for inline Markdown
- [`8d898f2`](https://github.com/open-webui/open-webui/commit/8d898f2d12fc71f6215268f60570386d067c41b6) Added romanian translations
- [`5ca39eb`](https://github.com/open-webui/open-webui/commit/5ca39eb9fd1f596b551e53ca6df0a1610063831c) Update tavily.py
- [`a8e3104`](https://github.com/open-webui/open-webui/commit/a8e310429cb0a08c230c9c160312a3d3775627b7) FIx: Domain Filter list in tavily.py
### 📊 Changes
**188 files changed** (+2916 additions, -2306 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/config.py` (+53 -0)
📝 `backend/open_webui/env.py` (+1 -0)
📝 `backend/open_webui/main.py` (+56 -17)
📝 `backend/open_webui/retrieval/web/bing.py` (+8 -12)
📝 `backend/open_webui/retrieval/web/bocha.py` (+9 -8)
📝 `backend/open_webui/retrieval/web/brave.py` (+8 -8)
📝 `backend/open_webui/retrieval/web/duckduckgo.py` (+15 -20)
📝 `backend/open_webui/retrieval/web/exa.py` (+9 -11)
📝 `backend/open_webui/retrieval/web/google_pse.py` (+10 -14)
📝 `backend/open_webui/retrieval/web/jina_search.py` (+9 -6)
📝 `backend/open_webui/retrieval/web/kagi.py` (+9 -10)
📝 `backend/open_webui/retrieval/web/main.py` (+32 -5)
📝 `backend/open_webui/retrieval/web/mojeek.py` (+8 -8)
📝 `backend/open_webui/retrieval/web/searchapi.py` (+9 -12)
📝 `backend/open_webui/retrieval/web/searxng.py` (+10 -15)
📝 `backend/open_webui/retrieval/web/serpapi.py` (+8 -12)
📝 `backend/open_webui/retrieval/web/serper.py` (+7 -8)
📝 `backend/open_webui/retrieval/web/serply.py` (+11 -17)
📝 `backend/open_webui/retrieval/web/serpstack.py` (+9 -14)
📝 `backend/open_webui/retrieval/web/tavily.py` (+9 -5)
_...and 80 more files_
</details>
### 📄 Description
# Changelog Entry
### Description
- Allow blocking and allowing domains in web search.
### Added
- Added two new env vars RAG_WEB_SEARCH_ALLOWED_DOMAIN_LIST and RAG_WEB_SEARCH_BLOCKED_DOMAIN_LIST
### Changed
- Created both environment variables in config.py
- Changed UI so that they are persisted
- Don't try to generate search query if ENABLE_SEARCH_QUERY_GENERATION = False
- Changed retrieval/web/main.py to enforce these variables
- Created a new class SearchParameters to facilitate integration of search engines and modified search engines implementations accordingly
- Detect if no search results are returned and in such case don't try to store them
- When informing the UI about searching include the search engine being searched and the query being made
- Fix typo when logging in process_web_search
### Deprecated
- RAG_WEB_SEARCH_DOMAIN_FILTER_LIST is no longer used
### Removed
- RAG_WEB_SEARCH_DOMAIN_FILTER_LIST is no longer used
### Fixed
- When no search results are found it doesn't raise an error
### Breaking Changes
- **BREAKING CHANGE**: [List any breaking changes affecting compatibility or functionality]
--- stored value for RAG_WEB_SEARCH_DOMAIN_FILTER_LIST may require migration
### Additional Information
- Refer to issue #9912 where some additional features might come in
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/10130
Author: @nachogmd
Created: 2/16/2025
Status: ❌ Closed
Base:
main← Head:web_search_domains📝 Commits (10+)
70e8337Update translation.jsonceef600support async load for websearchd3f7193web loader support proxy85c2288Update translation.jsonf376a61Merge branch 'open-webui:main' into patch-442119e2Update translation.json9072959fix: remove whitespace to improve typesetting for inline Markdown8d898f2Added romanian translations5ca39ebUpdate tavily.pya8e3104FIx: Domain Filter list in tavily.py📊 Changes
188 files changed (+2916 additions, -2306 deletions)
View changed files
📝
backend/open_webui/config.py(+53 -0)📝
backend/open_webui/env.py(+1 -0)📝
backend/open_webui/main.py(+56 -17)📝
backend/open_webui/retrieval/web/bing.py(+8 -12)📝
backend/open_webui/retrieval/web/bocha.py(+9 -8)📝
backend/open_webui/retrieval/web/brave.py(+8 -8)📝
backend/open_webui/retrieval/web/duckduckgo.py(+15 -20)📝
backend/open_webui/retrieval/web/exa.py(+9 -11)📝
backend/open_webui/retrieval/web/google_pse.py(+10 -14)📝
backend/open_webui/retrieval/web/jina_search.py(+9 -6)📝
backend/open_webui/retrieval/web/kagi.py(+9 -10)📝
backend/open_webui/retrieval/web/main.py(+32 -5)📝
backend/open_webui/retrieval/web/mojeek.py(+8 -8)📝
backend/open_webui/retrieval/web/searchapi.py(+9 -12)📝
backend/open_webui/retrieval/web/searxng.py(+10 -15)📝
backend/open_webui/retrieval/web/serpapi.py(+8 -12)📝
backend/open_webui/retrieval/web/serper.py(+7 -8)📝
backend/open_webui/retrieval/web/serply.py(+11 -17)📝
backend/open_webui/retrieval/web/serpstack.py(+9 -14)📝
backend/open_webui/retrieval/web/tavily.py(+9 -5)...and 80 more files
📄 Description
Changelog Entry
Description
Added
Changed
Deprecated
Removed
Fixed
Breaking Changes
--- stored value for RAG_WEB_SEARCH_DOMAIN_FILTER_LIST may require migration
Additional Information
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.