pgvector_config.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. from typing import Optional
  2. from pydantic import Field, PositiveInt
  3. from pydantic_settings import BaseSettings
  4. class PGVectorConfig(BaseSettings):
  5. """
  6. Configuration settings for PGVector (PostgreSQL with vector extension)
  7. """
  8. PGVECTOR_HOST: Optional[str] = Field(
  9. description="Hostname or IP address of the PostgreSQL server with PGVector extension (e.g., 'localhost')",
  10. default=None,
  11. )
  12. PGVECTOR_PORT: PositiveInt = Field(
  13. description="Port number on which the PostgreSQL server is listening (default is 5433)",
  14. default=5433,
  15. )
  16. PGVECTOR_USER: Optional[str] = Field(
  17. description="Username for authenticating with the PostgreSQL database",
  18. default=None,
  19. )
  20. PGVECTOR_PASSWORD: Optional[str] = Field(
  21. description="Password for authenticating with the PostgreSQL database",
  22. default=None,
  23. )
  24. PGVECTOR_DATABASE: Optional[str] = Field(
  25. description="Name of the PostgreSQL database to connect to",
  26. default=None,
  27. )
  28. PGVECTOR_MIN_CONNECTION: PositiveInt = Field(
  29. description="Min connection of the PostgreSQL database",
  30. default=1,
  31. )
  32. PGVECTOR_MAX_CONNECTION: PositiveInt = Field(
  33. description="Max connection of the PostgreSQL database",
  34. default=5,
  35. )