mirror of
https://github.com/hwanny1128/HGZero.git
synced 2026-06-13 04:49:11 +00:00
AI 제안사항 추출 기능 개선 및 API 경로 수정
- ClaudeService에 analyze_suggestions 메서드 추가 - 개선된 제안사항 추출 프롬프트 생성 (구체적이고 실행 가능한 제안사항) - API 경로 수정: /api/v1/ai/suggestions → /api/ai/suggestions - 프론트엔드 HTML API 경로 업데이트 (v1 제거) - RealtimeSuggestionsResponse 모델 export 추가 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -85,6 +85,55 @@ class ClaudeService:
|
||||
logger.error(f"Claude API 호출 실패: {e}")
|
||||
raise
|
||||
|
||||
async def analyze_suggestions(self, transcript_text: str):
|
||||
"""
|
||||
회의 텍스트에서 AI 제안사항 추출
|
||||
|
||||
Args:
|
||||
transcript_text: 회의 텍스트
|
||||
|
||||
Returns:
|
||||
RealtimeSuggestionsResponse 객체
|
||||
"""
|
||||
from app.models import RealtimeSuggestionsResponse, SimpleSuggestion
|
||||
from app.prompts.suggestions_prompt import get_suggestions_prompt
|
||||
from datetime import datetime
|
||||
import uuid
|
||||
|
||||
try:
|
||||
# 프롬프트 생성
|
||||
system_prompt, user_prompt = get_suggestions_prompt(transcript_text)
|
||||
|
||||
# Claude API 호출
|
||||
result = await self.generate_completion(
|
||||
prompt=user_prompt,
|
||||
system_prompt=system_prompt
|
||||
)
|
||||
|
||||
# 응답 파싱
|
||||
suggestions_data = result.get("suggestions", [])
|
||||
|
||||
# SimpleSuggestion 객체로 변환
|
||||
suggestions = [
|
||||
SimpleSuggestion(
|
||||
id=str(uuid.uuid4()),
|
||||
content=s["content"],
|
||||
timestamp=datetime.now().strftime("%H:%M:%S"),
|
||||
confidence=s.get("confidence", 0.85)
|
||||
)
|
||||
for s in suggestions_data
|
||||
if s.get("confidence", 0) >= 0.7 # 신뢰도 0.7 이상만
|
||||
]
|
||||
|
||||
logger.info(f"AI 제안사항 {len(suggestions)}개 추출 완료")
|
||||
|
||||
return RealtimeSuggestionsResponse(suggestions=suggestions)
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"제안사항 분석 실패: {e}", exc_info=True)
|
||||
# 빈 응답 반환
|
||||
return RealtimeSuggestionsResponse(suggestions=[])
|
||||
|
||||
|
||||
# 싱글톤 인스턴스
|
||||
claude_service = ClaudeService()
|
||||
|
||||
Reference in New Issue
Block a user