38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
from functools import lru_cache
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
database_url: str = "postgresql://nvi:nvi@postgres:5432/nvi"
|
|
|
|
# Active dataset. Matches: api/datasets/<name>/, the Postgres schema, and
|
|
# ctrl/seed/data/<name>.sqlite. Restart the api to switch.
|
|
dataset: str = "financial"
|
|
|
|
# LLM provider. Supported: "groq", "anthropic", "openai".
|
|
llm_provider: str = "groq"
|
|
|
|
anthropic_api_key: str = ""
|
|
anthropic_model: str = "claude-sonnet-4-6"
|
|
|
|
# Groq is OpenAI-API-compatible; we hit it via the openai SDK with a base_url override.
|
|
groq_api_key: str = ""
|
|
groq_model: str = "llama-3.3-70b-versatile"
|
|
groq_base_url: str = "https://api.groq.com/openai/v1"
|
|
|
|
openai_api_key: str = ""
|
|
openai_model: str = "gpt-4o-mini"
|
|
openai_base_url: str = "https://api.openai.com/v1"
|
|
|
|
langfuse_host: str = "http://lng.local.ar"
|
|
langfuse_public_key: str = ""
|
|
langfuse_secret_key: str = ""
|
|
|
|
model_config = {"env_prefix": "", "case_sensitive": False}
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
return Settings()
|