pgvector_config.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. )
  36. PGVECTOR_PG_BIGM: bool = Field(
  37. description="Whether to use pg_bigm module for full text search",
  38. default=False,
  39. )