mirror of
https://github.com/hwanny1128/HGZero.git
synced 2026-06-13 05:59:11 +00:00
Feat: AI 서비스 및 STT 서비스 기능 개선
- AI 서비스: Redis 캐싱 및 EventHub 통합 개선 - STT 서비스: 오디오 버퍼링 및 변환 기능 추가 - 설정 파일 업데이트 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -116,21 +116,45 @@ async def stream_ai_suggestions(meeting_id: str):
|
||||
if accumulated_text:
|
||||
logger.info(f"텍스트 누적 완료 - meetingId: {meeting_id}, 길이: {len(accumulated_text)}")
|
||||
|
||||
# 이미 생성된 제안사항 조회
|
||||
existing_suggestions = await redis_service.get_generated_suggestions(meeting_id)
|
||||
|
||||
# Claude API로 분석
|
||||
suggestions = await claude_service.analyze_suggestions(accumulated_text)
|
||||
|
||||
if suggestions.suggestions:
|
||||
# SSE 이벤트 전송
|
||||
yield {
|
||||
"event": "ai-suggestion",
|
||||
"id": str(current_count),
|
||||
"data": suggestions.json()
|
||||
}
|
||||
# 중복 제거: 새로운 제안사항만 필터링
|
||||
new_suggestions = [
|
||||
s for s in suggestions.suggestions
|
||||
if s.content not in existing_suggestions
|
||||
]
|
||||
|
||||
logger.info(
|
||||
f"AI 제안사항 발행 - meetingId: {meeting_id}, "
|
||||
f"개수: {len(suggestions.suggestions)}"
|
||||
)
|
||||
if new_suggestions:
|
||||
# 새로운 제안사항만 SSE 이벤트 전송
|
||||
from app.models import RealtimeSuggestionsResponse
|
||||
filtered_response = RealtimeSuggestionsResponse(suggestions=new_suggestions)
|
||||
|
||||
yield {
|
||||
"event": "ai-suggestion",
|
||||
"id": str(current_count),
|
||||
"data": filtered_response.json()
|
||||
}
|
||||
|
||||
# Redis에 새로운 제안사항 저장
|
||||
for suggestion in new_suggestions:
|
||||
await redis_service.add_generated_suggestion(
|
||||
meeting_id,
|
||||
suggestion.content
|
||||
)
|
||||
|
||||
logger.info(
|
||||
f"AI 제안사항 발행 - meetingId: {meeting_id}, "
|
||||
f"전체: {len(suggestions.suggestions)}, 신규: {len(new_suggestions)}"
|
||||
)
|
||||
else:
|
||||
logger.info(
|
||||
f"중복 제거 후 신규 제안사항 없음 - meetingId: {meeting_id}"
|
||||
)
|
||||
|
||||
previous_count = current_count
|
||||
|
||||
@@ -160,8 +184,6 @@ async def stream_ai_suggestions(meeting_id: str):
|
||||
headers={
|
||||
"Cache-Control": "no-cache",
|
||||
"X-Accel-Buffering": "no",
|
||||
"Access-Control-Allow-Origin": "http://localhost:8888",
|
||||
"Access-Control-Allow-Credentials": "true",
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user