diff --git a/backend/open_webui/retrieval/utils.py b/backend/open_webui/retrieval/utils.py index a0b2d3a11e..61cca0a441 100644 --- a/backend/open_webui/retrieval/utils.py +++ b/backend/open_webui/retrieval/utils.py @@ -1421,7 +1421,7 @@ async def get_sources_from_items( # Fallback to item content query_result = { 'documents': [[item.get('content')]], - 'metadatas': [[{'file_id': item.get('id'), 'name': item.get('name')}]], + 'metadatas': [[{'name': item.get('name')}]], } elif item.get('type') == 'note': diff --git a/backend/open_webui/utils/middleware.py b/backend/open_webui/utils/middleware.py index a8186a637a..866cd94c82 100644 --- a/backend/open_webui/utils/middleware.py +++ b/backend/open_webui/utils/middleware.py @@ -1000,7 +1000,7 @@ def get_source_context(sources: list, source_ids: dict = None, include_content: source_ids[source_id] = len(source_ids) + 1 src_name = source.get('source', {}).get('name') src_type = source.get('source', {}).get('type') - src_rid = source.get('source', {}).get('id') + src_rid = source.get('source', {}).get('id') if src_type != 'text' else None body = doc if include_content else '' extra_attrs = '' for key, value in filter_source_metadata(meta).items():