mirror of
https://github.com/zylon-ai/private-gpt.git
synced 2025-12-22 13:55:41 +01:00
feat(vectordb): Milvus vector db Integration (#1996)
* integrate Milvus into Private GPT * adjust milvus settings * update doc info and reformat * adjust milvus initialization * adjust import error * mionr update * adjust format * adjust the db storing path * update doc
This commit is contained in:
parent
4523a30c8f
commit
43cc31f740
8 changed files with 173 additions and 6 deletions
|
|
@ -121,6 +121,45 @@ class VectorStoreComponent:
|
|||
collection_name="make_this_parameterizable_per_api_call",
|
||||
), # TODO
|
||||
)
|
||||
|
||||
case "milvus":
|
||||
try:
|
||||
from llama_index.vector_stores.milvus import ( # type: ignore
|
||||
MilvusVectorStore,
|
||||
)
|
||||
except ImportError as e:
|
||||
raise ImportError(
|
||||
"Milvus dependencies not found, install with `poetry install --extras vector-stores-milvus`"
|
||||
) from e
|
||||
|
||||
if settings.milvus is None:
|
||||
logger.info(
|
||||
"Milvus config not found. Using default settings.\n"
|
||||
"Trying to connect to Milvus at local_data/private_gpt/milvus/milvus_local.db "
|
||||
"with collection 'make_this_parameterizable_per_api_call'."
|
||||
)
|
||||
|
||||
self.vector_store = typing.cast(
|
||||
BasePydanticVectorStore,
|
||||
MilvusVectorStore(
|
||||
dim=settings.embedding.embed_dim,
|
||||
collection_name="make_this_parameterizable_per_api_call",
|
||||
overwrite=True,
|
||||
),
|
||||
)
|
||||
|
||||
else:
|
||||
self.vector_store = typing.cast(
|
||||
BasePydanticVectorStore,
|
||||
MilvusVectorStore(
|
||||
dim=settings.embedding.embed_dim,
|
||||
uri=settings.milvus.uri,
|
||||
token=settings.milvus.token,
|
||||
collection_name=settings.milvus.collection_name,
|
||||
overwrite=settings.milvus.overwrite,
|
||||
),
|
||||
)
|
||||
|
||||
case "clickhouse":
|
||||
try:
|
||||
from clickhouse_connect import ( # type: ignore
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue