mirror of
https://github.com/hwanny1128/HGZero.git
synced 2025-12-06 07:56:24 +00:00
**문제점**: - AI가 회의 내용에 없는 제안사항을 생성 (Hallucination) - 프롬프트의 예시를 실제 회의 내용으로 혼동 - 제안사항 추출 개수가 적음 **해결 방안**: 1. 프롬프트 구조 재설계 - 500+ 줄 예시 → 90줄 핵심 지침으로 간소화 - system_prompt에 패턴만 정의 - user_prompt는 실제 회의 내용만 포함 - "오직 제공된 회의 내용만 분석" 명령 4번 반복 강조 2. Hallucination 방지 장치 - "추측, 가정, 예시 내용 절대 금지" - "불확실한 내용은 추출하지 않기" - 회의 내용과 분석 지침을 시각적으로 분리 (━ 구분선) 3. 추출 개선 - max_tokens: 4096 → 8192 (2배 증가) - confidence 임계값: 0.7 → 0.65 (완화) - 새 카테고리 추가: 🔔 후속조치 - 패턴 인식 확장 (제안/진행상황/액션 아이템) **변경 파일**: - ai-python/app/prompts/suggestions_prompt.py (대폭 간소화) - ai-python/app/config.py (max_tokens 증가) - ai-python/app/services/claude_service.py (confidence 임계값 완화) **예상 효과**: - Hallucination 90% 이상 감소 - 제안사항 추출 개수 30-50% 증가 - 품질 유지 (신뢰도 필터링 유지) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
59 lines
1.8 KiB
Python
59 lines
1.8 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 = 8192 # 4096 → 8192 증가 (더 많은 제안사항 생성 가능)
|
|
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",
|
|
"http://localhost:*" # 모든 localhost 포트 허용
|
|
]
|
|
|
|
# 로깅
|
|
log_level: str = "INFO"
|
|
|
|
# 분석 임계값 (실시간 응답을 위해 낮춤)
|
|
min_segments_for_analysis: int = 2 # 2개 세그먼트 (약 30초, 빠른 피드백)
|
|
text_retention_seconds: int = 300 # 5분
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
case_sensitive = False
|
|
|
|
|
|
@lru_cache()
|
|
def get_settings() -> Settings:
|
|
"""싱글톤 설정 인스턴스"""
|
|
return Settings()
|