You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

milvus_config.py 1.5KB

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