Instructor
The Python library for typed model output adds a decisions mode that turns one Pydantic model into Jev choice, yes-or-no and score questions over a single input.
The Python library for typed model output adds a decisions mode that turns one Pydantic model into Jev choice, yes-or-no and score questions over a single input.
In decisions mode the response model is the request shape. Each field becomes one question over the same input: a Literal field becomes a Choice whose allowed values are the criteria, a field annotated with Noul becomes a yes-or-no probability with its own true and false criteria and examples, and a field annotated with Score becomes a score over the declared scale with named levels. The answers are validated back into the Pydantic model, and the same call can go to the OpenAI Decisions API or to Jev through OpenRouter. A development version of the 1.18 release carries the decisions module and its tests.
Which policy category best describes the post?
The input is one post being reviewed against a supplied content policy. Each field of the response model becomes one question, and the example below shows the choice, the policy probability, the severity score and the format field together in a single request.
Does the post violate the supplied content policy, attacking or harassing a person or group rather than expressing disagreement?
The input is one post being reviewed against a supplied content policy. Each field of the response model becomes one question, and the example below shows the choice, the policy probability, the severity score and the format field together in a single request.
How severe is the content on the declared scale from no abuse to an explicit threat?
The input is one post being reviewed against a supplied content policy. Each field of the response model becomes one question, and the example below shows the choice, the policy probability, the severity score and the format field together in a single request.
What kind of content is being reviewed?
The input is one post being reviewed against a supplied content policy. Each field of the response model becomes one question, and the example below shows the choice, the policy probability, the severity score and the format field together in a single request.
The developer writes a Pydantic response model, using a Literal or choice enum for labels, Noul for a probability and Score for a graded judgment.
The client is created with the decisions mode, and create sends the input together with the compiled questions.
The library posts the questions to the OpenAI Decisions API or to Jev through OpenRouter, with all fields in one request.
The returned probabilities are checked against the declared options and mapped back into the Pydantic model; an invalid answer raises instead of being guessed.
Application code reads the validated field values, and create_with_completion also exposes the full distribution when the caller needs it.
The request is compiled from the response model the developer already wrote, so one call carries several independent typed questions and the answers come back as validated fields instead of prose to parse. Declaring the possible answers up front is what makes classification and scoring cheaper than asking a chat model for the same judgment.