30 lines
937 B
Python
30 lines
937 B
Python
from functools import lru_cache
|
|
from pathlib import Path
|
|
|
|
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"
|
|
model_timeout_seconds: int = 120
|
|
model_concurrency: int = 2
|
|
model_retries: int = 2
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
return Settings()
|