pgvector_config.py 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  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: Optional[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. )