milvus_config.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. from typing import Optional
  2. from pydantic import Field
  3. from pydantic_settings import BaseSettings
  4. class MilvusConfig(BaseSettings):
  5. """
  6. Configuration settings for Milvus vector database
  7. """
  8. MILVUS_URI: Optional[str] = Field(
  9. description="URI for connecting to the Milvus server (e.g., 'http://localhost:19530' or 'https://milvus-instance.example.com:19530')",
  10. default="http://127.0.0.1:19530",
  11. )
  12. MILVUS_TOKEN: Optional[str] = Field(
  13. description="Authentication token for Milvus, if token-based authentication is enabled",
  14. default=None,
  15. )
  16. MILVUS_USER: Optional[str] = Field(
  17. description="Username for authenticating with Milvus, if username/password authentication is enabled",
  18. default=None,
  19. )
  20. MILVUS_PASSWORD: Optional[str] = Field(
  21. description="Password for authenticating with Milvus, if username/password authentication is enabled",
  22. default=None,
  23. )
  24. MILVUS_DATABASE: str = Field(
  25. description="Name of the Milvus database to connect to (default is 'default')",
  26. default="default",
  27. )
  28. MILVUS_ENABLE_HYBRID_SEARCH: bool = Field(
  29. description="Enable hybrid search features (requires Milvus >= 2.5.0). Set to false for compatibility with "
  30. "older versions",
  31. default=True,
  32. )