feat: 면접 꼬리질문 토큰 스트리밍 + 문장 단위 TTS (체감 반응 속도 개선)#95
Merged
Conversation
followup 출력을 <intent>/<question>/<meta> 구분자 포맷으로 바꾸고, astream 으로 질문 토큰만 SessionRealtimeNotifier 를 통해 stackup.realtime 로 직접 발행(Core 우회). DONT_KNOW 면 델타 미발행. 종료 후 parse_followup_result 로 검증해 기존 callback.questions(FOLLOWUP, followupMessageId) 유지. runner 에 스트리밍 생성기+세션 notifier 와이어링.
답변 직후 INTERVIEWER placeholder((생성 중), CREATED) 선INSERT + SESSION_MESSAGE 발행 + generate.followup 에 followupMessageId 동봉. 콜백 분기: NORMAL→completeFollowup UPDATE+카운트, CLARIFICATION→UPDATE(카운트 X), DONT_KNOW→placeholder DELETE 후 advanceToNextGeneral. placeholder 없으면 레거시 INSERT 폴백.
SESSION_MESSAGE_DELTA 를 messageId별 버퍼에 누적해 placeholder 버블 content 를 실시간 덮어 렌더. sentinel((생성 중)) 인지 currentTurn 으로 '생각 중→텍스트 차오름' 전환. questionStreaming 으로 입력은 허용·제출만 잠금(AnswerComposer submitLocked). sentinel 상수는 domain/session 단일 출처.
event-stream.md 에 SESSION_MESSAGE_DELTA(휘발성, AI 직접 발행) 카탈로그, messaging.md 에 followupMessageId 필드 + realtime.session.notify 델타 발행 경로, ai/backend CLAUDE.md 현재 상태 갱신.
스트림 루프에서 next_sentences 로 문장 경계 감지 → 문장별 TtsProvider 인라인 합성(asyncio.create_task 백그라운드, 텍스트 델타 비차단) → S3 interview/tts/{sid}/{mid}/seg-{seq}.{ext} PUT → SessionRealtimeNotifier.emit_audio(SESSION_MESSAGE_AUDIO). 콜백 전 gather 로 수거. 라이브 세그먼트는 휘발성.
GET /api/sessions/{sid}/messages/{mid}/audio/segments/{seq}?ext= 신설. AI 가 휘발성으로 쓴 세그먼트를 규칙(interview/tts/{sid}/{mid}/seg-{seq}.{ext})으로 재구성해 프록시(DB 미기록). 소유권+ext 화이트리스트(wav/mp3/ogg/m4a)+seq>=0 검증.
SESSION_MESSAGE_AUDIO 수신 → 인증 fetch→objectURL 로 받아 segmentAudioQueue 로 seq 순차 재생(메시지 전환 시 reset). 라이브 세그먼트가 재생된 질문은 whole-message TTS autoPlay 억제(중복 방지), 수동 다시 듣기는 유지.
event-stream.md SESSION_MESSAGE_AUDIO 카탈로그, messaging.md 세그먼트 발행+프록시, storage.md 세그먼트 키 규칙(AI·Core SSOT), ai/backend CLAUDE.md 현재 상태.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
꼬리질문을 ChatGPT처럼 토큰 단위로 즉시 흘리고, 문장이 완성될 때마다 그 문장만 TTS 합성해 재생. LLM 전체 응답을 기다리던 .ainvoke() 배치 경로를 제거.