52 lines
1.3 KiB
Python
52 lines
1.3 KiB
Python
# app/config/settings.py
|
|
"""
|
|
HealthSync Motivator Batch 환경설정
|
|
"""
|
|
from pydantic_settings import BaseSettings
|
|
from typing import Optional
|
|
import os
|
|
from dotenv import load_dotenv
|
|
|
|
# .env 파일 로드
|
|
load_dotenv()
|
|
|
|
class Settings(BaseSettings):
|
|
"""Motivator Batch 애플리케이션 설정 클래스"""
|
|
|
|
# 기본 앱 설정
|
|
app_name: str = "HealthSync Motivator Batch"
|
|
app_version: str = "1.0.0"
|
|
debug: bool = True
|
|
|
|
# PostgreSQL 설정
|
|
db_host: str = "localhost"
|
|
db_port: int = 5432
|
|
db_name: str = "healthsync_ai"
|
|
db_username: str = "postgres"
|
|
db_password: str = "password"
|
|
|
|
# Claude AI 설정
|
|
claude_api_key: str = ""
|
|
claude_model: str = "claude-3-5-sonnet-20241022"
|
|
claude_max_tokens: int = 150
|
|
claude_temperature: float = 0.7
|
|
claude_timeout: int = 30
|
|
|
|
# 배치 설정
|
|
batch_size: int = 100
|
|
max_retries: int = 3
|
|
|
|
# 로깅 설정
|
|
log_level: str = "INFO"
|
|
|
|
@property
|
|
def database_url(self) -> str:
|
|
"""데이터베이스 URL 생성"""
|
|
return f"postgresql://{self.db_username}:{self.db_password}@{self.db_host}:{self.db_port}/{self.db_name}"
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
case_sensitive = False
|
|
|
|
# 전역 설정 인스턴스
|
|
settings = Settings() |