mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 12:58:11 -05:00
[GH-ISSUE #13190] issue: Unexpected query generation when attaching documents #16837
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 @YorhaL on GitHub (Apr 24, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/13190
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.6.5
Ollama Version (if applicable)
No response
Operating System
macOS 15
Browser (if applicable)
Chrome
Confirmation
README.md.Expected Behavior
Unexpected search queries are not generated
Actual Behavior
An API call to generate search queries was unexpectedly made even when "Web Search" was disabled and "Bypass Embedding and Retrieval" was enabled
Steps to Reproduce
Settings -> Documents -> Bypass Embedding and RetrievalSettings -> WebSearch -> Bypass Embedding and RetrievalLogs & Screenshots
Additional Information
No response
@tth37 commented on GitHub (Apr 24, 2025):
I've identified and reproduced the issue: whenever files are attached to the request -- whether they are web search results, uploaded documents, or other types -- the
generate_querieshandler is consistently triggered.However, in your case, since
BYPASS_EMBEDDING_AND_RETRIEVALis enabled, the queries are ignored during further processing inget_sources_from_files. As a result, thegenerate_queriesprocess becomes unnecessary and can be safely bypassed.0b5514f376/backend/open_webui/utils/middleware.py (L575-L639)A potential solution is to introduce an
if-elsecondition before invokinggenerate_queries.@tjbck commented on GitHub (Apr 28, 2025):
This is a lot trickier than just adding
if-elseconditions, the user may include multiple files alongside web search and haveBypass Embedding and Retrievalenabled for one and not for the other. You should disable query generation instead from the Admin Settings > Interface.