-
Notifications
You must be signed in to change notification settings - Fork 1
챗봇 기능 구현 #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- 채팅 요청 스펙 변경 -> 요청 시 body에 type 넣지 않도록 변경 - '/'로 시작 시 챗봇 기능 작동 - openAi service 코드 작성( openai api 호출 ) - redis에 프롬프트 메시지 캐싱
Walkthrough애플리케이션 시작 시 기본 타임존을 Asia/Seoul로 설정. 채팅 REST API가 응답 DTO를 반환하도록 변경되고, 메시지 앞의 “/”로 BOT 여부를 판별. OpenAI 연동을 WebClient 기반 OpenAiService로 도입하며 기존 ChatGPTService와 ChatRequest 삭제. 채팅 히스토리를 CHAT 타입으로 필터링. WebSocket 허용 오리진 확장 및 로깅 정비. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client as REST Client
participant Controller as ChatRestController
participant Service as ChatMongoService
participant Repo as ChatMongoRepository
participant Redis as Redis(Pub/Sub)
participant OpenAI as OpenAiService
Client->>Controller: POST /api/chat/send (ChatMessageSendDTO)
Controller->>Service: saveAndPublish(dto)
Service->>Service: 메시지 타입 판별 ("/" ⇒ BOT, else ⇒ CHAT)
Service->>Repo: save(ChatMessage)
Repo-->>Service: 저장됨
alt CHAT 메시지
Service->>Redis: publish(ChatMessageReceiveDTO)
Service-->>Controller: ChatMessageReceiveDTO(사용자 메시지)
else BOT 메시지
Service->>OpenAI: chatToOpenAI(query)
OpenAI-->>Service: 답변 문자열
Service-->>Controller: ChatMessageReceiveDTO(챗봇 응답, name="챗봇", userId=-1)
end
Controller-->>Client: ApiResponse<ChatMessageReceiveDTO>
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (14)
💤 Files with no reviewable changes (3)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
챗봇 기능 구현
채팅 조회
Summary by CodeRabbit