hgzero/ai-python/app/api/v1/transcripts.py
Minseo-Jo 143721d106 feat: Meeting Service AI 통합 개발
 구현 완료
- AI Python Service (FastAPI, Claude API, 8087 포트)
  - POST /api/v1/transcripts/consolidate
  - 참석자별 회의록 → AI 통합 분석
  - 키워드/안건별 요약/Todo 추출

- Meeting Service AI 통합
  - EndMeetingService (@Primary)
  - AIServiceClient (RestTemplate, 30초 timeout)
  - AI 분석 결과 저장 (meeting_analysis, todos)
  - 회의 상태 COMPLETED 처리

- DTO 구조 (간소화)
  - ConsolidateRequest/Response
  - MeetingEndDTO
  - Todo 제목만 포함 (담당자/마감일 제거)

📝 기술스택
- Python: FastAPI, anthropic 0.71.0, psycopg2
- Java: Spring Boot, RestTemplate
- Claude: claude-3-5-sonnet-20241022

🔧 주요 이슈 해결
- 포트 충돌: 8086(feature/stt-ai) → 8087(feat/meeting-ai)
- Bean 충돌: @Primary 추가
- YAML 문법: ai.service.url 구조 수정
- anthropic 라이브러리 업그레이드

📚 테스트 가이드 및 스크립트 작성
- claude/MEETING-AI-TEST-GUIDE.md
- test-meeting-ai.sh

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 16:42:09 +09:00

54 lines
1.8 KiB
Python

"""Transcripts API Router"""
from fastapi import APIRouter, HTTPException, status
import logging
from app.models.transcript import ConsolidateRequest, ConsolidateResponse
from app.services.transcript_service import transcript_service
logger = logging.getLogger(__name__)
router = APIRouter()
@router.post("/consolidate", response_model=ConsolidateResponse, status_code=status.HTTP_200_OK)
async def consolidate_minutes(request: ConsolidateRequest):
"""
회의록 통합 요약
참석자별로 작성한 회의록을 AI가 통합하여 요약합니다.
- **meeting_id**: 회의 ID
- **participant_minutes**: 참석자별 회의록 목록
- **agendas**: 안건 목록 (선택)
- **duration_minutes**: 회의 시간(분) (선택)
Returns:
- 통합 요약, 키워드, 안건별 분석, Todo 자동 추출
"""
try:
logger.info(f"POST /transcripts/consolidate - Meeting ID: {request.meeting_id}")
# 입력 검증
if not request.participant_minutes:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail="참석자 회의록이 비어있습니다"
)
# 회의록 통합 처리
response = await transcript_service.consolidate_minutes(request)
return response
except ValueError as e:
logger.error(f"입력 값 오류: {e}")
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=str(e)
)
except Exception as e:
logger.error(f"회의록 통합 실패: {e}", exc_info=True)
raise HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
detail=f"회의록 통합 처리 중 오류가 발생했습니다: {str(e)}"
)