[고객지원 챗봇 만들기] 이영수 제출합니다#6
Conversation
- DTO 및 Controller 선언 - 서비스 로직은 TODO
- 개발 편의성 위한 lombok 추가 - local profile 용 gitignore 추가
- spring ai 통한 기능 구현
- requirements 파일 추가
- litellm github 기반 비용 JSON 로드해서 사용 - spring ai 표준 기반 처리(캐시 비용 처리X)
- 시스템 프롬프트 + layer1, layer2 데이터 주입 - 진행 결과 progress md 로 정리
- 정확도 다소 상승(Easy 는 일정치 도달)
- SimpleVectorStore 통한 로컬 세팅
- chunk 400 + temperature 0.2 로 설정
- 도메인 숫자 및 정책에 대해 검증하는 스크립트 추가 - 이를 통한 관련 내용 progress.md 에 작성
There was a problem hiding this comment.
Code Review
This pull request introduces a Retrieval-Augmented Generation (RAG) system for a FAQ chatbot, including vector store configuration, pricing calculation logic, and evaluation scripts. Key changes include the addition of VectorStoreConfig for document indexing, FrequentlyQuestionChatApiService for handling RAG-based queries, and a new strict_evaluate.py script for deterministic evaluation using regex patterns. Feedback focuses on several implementation issues: loaded knowledge base resources are currently missing from the system prompt in ChatClientConfig, an unnecessary argument is passed to the prompt() method in the chat service, and excessive logging of document chunks during startup should be reduced. Additionally, the evaluation script's default server URL port should be updated to match the standard application port.
| var faq = concatResources(faqResources, "faq"); | ||
| var policies = concatResources(policyResources, "policies"); | ||
| var examples = concatResources(exampleResources, "examples"); |
There was a problem hiding this comment.
| .map(d -> "## " + d.getMetadata().get("source") + "\n" + d.getText()) | ||
| .collect(Collectors.joining("\n\n---\n\n")); | ||
|
|
||
| var response = chatClient.prompt(context) |
There was a problem hiding this comment.
| chunks.forEach(chunk -> { | ||
| if (chunk.getText() != null) { | ||
| log.info("chunk ID: {}, TEXT: {}", chunk.getId(), | ||
| chunk.getText().substring(0, Math.min(80, chunk.getText().length())).replace("\n", " ")); | ||
| } | ||
| }); |
| import requests | ||
|
|
||
| DATA_DIR = Path(__file__).parent | ||
| SERVER_URL = "http://localhost:11240/api/chat" |
챗봇 구현후 제출합니다!
정확도를 어렵지 않게 개선할 수 있을거라 생각했는데 생각보다 어렵네요..
코드 퀄리티나 객체지향적은 크게 고려하지 않고, 외적인 부분들에 관심이 가서 접근해봤습니다.
질문
LLM 이 LLM 응답을 다시 평가하게 한 내용이 궁금합니다!평소에, 아직까지 LLM 은 80% 정도의 퀄리티를 응답해준다고 생각합니다.
80%의 응답을 80%로 평가해주면 60% 의 퀄리티에 기대를 할 거 같은데 제가 RAG 나 더 정교한 방법을 몰라서 그런건지 궁금합니다.
제가 생각한 해당 챗봇에게 기대한 것은 상담원의 업무 완화였습니다.
그러기 위해선,
숫자에 대해선 틀리지 않는 정확한 응답+거짓 응답을 하지 않는걸 생각했습니다.코치님들이 생각하는 챗봇의 목적이나 기대치가 궁금합니다!
오랜만에 미션 하는거 같아서 재밌었습니다🙇♂️