Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

pgvector_config.py 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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_IS_OWNER: Optional[bool] = Field(
  9. description="Whether the PGVector is the owner of the database",
  10. default=True,
  11. )
  12. PGVECTOR_HOST: Optional[str] = Field(
  13. description="Hostname or IP address of the PostgreSQL server with PGVector extension (e.g., 'localhost')",
  14. default=None,
  15. )
  16. PGVECTOR_PORT: PositiveInt = Field(
  17. description="Port number on which the PostgreSQL server is listening (default is 5433)",
  18. default=5433,
  19. )
  20. PGVECTOR_USER: Optional[str] = Field(
  21. description="Username for authenticating with the PostgreSQL database",
  22. default=None,
  23. )
  24. PGVECTOR_PASSWORD: Optional[str] = Field(
  25. description="Password for authenticating with the PostgreSQL database",
  26. default=None,
  27. )
  28. PGVECTOR_DATABASE: Optional[str] = Field(
  29. description="Name of the PostgreSQL database to connect to",
  30. default=None,
  31. )
  32. PGVECTOR_MIN_CONNECTION: PositiveInt = Field(
  33. description="Min connection of the PostgreSQL database",
  34. default=1,
  35. )
  36. PGVECTOR_MAX_CONNECTION: PositiveInt = Field(
  37. description="Max connection of the PostgreSQL database",
  38. default=5,
  39. )
  40. PGVECTOR_PG_BIGM: bool = Field(
  41. description="Whether to use pg_bigm module for full text search",
  42. default=False,
  43. )