feat:chroma store refactor (#1508)

This commit is contained in:
Aries-ckt
2024-05-11 16:31:34 +08:00
committed by GitHub
parent bc9ce3c2ae
commit d3131552d3
6 changed files with 159 additions and 40 deletions

View File

@@ -247,11 +247,13 @@ class KnowledgeService:
doc_ids = sync_request.doc_ids
self.model_name = sync_request.model_name or CFG.LLM_MODEL
for doc_id in doc_ids:
query = KnowledgeDocumentEntity(
id=doc_id,
space=space_name,
)
doc = knowledge_document_dao.get_knowledge_documents(query)[0]
query = KnowledgeDocumentEntity(id=doc_id)
docs = knowledge_document_dao.get_documents(query)
if len(docs) == 0:
raise Exception(
f"there are document called, doc_id: {sync_request.doc_id}"
)
doc = docs[0]
if (
doc.status == SyncStatus.RUNNING.name
or doc.status == SyncStatus.FINISHED.name