mirror of
https://github.com/open-webui/open-webui
synced 2025-02-23 13:51:07 +00:00
refac
This commit is contained in:
parent
8f72f8def9
commit
c073b8b4ee
@ -154,15 +154,18 @@ def merge_get_results(get_results: list[dict]) -> dict:
|
|||||||
# Initialize lists to store combined data
|
# Initialize lists to store combined data
|
||||||
combined_documents = []
|
combined_documents = []
|
||||||
combined_metadatas = []
|
combined_metadatas = []
|
||||||
|
combined_ids = []
|
||||||
|
|
||||||
for data in get_results:
|
for data in get_results:
|
||||||
combined_documents.extend(data["documents"][0])
|
combined_documents.extend(data["documents"][0])
|
||||||
combined_metadatas.extend(data["metadatas"][0])
|
combined_metadatas.extend(data["metadatas"][0])
|
||||||
|
combined_ids.extend(data["ids"][0])
|
||||||
|
|
||||||
# Create the output dictionary
|
# Create the output dictionary
|
||||||
result = {
|
result = {
|
||||||
"documents": [combined_documents],
|
"documents": [combined_documents],
|
||||||
"metadatas": [combined_metadatas],
|
"metadatas": [combined_metadatas],
|
||||||
|
"ids": [combined_ids],
|
||||||
}
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
Loading…
Reference in New Issue
Block a user