Skip to content

[refactor] AI 프롬프트 튜닝#1140

Merged
lepitaaar merged 1 commit intodevelop/befrom
refactor/#1139-ai-prompt-tuning-MOA-601
Feb 8, 2026
Merged

[refactor] AI 프롬프트 튜닝#1140
lepitaaar merged 1 commit intodevelop/befrom
refactor/#1139-ai-prompt-tuning-MOA-601

Conversation

@lepitaaar
Copy link
Contributor

@lepitaaar lepitaaar commented Feb 4, 2026

#️⃣연관된 이슈

#1139

📝작업 내용

AI 프롬프트와 설정을 수정했습니다

중점적으로 리뷰받고 싶은 부분(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

논의하고 싶은 부분(선택)

논의하고 싶은 부분이 있다면 작성해주세요.

🫡 참고사항

Summary by CodeRabbit

릴리스 노트

  • New Features

    • AI 요약 기능에 시스템 프롬프트 및 설정 옵션 추가
  • Bug Fixes

    • 요약 서비스의 오류 처리 및 로깅 개선

- System 프롬프트
- 프롬프트 지시사항 구체화
@lepitaaar lepitaaar self-assigned this Feb 4, 2026
@lepitaaar lepitaaar added 🔨 Refactor 코드 리팩토링 💾 BE Backend labels Feb 4, 2026
@vercel
Copy link

vercel bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
moadong Ready Ready Preview, Comment Feb 4, 2026 5:55am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 4, 2026

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid regex pattern for base branch. Received: "**" at "reviews.auto_review.base_branches[0]"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

AI 프롬프트 처리 파이프라인을 구조화하여 시스템 프롬프트를 도입하고, 요청 모델을 확장하며, 서빙 서비스 인터페이스를 업데이트합니다. 로깅과 에러 처리를 강화합니다.

Changes

Cohort / File(s) Summary
프롬프트 구조화 및 시스템 프롬프트 도입
backend/src/main/java/moadong/club/summary/ApplicantIdMessageConsumer.java, backend/src/main/java/moadong/gemma/service/GemmaService.java
단순 인라인 프롬프트를 구조화된 다중 파트 시스템 프롬프트로 변경. 역할, 작업, 규칙, 출력 형식을 명시하는 시스템 블록 도입. 질문/답변 쌍의 포맷 재정의 및 서빙 서비스 호출 변경. 프롬프트 조립과 결과에 대한 로깅 추가.
API 요청 모델 확장
backend/src/main/java/moadong/gemma/dto/AIRequest.java
AIRequest 레코드에 system 필드 추가. 새로운 중첩 공개 레코드 AIOptions 도입 (numCtx, temperature, numPredict, topP, repeatPenalty 필드). Jackson JSON 매핑 설정.
서빙 서비스 인터페이스 업데이트
backend/src/main/java/moadong/gemma/service/GemmaService.java
getSummarizeContent 메서드 시그니처 변경: (String prompt)(String system, String prompt). 서버 URL 구성 로직 추가. AIOptions를 포함한 새로운 AIRequest 생성. 상세 로깅 및 에러 처리 강화.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 변경사항의 주요 목표인 AI 프롬프트 튜닝을 명확하게 반영하고 있으며, 코드 변경의 핵심 내용과 일치합니다.
Linked Issues check ✅ Passed 연결된 이슈 MOA-601의 주요 목표인 AI 프롬프트 튜닝이 완료되었으며, 시스템 프롬프트 구조화 및 프롬프트 지시사항 구체화가 구현되었습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 AI 프롬프트 튜닝과 관련된 범위 내에 있으며, AIRequest DTO 확장, GemmaService 메서드 수정, ApplicantIdMessageConsumer의 프롬프트 구조 개선이 일관되게 연결되어 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/#1139-ai-prompt-tuning-MOA-601

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

Test Results

72 tests   72 ✅  17s ⏱️
14 suites   0 💤
14 files     0 ❌

Results for commit 49d022b.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🤖 Fix all issues with AI agents
In `@backend/src/main/java/moadong/club/summary/ApplicantIdMessageConsumer.java`:
- Around line 80-85: Do not log decrypted or summarized user content directly:
replace the direct log.info(prompt.toString()) and
log.info(summarizeContent.response()) usages with metadata-only logging (e.g.,
applicant id, request id, response length or status) and avoid printing the
content itself; then add a null guard around the
gemmaService.getSummarizeContent(...) result so that you check summarizeContent
!= null and summarizeContent.response() != null (or empty) before calling
clubApplicant.updateMemo(...). Locate these changes around the prompt variable,
the gemmaService.getSummarizeContent call, the summarizeContent reference, and
clubApplicant.updateMemo to implement the safe logging and null-checking flow.

In `@backend/src/main/java/moadong/gemma/service/GemmaService.java`:
- Around line 53-55: The code in GemmaService currently logs the full model
response via log.debug("Gemma response raw content: {}", response.response()),
which risks leaking sensitive data; replace this raw-content log with a safe
metadata-only log (e.g., response length, a stable hash, or drop the log
entirely) in the method inside GemmaService that handles the response so no
plaintext response.response() is written to logs.

Copy link
Member

@seongwon030 seongwon030 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

규칙 정의한 거 좋습니다

@lepitaaar lepitaaar merged commit d6736fc into develop/be Feb 8, 2026
5 checks passed
@lepitaaar lepitaaar deleted the refactor/#1139-ai-prompt-tuning-MOA-601 branch February 21, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💾 BE Backend 🔨 Refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants