Files
site11/backup-services/google-search/backend/app/config.py
2025-09-28 20:41:57 +09:00

30 lines
737 B
Python

from pydantic_settings import BaseSettings
from typing import Optional
class Settings(BaseSettings):
# Google Custom Search API 설정
google_api_key: Optional[str] = None
google_search_engine_id: Optional[str] = None
# SerpAPI 설정 (대안)
serpapi_key: Optional[str] = None
# Redis 캐싱 설정
redis_host: str = "redis"
redis_port: int = 6379
redis_db: int = 2
cache_ttl: int = 3600 # 1시간
# 검색 설정
max_results: int = 10
default_language: str = "ko"
default_country: str = "kr"
# 서비스 설정
service_name: str = "Google Search Service"
debug: bool = True
class Config:
env_file = ".env"
settings = Settings()