2024-06-20 16:24:10 +08:00
|
|
|
from typing import Optional
|
|
|
|
|
2024-07-07 12:18:15 +08:00
|
|
|
from pydantic import Field, PositiveInt
|
|
|
|
from pydantic_settings import BaseSettings
|
2024-06-20 16:24:10 +08:00
|
|
|
|
|
|
|
|
2024-07-07 12:18:15 +08:00
|
|
|
class PGVectorConfig(BaseSettings):
|
2024-06-20 16:24:10 +08:00
|
|
|
"""
|
2024-09-22 12:38:41 +07:00
|
|
|
Configuration settings for PGVector (PostgreSQL with vector extension)
|
2024-06-20 16:24:10 +08:00
|
|
|
"""
|
|
|
|
|
|
|
|
PGVECTOR_HOST: Optional[str] = Field(
|
2024-09-22 12:38:41 +07:00
|
|
|
description="Hostname or IP address of the PostgreSQL server with PGVector extension (e.g., 'localhost')",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
|
2024-10-14 23:47:58 +08:00
|
|
|
PGVECTOR_PORT: PositiveInt = Field(
|
2024-09-22 12:38:41 +07:00
|
|
|
description="Port number on which the PostgreSQL server is listening (default is 5433)",
|
2024-06-26 21:01:16 +08:00
|
|
|
default=5433,
|
2024-06-20 16:24:10 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
PGVECTOR_USER: Optional[str] = Field(
|
2024-09-22 12:38:41 +07:00
|
|
|
description="Username for authenticating with the PostgreSQL database",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
|
|
|
|
PGVECTOR_PASSWORD: Optional[str] = Field(
|
2024-09-22 12:38:41 +07:00
|
|
|
description="Password for authenticating with the PostgreSQL database",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
|
|
|
|
PGVECTOR_DATABASE: Optional[str] = Field(
|
2024-09-22 12:38:41 +07:00
|
|
|
description="Name of the PostgreSQL database to connect to",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=None,
|
|
|
|
)
|
2024-09-27 18:16:20 +08:00
|
|
|
|
|
|
|
PGVECTOR_MIN_CONNECTION: PositiveInt = Field(
|
|
|
|
description="Min connection of the PostgreSQL database",
|
|
|
|
default=1,
|
|
|
|
)
|
|
|
|
|
|
|
|
PGVECTOR_MAX_CONNECTION: PositiveInt = Field(
|
|
|
|
description="Max connection of the PostgreSQL database",
|
|
|
|
default=5,
|
|
|
|
)
|
2025-03-13 17:32:34 +09:00
|
|
|
|
|
|
|
PGVECTOR_PG_BIGM: bool = Field(
|
|
|
|
description="Whether to use pg_bigm module for full text search",
|
|
|
|
default=False,
|
|
|
|
)
|