feat: ES VectorStore (#1500)

Co-authored-by: aries_ckt <916701291@qq.com>
This commit is contained in:
IamWWT
2024-05-14 19:55:34 +08:00
committed by GitHub
parent 8b88f7e11c
commit db4d318a5f
6 changed files with 433 additions and 3 deletions

View File

@@ -482,7 +482,13 @@ class KnowledgeService:
raise Exception(f"there are no or more than one document called {doc_name}")
vector_ids = documents[0].vector_ids
if vector_ids is not None:
config = VectorStoreConfig(name=space_name)
embedding_factory = CFG.SYSTEM_APP.get_component(
"embedding_factory", EmbeddingFactory
)
embedding_fn = embedding_factory.create(
model_name=EMBEDDING_MODEL_CONFIG[CFG.EMBEDDING_MODEL]
)
config = VectorStoreConfig(name=space_name, embedding_fn=embedding_fn)
vector_store_connector = VectorStoreConnector(
vector_store_type=CFG.VECTOR_STORE_TYPE,
vector_store_config=config,