2024-06-20 16:24:10 +08:00
|
|
|
from typing import Optional
|
|
|
|
|
2024-09-06 17:32:48 +08:00
|
|
|
from pydantic import Field
|
2024-07-07 12:18:15 +08:00
|
|
|
from pydantic_settings import BaseSettings
|
2024-06-20 16:24:10 +08:00
|
|
|
|
|
|
|
|
2024-07-07 12:18:15 +08:00
|
|
|
class MilvusConfig(BaseSettings):
|
2024-06-20 16:24:10 +08:00
|
|
|
"""
|
2024-09-22 12:38:41 +07:00
|
|
|
Configuration settings for Milvus vector database
|
2024-06-20 16:24:10 +08:00
|
|
|
"""
|
|
|
|
|
2024-09-06 17:32:48 +08:00
|
|
|
MILVUS_URI: Optional[str] = Field(
|
2024-09-22 12:38:41 +07:00
|
|
|
description="URI for connecting to the Milvus server (e.g., 'http://localhost:19530' or 'https://milvus-instance.example.com:19530')",
|
2024-09-06 17:32:48 +08:00
|
|
|
default="http://127.0.0.1:19530",
|
2024-06-20 16:24:10 +08:00
|
|
|
)
|
|
|
|
|
2024-09-06 17:32:48 +08:00
|
|
|
MILVUS_TOKEN: Optional[str] = Field(
|
2024-09-22 12:38:41 +07:00
|
|
|
description="Authentication token for Milvus, if token-based authentication is enabled",
|
2024-09-06 17:32:48 +08:00
|
|
|
default=None,
|
2024-06-20 16:24:10 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
MILVUS_USER: Optional[str] = Field(
|
2024-09-22 12:38:41 +07:00
|
|
|
description="Username for authenticating with Milvus, if username/password authentication is enabled",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
|
|
|
|
MILVUS_PASSWORD: Optional[str] = Field(
|
2024-09-22 12:38:41 +07:00
|
|
|
description="Password for authenticating with Milvus, if username/password authentication is enabled",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
|
|
|
|
MILVUS_DATABASE: str = Field(
|
2024-09-22 12:38:41 +07:00
|
|
|
description="Name of the Milvus database to connect to (default is 'default')",
|
2024-08-23 23:46:01 +08:00
|
|
|
default="default",
|
2024-06-20 16:24:10 +08:00
|
|
|
)
|
2025-01-08 17:39:53 +08:00
|
|
|
|
|
|
|
MILVUS_ENABLE_HYBRID_SEARCH: bool = Field(
|
|
|
|
description="Enable hybrid search features (requires Milvus >= 2.5.0). Set to false for compatibility with "
|
|
|
|
"older versions",
|
|
|
|
default=True,
|
|
|
|
)
|