mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-11 03:38:02 +00:00
refac
This commit is contained in:
parent
fc8beff4c8
commit
cca24f4e17
1 changed files with 3 additions and 1 deletions
|
|
@ -1709,7 +1709,7 @@ async def get_sources_from_items(
|
|||
metadata['file_id']
|
||||
for source in sources
|
||||
for metadata in source['metadata']
|
||||
if isinstance(metadata, dict) and metadata.get('file_id')
|
||||
if isinstance(metadata, dict) and metadata.get('file_id') and not metadata.get('external')
|
||||
}
|
||||
if file_ids:
|
||||
file_names = {
|
||||
|
|
@ -1717,6 +1717,8 @@ async def get_sources_from_items(
|
|||
}
|
||||
for source in sources:
|
||||
for metadata in source['metadata']:
|
||||
if isinstance(metadata, dict) and metadata.get('external'):
|
||||
continue
|
||||
file_name = file_names.get(metadata.get('file_id')) if isinstance(metadata, dict) else None
|
||||
if file_name:
|
||||
if metadata.get('source') == metadata.get('name'):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue