更新python后端

This commit is contained in:
BBIT-Kai
2025-09-18 17:18:18 +08:00
parent 2fc209e6e6
commit de6a350da8
45 changed files with 2524 additions and 89 deletions
+35
View File
@@ -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
)