All checks were successful
Deploy FluentGerman.ai / deploy (push) Successful in 50s
51 lines
1.4 KiB
Python
51 lines
1.4 KiB
Python
"""FluentGerman.ai — Application configuration."""
|
|
|
|
from functools import lru_cache
|
|
from typing import Literal
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""App settings loaded from environment / .env file."""
|
|
|
|
# App
|
|
app_name: str = "FluentGerman.ai"
|
|
app_port: int = 8999
|
|
app_domain: str = ""
|
|
debug: bool = False
|
|
|
|
# Security
|
|
secret_key: str = "CHANGE-ME-in-production"
|
|
access_token_expire_minutes: int = 60 * 24 # 24h
|
|
algorithm: str = "HS256"
|
|
|
|
# Database
|
|
database_url: str = "mysql+aiomysql://fluentgerman:fluentgerman@localhost:3306/fluentgerman"
|
|
|
|
# LLM
|
|
llm_provider: str = "openai" # used by litellm routing
|
|
llm_api_key: str = ""
|
|
llm_model: str = "gpt-4o-mini"
|
|
|
|
# OpenAI API Key (specifically for Voice/TTS if LLM_PROVIDER is different)
|
|
openai_api_key: str = ""
|
|
|
|
# Voice feature flag: "api" = LLM provider Whisper/TTS, "browser" = Web Speech API
|
|
voice_mode: Literal["api", "browser"] = "api"
|
|
tts_model: str = "tts-1"
|
|
tts_voice: str = "alloy"
|
|
stt_model: str = "gpt-4o-mini-transcribe"
|
|
|
|
# Admin bootstrap
|
|
admin_email: str = "admin@fluentgerman.ai"
|
|
admin_username: str = "admin"
|
|
admin_password: str = "CHANGE-ME"
|
|
|
|
model_config = {"env_file": ".env", "env_file_encoding": "utf-8"}
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
return Settings()
|