qdrant_config.py 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. from typing import Optional
  2. from pydantic import Field, NonNegativeInt, PositiveInt
  3. from pydantic_settings import BaseSettings
  4. class QdrantConfig(BaseSettings):
  5. """
  6. Configuration settings for Qdrant vector database
  7. """
  8. QDRANT_URL: Optional[str] = Field(
  9. description="URL of the Qdrant server (e.g., 'http://localhost:6333' or 'https://qdrant.example.com')",
  10. default=None,
  11. )
  12. QDRANT_API_KEY: Optional[str] = Field(
  13. description="API key for authenticating with the Qdrant server",
  14. default=None,
  15. )
  16. QDRANT_CLIENT_TIMEOUT: NonNegativeInt = Field(
  17. description="Timeout in seconds for Qdrant client operations (default is 20 seconds)",
  18. default=20,
  19. )
  20. QDRANT_GRPC_ENABLED: bool = Field(
  21. description="Whether to enable gRPC support for Qdrant connection (True for gRPC, False for HTTP)",
  22. default=False,
  23. )
  24. QDRANT_GRPC_PORT: PositiveInt = Field(
  25. description="Port number for gRPC connection to Qdrant server (default is 6334)",
  26. default=6334,
  27. )