mirror of
https://github.com/open-webui/open-webui
synced 2025-06-25 09:47:41 +00:00
Merge pull request #12896 from gaby/fix-12893
fix: Optional content from files routes
This commit is contained in:
commit
07347f518a
@ -51,7 +51,9 @@ class QdrantClient:
|
|||||||
self.client.create_collection(
|
self.client.create_collection(
|
||||||
collection_name=collection_name_with_prefix,
|
collection_name=collection_name_with_prefix,
|
||||||
vectors_config=models.VectorParams(
|
vectors_config=models.VectorParams(
|
||||||
size=dimension, distance=models.Distance.COSINE, on_disk=self.QDRANT_ON_DISK
|
size=dimension,
|
||||||
|
distance=models.Distance.COSINE,
|
||||||
|
on_disk=self.QDRANT_ON_DISK,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -173,6 +173,7 @@ async def list_files(user=Depends(get_verified_user), content: bool = Query(True
|
|||||||
|
|
||||||
if not content:
|
if not content:
|
||||||
for file in files:
|
for file in files:
|
||||||
|
if "content" in file.data:
|
||||||
del file.data["content"]
|
del file.data["content"]
|
||||||
|
|
||||||
return files
|
return files
|
||||||
@ -214,6 +215,7 @@ async def search_files(
|
|||||||
|
|
||||||
if not content:
|
if not content:
|
||||||
for file in matching_files:
|
for file in matching_files:
|
||||||
|
if "content" in file.data:
|
||||||
del file.data["content"]
|
del file.data["content"]
|
||||||
|
|
||||||
return matching_files
|
return matching_files
|
||||||
|
Loading…
Reference in New Issue
Block a user