feat(chat): add VIDEO_TRANSCRIPT context type for video-grounded chat rooms#45
Open
rivkode wants to merge 1 commit into
Open
feat(chat): add VIDEO_TRANSCRIPT context type for video-grounded chat rooms#45rivkode wants to merge 1 commit into
rivkode wants to merge 1 commit into
Conversation
… rooms
- Add ChatContextType enum (GENERAL, VIDEO_TRANSCRIPT) and JPA
AttributeConverter (autoApply=true)
- ChatRoom gains contextType (NOT NULL, default GENERAL) and nullable
videoId; secondary constructor exposes the new fields with sane defaults
- ChatRoomCommand.Register / ChatRoomDto.RegisterRequest accept
contextType, youtubeVideoId, and an optional explicit name; default
room name is derived from contextType
- ChatRoomInfo exposes contextType and youtubeVideoId
- ChatServiceImpl wires the transcript flow:
- validateChatRoomCommand rejects mismatched contextType/videoId combos
and pre-fetches the transcript on registration
- greeting/generate paths branch on VIDEO_TRANSCRIPT and call the
transcript-aware AiChatService methods with a built prompt context
- Add reference DDL `system/db/migration/202603300001_add_chat_room_context.sql`
- Tests: extend ChatServiceTest with a VIDEO_TRANSCRIPT generateChat
scenario, add ChatRoomContextServiceTest covering validation rules,
extend ChatFixture with contextType/videoId knobs
Depends on:
- PR \"feat(cliplearning): slim payload + transcript endpoint\"
(introduces ClipLearningTranscriptReader and ClipLearningTranscriptInfo)
- PR \"feat(ai): add transcript-aware chat prompts\" (introduces
AiChatService.generateTranscriptChat / greetingTranscriptChat)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
ChatContextTypeenum(GENERAL,VIDEO_TRANSCRIPT) + JPAAttributeConverter(autoApply) 추가ChatRoom엔티티에contextType(NOT NULL, defaultGENERAL)과 nullablevideoId컬럼 추가ChatRoomCommand.Register/ChatRoomDto.RegisterRequest가contextType,youtubeVideoId, optionalname을 받음ChatRoomInfo가contextType/youtubeVideoId노출ChatServiceImplvalidateChatRoomCommand로 mismatch(예:VIDEO_TRANSCRIPT인데youtubeVideoId없음,GENERAL인데youtubeVideoId들어감) 거부generateChat/ greeting 흐름에서VIDEO_TRANSCRIPT이면 transcript 컨텍스트를 빌드해 AI에 전달system/db/migration/202603300001_add_chat_room_context.sql추가ChatServiceTest:VIDEO_TRANSCRIPT채팅방 generateChat 시나리오 추가ChatRoomContextServiceTest: 등록 시 validation 규칙 케이스ChatFixture:contextType/videoId옵션 추가Dependencies
이 PR는 다음 두 PR 머지 후에 머지하는 것을 권장합니다.
ClipLearningTranscriptReader인터페이스 /ClipLearningTranscriptInfo도입AiChatService.generateTranscriptChat/greetingTranscriptChat도입Migration
src/main/resources/db/migration/V7__add_chat_room_context.sql등으로 별도 PR에서 추가 권장 (이번 PR에는 참고 DDL만 포함)Test plan
./gradlew test통과POST /api/v1/chatroomscontextType=VIDEO_TRANSCRIPT+youtubeVideoId전달 시 transcript 사전 검증 성공youtubeVideoId누락 시400 BAD_REQUESTGENERAL인데youtubeVideoId가 들어오면400 BAD_REQUEST🤖 Generated with Claude Code