-
Notifications
You must be signed in to change notification settings - Fork 1
Feature(#71) feat: 채팅 프롬프트 수정 #72
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
This reverts commit 0667bd5.
Walkthrough문서의 출력 태그 설명에 별칭이 추가되었고, 채팅 어시스턴트 프롬프트가 대규모로 재구성되었습니다. 기존 Role 중심 구조가 Persona/WorldBuilding/BackgroundStory로 전환되었고, 다수의 가이드 블록이 제거되었으며 Format은 고정된 JSON 스키마로 강화되었습니다. 코드 로직 변경은 없습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant User as 사용자
participant ChatApp as 채팅 엔진
participant Prompt as 프롬프트(Persona/WorldBuilding/Format)
participant LLM as 모델
User->>ChatApp: 사용자 메시지 전송
ChatApp->>Prompt: Persona/WorldBuilding/Context 로드
ChatApp->>LLM: 구성된 프롬프트 + 사용자 메시지
LLM-->>ChatApp: 고정된 JSON 형식 응답
ChatApp-->>User: 응답(message 필드) 전달
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Possibly related PRs
Suggested reviewers
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. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
prompts/READMD.md (1)
1-1: 파일명 오타: READMD.md → README.md로 변경 필요표준 파일명(README.md)이 아닙니다. 레포 탐색성, 자동 링크(예: GitHub UI) 및 외부 툴 호환성에 영향이 있습니다. 파일명을 수정해주세요.
🧹 Nitpick comments (3)
src/main/resources/prompts/chat-assistant.txt (3)
5-5: 말투 규칙의 절대성 완화(상황/요청 기반 전환 허용)“존댓말 절대 사용 안 함”은 사용자 요청/컨텍스트 변화에 대응 불가합니다. 기본은 반말을 유지하되, 명시 요청 시 존댓말 전환을 허용하도록 완화를 권장합니다.
적용 예시:
-말투: 항상 반말을 사용하며, 친구처럼 편안하게 대화함 (존댓말 절대 사용 안 함) +말투: 기본은 반말로, 친구처럼 편안하게 대화함. 단, 사용자가 명시적으로 요청하거나 컨텍스트상 필요한 경우 존댓말로 전환.
31-33: 컨텍스트 가정(이미 자기소개 완료) 조건부 처리 권장세션 재시작/신규 사용자 유입 시 해당 가정이 깨질 수 있습니다. “미완료 시 1문장 수준의 자연스러운 자기소개” 규칙을 추가해 견고성을 높이세요.
적용 예시:
<Context> -화자와는 이미 자기소개를 했기 때문에 서로 알고 있는 상황 +화자와는 이미 자기소개를 했기 때문에 서로 알고 있는 상황. +단, 대화 맥락상 자기소개가 없었다면 1문장으로 짧게 자연스러운 자기소개 후 본론으로 이어가기. </Context>
58-66: 안전성 최소 가이드라인 보강(선택)SafetyProtocol 제거로 민감 주제 대응이 전적으로 모델/상위 레이어에 의존합니다. 간단한 한 줄 수칙을 포맷 하단에 추가하면 리스크를 낮출 수 있습니다.
추가 제안:
</Format> + +<Note> +민감한 주제(자해·자살·학대·의료·법률 등)에는 감정적 지지와 함께 전문 도움(상담/긴급지원) 안내를 덧붙이고, 진단·법률 자문으로 오인될 수 있는 단정은 피한다. +</Note>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
prompts/READMD.md(1 hunks)src/main/resources/prompts/chat-assistant.txt(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: pythonstrup
PR: Nexters/team-ace-backend#56
File: src/main/java/com/nexters/teamace/chat/application/ChatRoomService.java:54-59
Timestamp: 2025-08-06T14:49:03.348Z
Learning: pythonstrup prefers using HTTP 403 Forbidden over 404 Not Found for authorization failures in the chat room access control logic.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (2)
prompts/READMD.md (1)
13-13: 별칭 처리 로직 확인 필요
문서에<Format>의 별칭으로<Output>을 허용한다고 되어 있으나, 코드베이스상 파서나 태그 처리 로직에서<Output>을 인식·처리하는 부분을 찾지 못했습니다.
아래 항목을 중점적으로 확인해주세요:
- 태그 파싱/전처리 유틸리티 (예: TagParser, TemplateEngine 등)
- 태그 enum 또는 상수 정의 파일
<Output>이<Format>과 매핑되는 alias 설정 여부src/main/resources/prompts/chat-assistant.txt (1)
1-11: 페르소나/세계관 기반 재구성이 톤앤매너 일관성에 유익Role 중심 구조에서 Persona로 전환하고 세계관을 추가한 점은 대화 스타일의 안정성과 몰입감 향상에 도움이 됩니다. 유지 추천합니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
src/main/resources/prompts/chat-assistant.txt (1)
59-67: JSON 코드블록 제거 및 ‘순수 JSON만’ 출력으로 변경, UT 구조 규칙 추가현재 예시가 코드블록(백틱)으로 제공되어 모델이 그대로 백틱을 출력할 위험이 큽니다. 백엔드가 코드블록 제거/정규화 없이 곧장 파싱한다면 런타임 오류로 이어질 수 있습니다. 또한 UT 기대(공감→감정/원인 추정→선택지/관점 확장, 키워드 재사용)를 구조적으로 강제하는 규칙이 누락되어 있습니다.
권장 수정:
-<Format> -응답은 다음 JSON 형식으로 제공해주세요: - -```json -{ - "message": "감정 요정으로서 자연스럽고 따뜻한 대화 응답" -} -``` -</Format> +<Format> +출력은 "순수 JSON만"이어야 해. (코드블록/백틱/주석/설명 금지) +형식: {"message":"..."} 한 개의 JSON 객체만 출력. +작성 규칙: +- 1) 공감 1문장 → +- 2) 감정/가능한 원인 추정 1문장 → +- 3) 선택지형 질문 2~3개 또는 관점 확장형 질문 1개 포함 → +- 4) 사용자 발화의 핵심 키워드 1~2개를 그대로 인용(“”로 감싸기) → +- 5) 총 2~5문장, 한국어, 반말 유지 +- 6) 세계관·설정은 메타 맥락일 뿐, 메시지에 직접 노출하지 않음(사용자가 요청한 경우만 예외) +- 7) 의료/법률/위기 상황에 대한 조언은 금지. 자/타해 위험 신호 감지 시 전문기관·긴급전화(예: 112/119 등) 안내 문장을 포함. +</Format>백엔드 파서가 코드블록/백틱 제거를 수행하는지 확인해 주세요. 아래 스크립트는 해당 로직 유무를 탐색합니다.
#!/bin/bash set -euo pipefail echo "1) 프롬프트 파일 로딩/사용 위치 탐색" rg -n -C3 -P 'chat-assistant\.txt|ClassPathResource|ResourceLoader|Files\.readString' src || true echo echo "2) 모델 응답 파싱 로직에서 백틱/코드블록 제거 유무 탐색" rg -n -C3 -P 'ObjectMapper|readTree|fromJson|parse|replace\(|strip\(|sanitize|```|backtick|code\s*fence' src || true
🧹 Nitpick comments (3)
src/main/resources/prompts/chat-assistant.txt (3)
5-5: 말투 고정(반말만) 규칙, 사용자 미러링 허용 여지 제안존댓말 완전 금지보다 “사용자 말투 미러링(필요 시만)”을 허용하면 사용자 경험이 개선됩니다. 기본은 반말 유지하되, 상대가 일관되게 존댓말이면 약하게 상향 조정하도록 제안합니다.
다음처럼 완화해보세요:
-말투: 항상 반말을 사용하며, 친구처럼 편안하게 대화함 (존댓말 절대 사용 안 함) +말투: 기본은 반말, 친구처럼 편안하게 대화. 단, 사용자가 일관되게 존댓말을 쓸 때는 예의를 지켜 말투를 가볍게 상향 조정(너무 딱딱하지 않게).
13-29: BackgroundStory 축약 제안 — 토큰 예산 절약 및 응답 집중도 향상서사가 아름답지만 길이가 길어 모델의 작업 메모리를 잡아먹고 응답 품질에 영향을 줄 수 있습니다(PR 설명의 고려사항과도 부합). 핵심 메시지만 남기고 나머지는 별첨/주석 처리 혹은 주석 태그로 이동을 권장합니다.
예시(요지 압축):
-요정여왕은 ... (여러 단락) +요정여왕은 감정이 살아있는 이모티아의 수호자다. 모든 감정은 동등한 가치를 지니며, 인간과 이모티아의 다리 역할을 한다. 길 잃은 마음에 친구처럼 다가가 이야기를 듣고 균형을 돕는다.
36-57: 세계관은 출력에 직접 드러내지 않기 — 롤플레이 누출 방지세계관은 내적 맥락으로 훌륭하지만, 메시지에 직접 드러나면 상담적 흐름이 깨질 수 있습니다. “요정여왕/이모티아”가 응답 텍스트에 튀어나오지 않도록 제약을 명시하세요.
블록 하단에 메모를 추가:
- 모든 존재와 동등한 위치에서 함께하는 친구 +- 출력 제약: 본 설정은 내적 맥락용이며, 사용자에게 보내는 message에는 세계관·직함·지명 등을 직접 서술하지 않음(사용자가 명시적으로 요청한 경우만 예외) </WorldBuilding>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
src/main/resources/prompts/chat-assistant.txt(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: pythonstrup
PR: Nexters/team-ace-backend#56
File: src/main/java/com/nexters/teamace/chat/application/ChatRoomService.java:54-59
Timestamp: 2025-08-06T14:49:03.348Z
Learning: pythonstrup prefers using HTTP 403 Forbidden over 404 Not Found for authorization failures in the chat room access control logic.
🔇 Additional comments (1)
src/main/resources/prompts/chat-assistant.txt (1)
1-4: 페르소나 전환 LGTM — 톤·캐릭터가 명확해졌습니다.요정 여왕 페르소나 정의가 간결하고 일관되며, 대화 톤을 안정적으로 고정하는 데 도움이 됩니다. PR 목표(자연스러운 대화, 세계관 기반 일관성)와 잘 맞습니다.
hyh1016
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
호 프롬프트 방향을 완전 바꿨구만 대화 포맷을 지정하기보다는 Role 설정에 좀 더 집중한 느낌이네
뭐가 더 잘 나오는지는 이것저것 테스트 해보고 고도화 하는 걸로~~
📌 관련 이슈
closes #71
📝 작업 개요
✅ 작업 사항
💭 고민한 점들
Summary by CodeRabbit
New Features
Refactor
Documentation