mirror of
https://github.com/hwanny1128/HGZero.git
synced 2026-06-12 22:59:10 +00:00
STT 서비스 음성 인식 및 AI 제안사항 표시 기능 구현
- PCM 16kHz 포맷 지원으로 Azure Speech 인식 성공 - WebSocket 실시간 전송 기능 추가 - DB 저장 로직 제거 (AI 서비스에서 제안사항 저장) - AI SSE 기반 제안사항 표시 테스트 페이지 추가 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,6 @@ import asyncio
|
||||
import logging
|
||||
import json
|
||||
from azure.eventhub.aio import EventHubConsumerClient
|
||||
from azure.eventhub.extensions.checkpointstoreblobaio import BlobCheckpointStore
|
||||
|
||||
from app.config import get_settings
|
||||
from app.services.redis_service import RedisService
|
||||
@@ -87,8 +86,8 @@ class EventHubService:
|
||||
|
||||
logger.debug(f"Redis 저장 완료 - meetingId: {meeting_id}")
|
||||
|
||||
# 체크포인트 업데이트
|
||||
await partition_context.update_checkpoint(event)
|
||||
# MVP 개발: checkpoint 업데이트 제거 (InMemory 모드)
|
||||
# await partition_context.update_checkpoint(event)
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"이벤트 처리 오류: {e}", exc_info=True)
|
||||
|
||||
+8
-5
@@ -1,5 +1,6 @@
|
||||
"""AI Service - FastAPI 애플리케이션"""
|
||||
import logging
|
||||
import asyncio
|
||||
import uvicorn
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
@@ -7,6 +8,7 @@ from contextlib import asynccontextmanager
|
||||
|
||||
from app.config import get_settings
|
||||
from app.api.v1 import suggestions
|
||||
from app.services.eventhub_service import start_eventhub_listener
|
||||
|
||||
# 로깅 설정
|
||||
logging.basicConfig(
|
||||
@@ -27,8 +29,9 @@ async def lifespan(app: FastAPI):
|
||||
logger.info(f"Redis: {settings.redis_host}:{settings.redis_port}")
|
||||
logger.info("=" * 60)
|
||||
|
||||
# TODO: Event Hub 리스너 시작 (별도 백그라운드 태스크)
|
||||
# asyncio.create_task(start_eventhub_listener())
|
||||
# Event Hub 리스너 시작 (백그라운드 태스크)
|
||||
logger.info("Event Hub 리스너 백그라운드 시작...")
|
||||
asyncio.create_task(start_eventhub_listener())
|
||||
|
||||
yield
|
||||
|
||||
@@ -43,11 +46,11 @@ app = FastAPI(
|
||||
lifespan=lifespan
|
||||
)
|
||||
|
||||
# CORS 설정
|
||||
# CORS 설정 (개발 환경: 모든 origin 허용)
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=settings.cors_origins,
|
||||
allow_credentials=True,
|
||||
allow_origins=["*"], # 개발 환경에서 모든 origin 허용
|
||||
allow_credentials=False, # allow_origins=["*"]일 때는 False여야 함
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user