fix:update awel embedding examples and delete unuseful code. (#1073)

This commit is contained in:
Aries-ckt
2024-01-15 23:22:52 +08:00
committed by GitHub
parent cb9c34abb9
commit 3a54d1ef9a
11 changed files with 45 additions and 1437 deletions

View File

@@ -497,30 +497,6 @@ class KnowledgeService:
res.page = request.page
return res
def async_knowledge_graph(self, chunk_docs, doc):
"""async document extract triplets and save into graph db
Args:
- chunk_docs: List[Document]
- doc: KnowledgeDocumentEntity
"""
logger.info(
f"async_knowledge_graph, doc:{doc.doc_name}, chunk_size:{len(chunk_docs)}, begin embedding to graph store"
)
try:
from dbgpt.rag.graph.graph_factory import RAGGraphFactory
rag_engine = CFG.SYSTEM_APP.get_component(
ComponentType.RAG_GRAPH_DEFAULT.value, RAGGraphFactory
).create()
rag_engine.knowledge_graph(chunk_docs)
doc.status = SyncStatus.FINISHED.name
doc.result = "document build graph success"
except Exception as e:
doc.status = SyncStatus.FAILED.name
doc.result = "document build graph failed" + str(e)
logger.error(f"document build graph failed:{doc.doc_name}, {str(e)}")
return knowledge_document_dao.update_knowledge_document(doc)
def async_doc_embedding(self, assembler, chunk_docs, doc):
"""async document embedding into vector db
Args: