mirror of
https://github.com/open-webui/open-webui
synced 2025-01-18 00:30:51 +00:00
parent
7b91be21b4
commit
0a5a2e67e8
@ -149,16 +149,20 @@ def query_collection(
|
|||||||
):
|
):
|
||||||
results = []
|
results = []
|
||||||
for collection_name in collection_names:
|
for collection_name in collection_names:
|
||||||
try:
|
if collection_name:
|
||||||
result = query_doc(
|
try:
|
||||||
collection_name=collection_name,
|
result = query_doc(
|
||||||
query=query,
|
collection_name=collection_name,
|
||||||
k=k,
|
query=query,
|
||||||
embedding_function=embedding_function,
|
k=k,
|
||||||
)
|
embedding_function=embedding_function,
|
||||||
results.append(result)
|
)
|
||||||
except Exception:
|
results.append(result)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return merge_and_sort_query_results(results, k=k)
|
return merge_and_sort_query_results(results, k=k)
|
||||||
|
|
||||||
|
|
||||||
@ -257,7 +261,7 @@ def get_rag_context(
|
|||||||
collection_names = (
|
collection_names = (
|
||||||
file["collection_names"]
|
file["collection_names"]
|
||||||
if file["type"] == "collection"
|
if file["type"] == "collection"
|
||||||
else [file["collection_name"]]
|
else [file["collection_name"]] if file["collection_name"] else []
|
||||||
)
|
)
|
||||||
|
|
||||||
collection_names = set(collection_names).difference(extracted_collections)
|
collection_names = set(collection_names).difference(extracted_collections)
|
||||||
|
Loading…
Reference in New Issue
Block a user