2024-06-20 16:24:10 +08:00
|
|
|
from typing import Optional
|
|
|
|
|
2024-07-07 12:18:15 +08:00
|
|
|
from pydantic import Field, PositiveInt
|
|
|
|
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
|
|
|
"""
|
|
|
|
Milvus configs
|
|
|
|
"""
|
|
|
|
|
|
|
|
MILVUS_HOST: Optional[str] = Field(
|
2024-08-23 23:46:01 +08:00
|
|
|
description="Milvus host",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
|
|
|
|
MILVUS_PORT: PositiveInt = Field(
|
2024-08-23 23:46:01 +08:00
|
|
|
description="Milvus RestFul API port",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=9091,
|
|
|
|
)
|
|
|
|
|
|
|
|
MILVUS_USER: Optional[str] = Field(
|
2024-08-23 23:46:01 +08:00
|
|
|
description="Milvus user",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
|
|
|
|
MILVUS_PASSWORD: Optional[str] = Field(
|
2024-08-23 23:46:01 +08:00
|
|
|
description="Milvus password",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
|
|
|
|
MILVUS_SECURE: bool = Field(
|
2024-08-23 23:46:01 +08:00
|
|
|
description="whether to use SSL connection for Milvus",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=False,
|
|
|
|
)
|
|
|
|
|
|
|
|
MILVUS_DATABASE: str = Field(
|
2024-08-23 23:46:01 +08:00
|
|
|
description="Milvus database, default to `default`",
|
|
|
|
default="default",
|
2024-06-20 16:24:10 +08:00
|
|
|
)
|