Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dep: initial support for Milvus 2.4.x #6084

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions api/core/rag/datasource/vdb/milvus/milvus_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from pydantic import BaseModel, model_validator
from pymilvus import MilvusClient, MilvusException, connections
from pymilvus.milvus_client import IndexParams

from configs import dify_config
from core.rag.datasource.entity.embedding import Embeddings
Expand Down Expand Up @@ -250,11 +251,15 @@ def create_collection(
# Since primary field is auto-id, no need to track it
self._fields.remove(Field.PRIMARY_KEY.value)

# Create Index params for the collection
index_params_obj = IndexParams()
index_params_obj.add_index(field_name=Field.VECTOR.value, **index_params)

# Create the collection
collection_name = self._collection_name
self._client.create_collection_with_schema(collection_name=collection_name,
schema=schema, index_param=index_params,
consistency_level=self._consistency_level)
self._client.create_collection(collection_name=collection_name,
schema=schema, index_params=index_params_obj,
consistency_level=self._consistency_level)
redis_client.set(collection_exist_cache_key, 1, ex=3600)

def _init_client(self, config) -> MilvusClient:
Expand Down
111 changes: 35 additions & 76 deletions api/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ chromadb = "0.5.1"
oracledb = "~2.2.1"
pgvecto-rs = "0.1.4"
pgvector = "0.2.5"
pymilvus = "2.3.1"
pymilvus = "~2.4.4"
pymysql = "1.1.1"
tcvectordb = "1.3.2"
tidb-vector = "0.0.9"
Expand Down
2 changes: 1 addition & 1 deletion docker-legacy/docker-compose.milvus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ services:

milvus-standalone:
container_name: milvus-standalone
image: milvusdb/milvus:v2.3.1
image: milvusdb/milvus:v2.4.6
command: ["milvus", "run", "standalone"]
environment:
ETCD_ENDPOINTS: etcd:2379
Expand Down