mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[GH-ISSUE #16366] issue: web search should filter result.snippet is None #17875
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?
Originally created by @Sean-CodeMaker on GitHub (Aug 8, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/16366
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
v0.6.18
Ollama Version (if applicable)
No response
Operating System
macOS Sonoma
Browser (if applicable)
chrome
Confirmation
README.md.Expected Behavior
{'source': 'https://news.qq.com/', 'title': '腾讯新闻', 'snippet': None, 'link': 'https://news.qq.com/'}
if search result.snippet is None,should skip this data
Actual Behavior
{'source': 'https://news.qq.com/', 'title': '腾讯新闻', 'snippet': None, 'link': 'https://news.qq.com/'}
if search result.snippet is None,will be raise error
Steps to Reproduce
1、open you open-webui website
2、select "web search"
3、input "Tell me today’s top news.",some will be error(when search result container None)
Logs & Screenshots
2025-08-08 02:48:12.208 | ERROR | open_webui.utils.middleware:chat_web_search_handler:485 - 400: [ERROR: 1 validation error for Document
page_content
Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.11/v/string_type] - {}
Traceback (most recent call last):
File "/app/backend/open_webui/routers/retrieval.py", line 1953, in process_web_search
docs = [
File "/app/backend/open_webui/routers/retrieval.py", line 1954, in
Document(
└ <class 'langchain_core.documents.base.Document'>
File "/usr/local/lib/python3.11/site-packages/langchain_core/documents/base.py", line 278, in init
super().init(page_content=page_content, **kwargs) # type: ignore[call-arg]
│ └ {'metadata': {'source': 'https://news.qq.com/', 'title': '腾讯新闻', 'snippet': None, 'link': 'https://news.qq.com/'}}
└ None
File "/usr/local/lib/python3.11/site-packages/langchain_core/load/serializable.py", line 130, in init
super().init(*args, **kwargs)
│ └ {'page_content': None, 'metadata': {'source': 'https://news.qq.com/', 'title': '腾讯新闻', 'snippet': None, 'link': 'https://news...
└ ()
File "/usr/local/lib/python3.11/site-packages/pydantic/main.py", line 253, in init
validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
│ │ │ │ └ Document()
│ │ │ └ {'page_content': None, 'metadata': {'source': 'https://news.qq.com/', 'title': '腾讯新闻', 'snippet': None, 'link': 'https://news...
│ │ └ <method 'validate_python' of 'pydantic_core._pydantic_core.SchemaValidator' objects>
│ └ SchemaValidator(title="Document", validator=Model(
│ ModelValidator {
│ revalidate: Never,
│ validator: ModelFi...
└ Document()
pydantic_core._pydantic_core.ValidationError: 1 validation error for Document
page_content
Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.11/v/string_type
Additional Information
No response
@tjbck commented on GitHub (Aug 8, 2025):
Addressed with 736b29ddca4f6a44ef0ccecc4a0bc07ca1d88caa!