Skip to content

GraderMulti.graders models one grader instead of a named dictionary #580

Open

Description

@markstuart-oai

Source report

Mirrors openai-java#647, which reports a generated MultiGrader request failing with 400: Invalid type for 'graders.input': expected an object, but got a string instead.

Specification mismatch

In the current public specification, GraderMulti.graders is a oneOf containing individual StringCheck, TextSimilarity, Python, ScoreModel, and LabelModel graders. It therefore describes a single grader object.

The combined-graders guide instead defines graders as an object whose keys name constituent graders. calculate_output refers to those keys. For example:

{
  "type": "multi",
  "name": "example",
  "graders": {
    "compliant": {
      "type": "string_check",
      "name": "compliant",
      "input": "{{sample.output_json.compliant}}",
      "reference": "{{item.compliant}}",
      "operation": "eq"
    }
  },
  "calculate_output": "0.5 * compliant"
}

The generated SDK currently follows the single-grader union, so the source example serializes the grader fields directly under graders and the service treats input as a named grader with an invalid string value.

There is also an inconsistent GraderMulti example in the specification: it uses an array, which matches neither the single-grader schema nor the documented named-map contract.

Expected correction

Describe graders as an object whose additional properties use the supported individual-grader union, and replace the array example with a named map whose keys match calculate_output. Regenerate the published schema and SDK models. Preserve the original SDK reproduction as a validation case.

Activity

  1. added
    bug
    specification
    documentation
    on Sep 6, 2026
  2. markstuart-oai commented on Sep 22, 2026

    @markstuart-oai
    ContributorAuthor

    Confirmed. The five existing grader variants belong under graders.additionalProperties, with graders an object keyed by the names referenced in calculate_output; the documented array and mismatched formula are incorrect.

    A fresh check of public revision 7de0436 still accepts the erroneous flat shape and rejects a valid named dictionary. The upstream correction retains the five variants and fixes the keyed example/formula. It remains under review, with SDK compatibility and publication still outstanding; no published schema or released SDK fix is claimed. The original Java report now has a contract explanation, and both reports should remain open until publication and consumer validation are complete.

  3. added
    repro
    on Sep 24, 2026
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

    bugdocumentationreprospecification

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions