Spaces:
Paused
Paused
Upload api\configs\middleware\vdb\pgvector_config.py with huggingface_hub
Browse files
api//configs//middleware//vdb//pgvector_config.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Optional
|
| 2 |
+
|
| 3 |
+
from pydantic import Field, PositiveInt
|
| 4 |
+
from pydantic_settings import BaseSettings
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class PGVectorConfig(BaseSettings):
|
| 8 |
+
"""
|
| 9 |
+
Configuration settings for PGVector (PostgreSQL with vector extension)
|
| 10 |
+
"""
|
| 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 |
+
|
| 17 |
+
PGVECTOR_PORT: PositiveInt = Field(
|
| 18 |
+
description="Port number on which the PostgreSQL server is listening (default is 5433)",
|
| 19 |
+
default=5433,
|
| 20 |
+
)
|
| 21 |
+
|
| 22 |
+
PGVECTOR_USER: Optional[str] = Field(
|
| 23 |
+
description="Username for authenticating with the PostgreSQL database",
|
| 24 |
+
default=None,
|
| 25 |
+
)
|
| 26 |
+
|
| 27 |
+
PGVECTOR_PASSWORD: Optional[str] = Field(
|
| 28 |
+
description="Password for authenticating with the PostgreSQL database",
|
| 29 |
+
default=None,
|
| 30 |
+
)
|
| 31 |
+
|
| 32 |
+
PGVECTOR_DATABASE: Optional[str] = Field(
|
| 33 |
+
description="Name of the PostgreSQL database to connect to",
|
| 34 |
+
default=None,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
PGVECTOR_MIN_CONNECTION: PositiveInt = Field(
|
| 38 |
+
description="Min connection of the PostgreSQL database",
|
| 39 |
+
default=1,
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
PGVECTOR_MAX_CONNECTION: PositiveInt = Field(
|
| 43 |
+
description="Max connection of the PostgreSQL database",
|
| 44 |
+
default=5,
|
| 45 |
+
)
|