Skip to content

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

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions