You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.2 KiB
Python
32 lines
1.2 KiB
Python
# backend/app/config.py
|
|
from functools import lru_cache
|
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore")
|
|
|
|
database_url: str = "sqlite:///./ari.db"
|
|
|
|
# LLM — 절대 특정 모델을 하드코딩하지 않는다. 설치된 모델을 env로 주입.
|
|
ollama_host: str = "http://localhost:11434"
|
|
ollama_model: str = "llama3.1" # 기본 placeholder. 실제 운영은 .env 로 덮어쓴다.
|
|
llm_provider: str = "auto" # auto | ollama | heuristic
|
|
llm_timeout: float = 20.0 # 초
|
|
|
|
# 리스크 계산 기준일 — CONTRACT: TODAY=8 (6/8). 시드가 '6/7~6/12 한 주' 가정.
|
|
risk_today: int = 8
|
|
|
|
# CORS 허용 출처(콤마구분). 단일 환경변수 규약: FRONTEND_ORIGIN.
|
|
# 개발 포트는 흔한 dev 포트와 충돌을 피해 31xxx 대역 사용(프론트 31300).
|
|
frontend_origin: str = "http://localhost:31300"
|
|
|
|
# 테스트 리셋 게이트 (테스트 환경에서만 시드 리셋 허용)
|
|
ari_allow_test_reset: bool = False
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
return Settings()
|