33 lines
1.0 KiB
Python
33 lines
1.0 KiB
Python
from functools import lru_cache
|
|
from pathlib import Path
|
|
|
|
from pydantic import Field
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
|
|
|
|
database_url: str = "sqlite:///./wisegrade.db"
|
|
redis_url: str = "redis://localhost:6379/0"
|
|
inbox_path: Path = Path("/data/inbox")
|
|
processed_path: Path = Path("/data/processed")
|
|
exports_path: Path = Path("/data/exports")
|
|
deepseek_base_url: str = "https://api.deepseek.com"
|
|
deepseek_model: str = "deepseek-flash"
|
|
deepseek_api_key: str = ""
|
|
wisegrade_secret_key: str = ""
|
|
embedding_model_name: str = "BAAI/bge-m3"
|
|
embedding_model_path: Path = Path("/models/bge-m3")
|
|
embedding_model_version: str = "local"
|
|
ocr_model_dir: Path = Path("/models/ocr")
|
|
model_timeout_seconds: int = 120
|
|
model_concurrency: int = 2
|
|
model_retries: int = 2
|
|
chat_max_tool_calls: int = Field(default=32, ge=1, le=64)
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
return Settings()
|