[MM-175] AI 채팅 메시지를 스트리밍 이후 분할하여 저장 #115
Merged
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.
#️⃣ 연관된 이슈
📝 작업 내용
Changed
fullAnswer를 문장부호(. ! ?) 기준으로 분할하여 세 문장씩 그룹화한 후 각각을ChatMessage로 저장하도록 변경ai_response_id이벤트의 payload가 단일Long에서List<Long>으로 변경됨Added
ChatMessageSplitter유틸 클래스: 문장부호 기준 분할 및 세 문장 그룹화 기능SaveChatMessagePort.saveChatMessages(): ChatMessage bulk 저장 메서드ChatSseSender.sendAiResponseIds(): 다건 messageId 전송 메서드Breaking Changes
ai_response_idSSE 이벤트를 수신하는 클라이언트는 payload를List<Long>으로 파싱하도록 수정해야 함{ "event": "ai_response_id", "data": 123 }{ "event": "ai_response_id", "data": [123, 124, 125] }Side Effects
ChatMessage로 분할되어 저장됨ChatMessage로 저장됨 (기존 동작 유지)Technical Details
ChatMessage로 그룹화 (예: 10문장 → 4개 ChatMessage)saveAll사용)sendAiResponseId(Long)메서드는 유지되어 다른 코드에 영향 없음