Skip to content

Conversation

@yeonju73
Copy link
Contributor

@yeonju73 yeonju73 commented Aug 17, 2025

💻 Related Issue


🚀 Work Description

  • FraudResponse 제약 조건중에 keywords 리스트가 크기 1 이상이어야 하는 조건 삭제했습니다

🙇🏻‍♀️ To Reviewer

  • GPT가 안전으로 판단한 경우 사기 유형 None으로 반환하고, keywords를 빈 리스트로 반환하는 경우가 있어 제약조건을 삭제했습니다.

➕ Next

  • Spring 서버 사기유형 None 처리

Summary by CodeRabbit

  • 리팩터
    • 검증 규칙 조정: 위험 키워드 입력이 선택 사항이 되어 비어 있는 목록도 허용되며, 최대 3개 제한은 유지됩니다. 이로써 폼/요청에서 키워드를 생략해도 응답이 제공됩니다.
    • 점수 범위 조정: 위험도 점수 상한이 80에서 70으로 낮아져 이제 070 범위로 표시·검증됩니다. 기존에 7180 점수를 기대하던 흐름은 더 이상 유효하지 않으니 임계값·필터 설정을 확인하세요.

@yeonju73 yeonju73 self-assigned this Aug 17, 2025
@yeonju73 yeonju73 added 🐞 BugFix Something isn't working 🐶 연주 labels Aug 17, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 17, 2025

Walkthrough

FraudResponse 모델에서 keywords 필드가 선택적 리스트로 변경되었고, score 필드의 최대값이 80에서 70으로 조정되었습니다.

Changes

Cohort / File(s) Summary
Model schema updates
app/models/fraud_response.py
FraudResponse.keywords: required(min_items=1) → optional(default_factory=list), max_items=3 유지; FraudResponse.score: 범위 0≤score≤70로 상한 80→70 조정, 설명 문구 업데이트

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
keywords 필드 빈 리스트 허용을 위해 min_items=1 제거 (#14)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
score 필드 상한을 le=80→le=70으로 변경 (app/models/fraud_response.py: FraudResponse.score 정의) 링크된 이슈(#14)는 keywords 제약 해제만 요구하며 score 범위 조정은 언급되지 않음. 변경 근거가 이슈 범위에 없음.

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 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 37ddca1 and 8fa9974.

📒 Files selected for processing (1)
  • app/models/fraud_response.py (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
app/models/fraud_response.py (2)
app/models/fraud_request.py (1)
  • FraudRequest (5-9)
app/prompts/fraud_example.py (1)
  • FraudExample (4-8)
🔇 Additional comments (2)
app/models/fraud_response.py (2)

6-6: 키워드 빈 리스트 허용: PR 목표와 정확히 일치 (LGTM)

min_items=1 제거 후 default_factory=list로 기본 빈 배열을 허용한 점 적절합니다. max_items=3 제약 유지도 좋습니다.


8-8: score 상한(upper bound) 변경 확인 및 의도 파악 필요
현재 app/models/fraud_response.py 8행에서 score 상한을 80→70으로 줄인 것으로 보입니다. PR의 핵심(키워드 제약 해제)과 무관한 변경으로, 기존 클라이언트/서버(UI 슬라이더, 경계값 로직, 문서 “0~80”)와 불일치가 발생할 수 있습니다.

rg 검색 결과 이 파일 외에는 0~70 또는 0~80, le=70/le=80 표기가 없습니다.
의도치 않은 변경이라면 아래와 같이 원복을 제안합니다.

-    score: float = Field(..., ge=0, le=70, description="위험도(0~70)")
+    score: float = Field(..., ge=0, le=80, description="위험도(0~80)")

의도된 변경이라면, 다음 항목을 일괄 업데이트해주세요.

  • 프론트엔드(UI 슬라이더) 상수
  • API 문서(“080” → “070”)
  • 백엔드 검증 로직 및 상수

· 수정 위치

  • app/models/fraud_response.py:8
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/#14/allow-keywards-emptylist

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@yeonju73 yeonju73 merged commit 8d4b139 into main Aug 17, 2025
3 checks passed
@yeonju73 yeonju73 deleted the fix/#14/allow-keywards-emptylist branch August 17, 2025 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 BugFix Something isn't working 🐶 연주

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fix] 사기분석 API 응답 keywords 필드 빈 리스트 허용

2 participants