qdrant_config.py 799 B

1234567891011121314151617181920212223242526272829303132333435
  1. from typing import Optional
  2. from pydantic import Field, NonNegativeInt, PositiveInt
  3. from pydantic_settings import BaseSettings
  4. class QdrantConfig(BaseSettings):
  5. """
  6. Qdrant configs
  7. """
  8. QDRANT_URL: Optional[str] = Field(
  9. description='Qdrant url',
  10. default=None,
  11. )
  12. QDRANT_API_KEY: Optional[str] = Field(
  13. description='Qdrant api key',
  14. default=None,
  15. )
  16. QDRANT_CLIENT_TIMEOUT: NonNegativeInt = Field(
  17. description='Qdrant client timeout in seconds',
  18. default=20,
  19. )
  20. QDRANT_GRPC_ENABLED: bool = Field(
  21. description='whether enable grpc support for Qdrant connection',
  22. default=False,
  23. )
  24. QDRANT_GRPC_PORT: PositiveInt = Field(
  25. description='Qdrant grpc port',
  26. default=6334,
  27. )