Skip to content

[Fix] 댓글 요약 프롬프트 동적 파라미터 적용 - 감정 라벨, 최소 갯수 적용#183

Merged
yujin9907 merged 1 commit into
developfrom
fix/#182-fix-comment-prompt
Mar 10, 2026
Merged

[Fix] 댓글 요약 프롬프트 동적 파라미터 적용 - 감정 라벨, 최소 갯수 적용#183
yujin9907 merged 1 commit into
developfrom
fix/#182-fix-comment-prompt

Conversation

@yujin9907

@yujin9907 yujin9907 commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

PR 제목

[Feat/Fix/Refactor/Docs/Chore 등]: 간결하게 변경 내용을 요약해주세요. (예: Feat: 사용자 로그인 기능 구현)

댓글 요약 프롬프트 동적 파라미터 적용 - 감정 라벨, 최소 갯수 적용

예시 댓글
image

pr 적용 전
image

pr 적용 후
image

✨ 변경 유형 (하나 이상 선택)

  • Feat: 새로운 기능 추가
  • Fix: 버그 수정
  • Refactor: 코드 리팩토링 (기능 변경 없음)
  • Docs: 문서 업데이트 (주석, README 등)
  • Chore: 기타 변경 (빌드 설정, 라이브러리 업데이트 등)
  • Test: 테스트 코드 추가/수정

📚 변경 내용

구체적으로 어떤 변경 사항이 있는지, 왜 이러한 변경이 필요한지 설명해주세요.
(예: 사용자 회원가입 시 이메일 중복 확인 로직 추가. 기존 로직에서 누락된 부분 발견하여 수정.)

  • LLM이 특정 감성 관점에서 요청된 개수만큼 요약하도록 프롬프트 지침 개선
  • 댓글 요약 프롬프트에 감정 및 요약 개수 정보를 동적으로 전달하도록 변경

⚙️ 주요 작업 (선택 사항)

  • 새로운 API 추가 (API 명세서 링크 또는 간단한 정보)
  • 데이터베이스 스키마 변경 (변경 내용 명시)
  • 외부 라이브러리 추가/제거 (라이브러리 명시)

✅ 체크리스트

  • 코드 컨벤션을 준수했습니다.
  • 변경 사항에 대한 문서 업데이트가 필요한 경우 반영했습니다.

🔗 관련 이슈 (선택 사항)

해당 PR이 해결하는 이슈 또는 관련 있는 이슈가 있다면 링크를 걸어주세요.
(예: #123, ABC-456)

💬 기타 (선택 사항)

리뷰어에게 전달하고 싶은 추가 정보나 궁금한 점이 있다면 작성해주세요.

- LLM이 특정 감성 관점에서 요청된 개수만큼 요약하도록 프롬프트 지침 개선
- 댓글 요약 프롬프트에 감정 및 요약 개수 정보를 동적으로 전달하도록 변경
- `CommentType`에 한국어 감정 레이블을 반환하는 `label` 프로퍼티 추가

IssueNum #182
@yujin9907 yujin9907 self-assigned this Mar 8, 2026
@yujin9907 yujin9907 added the 🐛 버그 버그 발생 label Mar 8, 2026
@yujin9907 yujin9907 linked an issue Mar 8, 2026 that may be closed by this pull request
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 댓글 요약 기능을 개선하여 LLM 프롬프트가 감정 라벨과 요약 개수를 동적으로 받아들이도록 변경합니다. 이를 통해 특정 감정 관점에서 요청된 개수만큼 댓글을 요약할 수 있게 되어, 보다 정확하고 맞춤화된 요약 결과를 제공할 수 있습니다.

Highlights

  • 동적 프롬프트 적용: 댓글 요약 프롬프트에 감정 라벨과 최소 요약 개수를 동적으로 적용하도록 변경되었습니다.
  • LLM 프롬프트 템플릿 업데이트: LLM 프롬프트 템플릿이 emotioncomment_count 매개변수를 받아들이도록 업데이트되었습니다.
  • 감정 라벨 속성 추가: CommentType 열거형에 한국어 감정 라벨을 반환하는 label 속성이 추가되었습니다.
  • 서비스 호출 변경: 댓글 요약 서비스 호출 시 동적 감정 라벨과 댓글 개수가 전달되도록 수정되었습니다.
  • .gitignore 업데이트: .gitignore 파일에 logs.claude 항목이 추가되었습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .gitignore
    • logs 디렉토리와 .claude 파일을 Git 추적에서 제외하도록 추가되었습니다.
  • core/llm/prompt_template_manager.py
    • get_sumarlize_comment_prompt 메서드가 emotioncomment_count 매개변수를 받도록 변경되었습니다.
    • 프롬프트 내용이 이 매개변수들을 활용하여 특정 감정 관점에서 지정된 개수만큼 요약하도록 동적으로 구성되도록 수정되었습니다.
  • domain/comment/model/comment_type.py
    • CommentType 열거형에 label 속성이 추가되어 각 감정 유형에 대한 한국어 문자열 라벨을 반환합니다.
  • domain/comment/service/comment_service.py
    • summarize_comments_by_emotions_with_llm 함수 내에서 rag_service.summarize_comments를 호출할 때, 현재 감정의 한국어 라벨과 해당 감정 그룹의 댓글 개수를 함께 전달하도록 수정되었습니다.
  • external/rag/rag_service.py
    • 추상 메서드인 summarize_comments의 시그니처가 emotioncomment_count 매개변수를 포함하도록 변경되었습니다.
  • external/rag/rag_service_impl.py
    • summarize_comments 메서드의 구현이 emotioncomment_count 매개변수를 받아 PromptTemplateManager.get_sumarlize_comment_prompt 호출 시 이들을 전달하도록 업데이트되었습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions

github-actions Bot commented Mar 8, 2026

Copy link
Copy Markdown

🤖 Gemini AI 코드 리뷰

❌ Gemini API 호출 실패: 최대 재시도 횟수 초과


이 리뷰는 Gemini AI가 자동으로 생성했습니다. 참고용으로만 활용해주세요.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

이 PR은 댓글 요약 프롬프트를 개선하여 감정 라벨과 최소 요약 개수를 동적으로 적용하도록 수정한 점이 좋습니다. 전반적으로 코드 변경 사항은 명확하며 의도한 대로 잘 동작할 것으로 보입니다. 다만, 프롬프트 템플릿에서 메서드 이름의 오타와 JSON 출력 예시 형식에 대한 몇 가지 개선점을 제안합니다. 자세한 내용은 개별 코멘트를 확인해주세요.

Comment on lines +97 to +98
{{{{“content”: “요약 내용 1”}}}},
{{{{“content”: “요약 내용 2”}}}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

프롬프트의 출력 예시 JSON 형식이 올바르지 않습니다. f-string 내에서 {{{{...}}}}{{...}}로 렌더링되어 유효하지 않은 JSON을 생성합니다. 또한, JSON 표준을 따르기 위해 “...” 대신 "..."를 사용해야 합니다. LLM이 항상 유효한 JSON을 생성하도록 예시를 수정하는 것이 중요합니다.

Suggested change
{{{{“content”: “요약 내용 1”}}}},
{{{{“content”: “요약 내용 2”}}}}
{{ "content": "요약 내용 1" }},
{{ "content": "요약 내용 2" }}

def get_sumarlize_comment_prompt() -> str:
"""댓글 반응 분석용 프롬프트 템플릿"""
return """
def get_sumarlize_comment_prompt(emotion: str, comment_count: int) -> str:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

메서드 이름에 'sumarlize'라는 오타가 있습니다. 'summarize'로 수정하는 것이 좋겠습니다. 이 변경 사항은 이 메서드를 호출하는 external/rag/rag_service_impl.py에도 반영되어야 합니다. 일관성 있는 명명은 코드의 가독성과 유지보수성을 향상시킵니다.

Suggested change
def get_sumarlize_comment_prompt(emotion: str, comment_count: int) -> str:
def get_summarize_comment_prompt(emotion: str, comment_count: int) -> str:

@yujin9907 yujin9907 merged commit 5530279 into develop Mar 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 버그 버그 발생

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FIX]: 댓글 생성 - 감정별 요약, 최소 갯수 수정

1 participant