enh: enable selecting individual files from collection

This commit is contained in:
Timothy J. Baek
2024-10-12 02:31:10 -07:00
parent 0a08495fec
commit 5a96fcbeaf
6 changed files with 188 additions and 40 deletions

View File

@@ -48,7 +48,12 @@ async def get_knowledge_items(
)
else:
return [
KnowledgeResponse(**knowledge.model_dump())
KnowledgeResponse(
**knowledge.model_dump(),
files=Files.get_file_metadatas_by_ids(
knowledge.data.get("file_ids", []) if knowledge.data else []
),
)
for knowledge in Knowledges.get_knowledge_items()
]