Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

BUG General self-ask scorers crash when the judge returns a category

Đã đóng
#2,896 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@u7k4rs6 đang làm issue này rồi.

Từ ngày 28/9/2026.

  • #1 của @bhargavikvmpl-2001 — đang mở
  • #2897 của @u7k4rs6 — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
security

Hướng nghiên cứu

Start by locating SelfAskGeneralFloatScaleScorer, SelfAskGeneralTrueFalseScorer, and their JsonSchemaResponseHandler construction. Review the existing response-category handling and related scorer tests, then verify that these two scorers use the response category as the fallback rule describes while other handlers retain the current error behavior.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

SelfAskGeneralFloatScaleScorer and SelfAskGeneralTrueFalseScorer crash when the judge returns a category and the scorer also has one configured.

Both docstrings say a category in the response is used, and the configured one only applies when the response has none. But they build a JsonSchemaResponseHandler that raises ValueError("Category is present in the response and an argument") when both are present. That isn't an InvalidJsonException, so there's no retry and scoring fails after one call:

category="harm", response {"score_value": "true", "rationale": "r", "category": "violence"}
-> RuntimeError ... ValueError: Category is present in the response and an argument  (target calls: 1)

Fix: let these two scorers opt into "response category wins, configured is the fallback". Other handlers and scorers keep the current error.

Ngôn ngữ chính
Python
Star
4.6k
Fork
944
Merge trung bình
2 ngày 16 giờ
Pull request đã merge (30 ngày)
350

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/PyRIT

Tất cả issue của microsoft/PyRIT

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.