mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-08 20:39:44 +00:00
Co-authored-by: WangTing <wangting@192.168.1.10> Co-authored-by: aries_ckt <916701291@qq.com>
This commit is contained in:
@@ -219,6 +219,7 @@ class KnowledgeDocumentDao(BaseDao):
|
||||
)
|
||||
|
||||
results = counts_query.all()
|
||||
session.close()
|
||||
docs_count = {result.space: result.document_count for result in results}
|
||||
return docs_count
|
||||
|
||||
@@ -253,7 +254,9 @@ class KnowledgeDocumentDao(BaseDao):
|
||||
session = self.get_raw_session()
|
||||
updated_space = session.merge(document)
|
||||
session.commit()
|
||||
return updated_space.id
|
||||
update_space_id = updated_space.id
|
||||
session.close()
|
||||
return update_space_id
|
||||
|
||||
#
|
||||
def raw_delete(self, query: KnowledgeDocumentEntity):
|
||||
|
@@ -220,9 +220,14 @@ class KnowledgeService:
|
||||
document.status not in [SyncStatus.RUNNING.name]
|
||||
and len(chunk_entities) == 0
|
||||
):
|
||||
self._sync_knowledge_document(
|
||||
space_name=document.space,
|
||||
doc=document,
|
||||
from dbgpt.serve.rag.service.service import Service
|
||||
|
||||
rag_service = Service.get_instance(CFG.SYSTEM_APP)
|
||||
space = rag_service.get({"name": document.space})
|
||||
document_vo = KnowledgeDocumentEntity.to_document_vo(documents)
|
||||
await rag_service._sync_knowledge_document(
|
||||
space_id=space.id,
|
||||
doc_vo=document_vo[0],
|
||||
chunk_parameters=chunk_parameters,
|
||||
)
|
||||
knowledge = KnowledgeFactory.create(
|
||||
|
Reference in New Issue
Block a user