mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-10 22:43:29 +00:00
fix: pass file.meta through to vector DB chunks on file upload (#29499)
Custom metadata attached to a file upload (e.g. via the API's metadata field) was stored on the file row but silently dropped when the file was chunked and embedded for RAG, so it never reached the LLM through retrieved sources. process_file() builds chunk metadata in several branches; three of them already merge the file's meta dict in, but the branch used for a fresh upload processed through a document loader did not. Bring it in line with the others so custom metadata flows through consistently regardless of upload path. Reported in open-webui/open-webui#29486.
This commit is contained in:
parent
aa48106fca
commit
8ba8786d6a
1 changed files with 1 additions and 0 deletions
|
|
@ -1967,6 +1967,7 @@ async def process_file(
|
|||
Document(
|
||||
page_content=doc.page_content,
|
||||
metadata={
|
||||
**file.meta,
|
||||
**filter_metadata(doc.metadata),
|
||||
'name': file.filename,
|
||||
'created_by': file.user_id,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue