-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
50 lines (40 loc) · 2.63 KB
/
config.py
File metadata and controls
50 lines (40 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
# ──────────────────────────────────────────────────────
# PostgreSQL credentials — replace before running
# ──────────────────────────────────────────────────────
DB_USER: str = "YOUR_POSTGRES_USERNAME" # ← replace
DB_PASSWORD: str = "YOUR_POSTGRES_PASSWORD" # ← replace
DB_HOST: str = "localhost"
DB_PORT: int = 5432
DB_NAME: str = "sql_assistant"
# ──────────────────────────────────────────────────────
# AI Provider API keys — replace the ones you intend to use
# ──────────────────────────────────────────────────────
ANTHROPIC_API_KEY: str = "YOUR_ANTHROPIC_API_KEY" # ← replace (Claude)
OPENAI_API_KEY: str = "YOUR_OPENAI_API_KEY" # ← replace (OpenAI)
DEEPSEEK_API_KEY: str = "YOUR_DEEPSEEK_API_KEY" # ← replace (Deepseek)
# Ollama runs locally — no API key required
OLLAMA_BASE_URL: str = "http://localhost:11434"
# ──────────────────────────────────────────────────────
# Default model per provider
# ──────────────────────────────────────────────────────
CLAUDE_MODEL: str = "claude-sonnet-4-6"
OPENAI_MODEL: str = "gpt-4o"
DEEPSEEK_MODEL: str = "deepseek-chat"
OLLAMA_MODEL: str = "llama3.2"
# ──────────────────────────────────────────────────────
# Safety limits
# ──────────────────────────────────────────────────────
QUERY_ROW_LIMIT: int = 200
QUERY_TIMEOUT_SECONDS: int = 10
@property
def database_url(self) -> str:
return (
f"postgresql+asyncpg://{self.DB_USER}:{self.DB_PASSWORD}"
f"@{self.DB_HOST}:{self.DB_PORT}/{self.DB_NAME}"
)
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
settings = Settings()