[고객지원 챗봇 만들기] 신관규 제출합니다.#5
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements a RAG-based chatbot system using Spring AI, featuring custom document readers for FAQ, policies, and chat logs, a vector store for context retrieval, and a chat service for processing queries. It also includes an evaluation framework and documentation on performance optimizations. Review feedback focuses on improving error handling in document readers by providing descriptive exception messages and adding null safety checks when processing AI model responses to prevent potential runtime errors.
| Usage usage = chatResponse.getMetadata().getUsage(); | ||
|
|
||
| return QuestionAskResponse.from( | ||
| chatResponse.getResult().getOutput().getText(), | ||
| usage.getPromptTokens(), | ||
| usage.getCompletionTokens(), | ||
| usage.getTotalTokens() | ||
| ); |
There was a problem hiding this comment.
chatResponse.getMetadata().getUsage() 및 chatResponse.getResult()가 null을 반환할 가능성이 있습니다. 특히 모델 응답이 차단되거나 특정 오류 상황에서 메타데이터가 누락될 수 있으므로, 이에 대한 방어적인 널 체크(null check) 로직을 추가하는 것을 권장합니다.
Usage usage = chatResponse.getMetadata().getUsage();
String answer = chatResponse.getResult() != null ? chatResponse.getResult().getOutput().getText() : "";
return QuestionAskResponse.from(
answer,
usage != null ? usage.getPromptTokens() : 0,
usage != null ? usage.getCompletionTokens() : 0,
usage != null ? usage.getTotalTokens() : 0
);Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…java Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
구현 내용
챗봇 플로우는 다음과 같습니다.
FaqReader, CurrentPolicyReader, InternalPolicy, ChatlogReader클래스에서 대응되는 데이터 레이어를 읽어Document로 변환합니다.Document를 조회합니다.학습 내용
학습 내용은 아래 노션 페이지와
wall-report.md에 정리했습니다.