This commit is contained in:
Timothy J. Baek
2024-10-03 23:06:47 -07:00
parent d834bd2a18
commit 05970157f6
6 changed files with 38 additions and 17 deletions

View File

@@ -325,11 +325,16 @@ def get_rag_context(
else:
context = None
collection_names = (
file["collection_names"]
if file["type"] == "collection"
else [file["collection_name"]] if file["collection_name"] else []
)
collection_names = []
if file.get("type") == "collection":
if file.get("legacy"):
collection_names = file.get("collection_names", [])
else:
collection_names.append(file["id"])
elif file.get("collection_name"):
collection_names.append(file["collection_name"])
elif file.get("id"):
collection_names.append(f"file-{file['id']}")
collection_names = set(collection_names).difference(extracted_collections)
if not collection_names: