更新python后端
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
from langchain_milvus import BM25BuiltInFunction, Milvus
|
||||
from config.llm import embeddings
|
||||
|
||||
URI = "http://10.10.10.9:19530"
|
||||
|
||||
knVectorstore = Milvus(
|
||||
embedding_function=embeddings,
|
||||
connection_args={"uri": URI, "token": "root:Milvus", "db_name": "bbit_ai_lab"},
|
||||
collection_name="knowledge",
|
||||
index_params={"index_type": "FLAT", "metric_type": "L2"},
|
||||
consistency_level="Strong",
|
||||
auto_id=True,
|
||||
|
||||
primary_field = "id",
|
||||
text_field="text",
|
||||
vector_field="vector",
|
||||
partition_key_field = "kn_id",
|
||||
enable_dynamic_field = True,
|
||||
drop_old=False, # set to True if seeking to drop the collection with that name if it exists
|
||||
)
|
||||
memVectorstore = Milvus(
|
||||
embedding_function=embeddings,
|
||||
connection_args={"uri": URI, "token": "root:Milvus", "db_name": "bbit_ai_lab"},
|
||||
collection_name="memory",
|
||||
index_params={"index_type": "FLAT", "metric_type": "L2"},
|
||||
consistency_level="Strong",
|
||||
auto_id=True,
|
||||
|
||||
primary_field = "id",
|
||||
text_field="text",
|
||||
vector_field="vector",
|
||||
partition_key_field = "ai_id",
|
||||
enable_dynamic_field = True,
|
||||
drop_old=False, # set to True if seeking to drop the collection with that name if it exists
|
||||
)
|
||||
Reference in New Issue
Block a user