mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:39:31 -05:00
[PR #12506] [MERGED] fix: fix web results all getting the same source id when bypassing embedding and retrieval #93972
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/12506
Author: @Ithanil
Created: 4/6/2025
Status: ✅ Merged
Merged: 4/6/2025
Merged by: @tjbck
Base:
dev← Head:fix_web_result_source_ids📝 Commits (1)
2729d8afix web results all getting the same source id when bypassing embedding and retrieval📊 Changes
1 file changed (+9 additions, -8 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+9 -8)📄 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
All web search results per search query were assigned the same source id before, despite containing content from different URLs. Thus, URLs wouldn't be cited correctly.
This PR fixes the source id assignment for the case of bypassed embedding&retrieval, making sure every URL gets its own source id.
Fixed
Screenshot
Additional Information
This fixes https://github.com/open-webui/open-webui/discussions/11205 for web search (together with https://github.com/open-webui/open-webui/pull/12507). I think further fixes are needed for RAG with knowledge bases and potentially also tool results (https://github.com/open-webui/open-webui/discussions/10595). The case of regular file uploads within the chat is fine.
It works in conjunction with additional sources, e.g. from file uploads, or multiple search queries.
Alternatives considered
https://github.com/open-webui/open-webui/discussions/11205#discussioncomment-12684414 , but I think that would assign a different source id to every chunk in embed&retrieval mode.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.