hgzero/ai-python/app/config.py
Minseo-Jo e9e03e1ff8 Refactor: AI 서비스 Python 구현 및 디렉토리 구조 변경
- ai-python: FastAPI 기반 AI 서비스 구현
  - 실시간 회의 제안 기능 추가
  - Claude API 통합
  - EventHub 및 Redis 연동

- ai-java-back: 기존 Java AI 서비스 백업 디렉토리로 이동
  - Spring Boot 기반 구현 보존

- ai 디렉토리: Java 서비스 파일 삭제 처리

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 10:02:33 +09:00

58 lines
1.7 KiB
Python

"""환경 설정"""
from pydantic_settings import BaseSettings
from functools import lru_cache
from typing import List
class Settings(BaseSettings):
"""환경 설정 클래스"""
# 서버 설정
app_name: str = "AI Service (Python)"
host: str = "0.0.0.0"
port: int = 8087
# Claude API
claude_api_key: str = "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"
claude_model: str = "claude-sonnet-4-5-20250929"
claude_max_tokens: int = 4096
claude_temperature: float = 0.7
# Redis
redis_host: str = "20.249.177.114"
redis_port: int = 6379
redis_password: str = ""
redis_db: int = 4
# Azure Event Hub
eventhub_connection_string: str = "Endpoint=sb://hgzero-eventhub-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=VUqZ9vFgu35E3c6RiUzoOGVUP8IZpFvlV+AEhC6sUpo="
eventhub_name: str = "hgzero-eventhub-name"
eventhub_consumer_group: str = "ai-transcript-group"
# CORS
cors_origins: List[str] = [
"http://localhost:8888",
"http://localhost:8080",
"http://localhost:3000",
"http://127.0.0.1:8888",
"http://127.0.0.1:8080",
"http://127.0.0.1:3000"
]
# 로깅
log_level: str = "INFO"
# 분석 임계값 (충분한 맥락 확보)
min_segments_for_analysis: int = 4 # 4개 세그먼트 (약 60초, 제안사항 추출에 충분한 맥락)
text_retention_seconds: int = 300 # 5분
class Config:
env_file = ".env"
case_sensitive = False
@lru_cache()
def get_settings() -> Settings:
"""싱글톤 설정 인스턴스"""
return Settings()