Skip to main content

State

state is the text or JSON object you want to ask questions about. It cannot be None, but values inside an object may be None.

Question objects

Use Noul, Choice, Score, and Box to define questions with named arguments.

typesafe_sdk.NoulCriteria

Bases: TypedDict Optional descriptions of the yes and no outcomes. See the noul primitive for details.

true

instance-attribute Description of the yes outcome as text, an asset, a JSON object, or an array; None leaves it undescribed.

false

instance-attribute Description of the no outcome as text, an asset, a JSON object, or an array; None leaves it undescribed.

typesafe_sdk.Noul

pydantic-model
Bases: _Question, wire.NoulQuestion A yes/no question with optional descriptions for either outcome. See the noul primitive for details.
Show JSON schema:
Fields:

instructions

pydantic-field The question to ask, expressed as text, an asset, a JSON object, or an array; optional when criteria describes an outcome.

criteria

pydantic-field Optional descriptions of the yes and no outcomes; required when instructions is None.

typesafe_sdk.Choice

pydantic-model Bases: _Question, wire.ChoiceQuestion A question that selects between named alternatives. See the choice primitive for details.
Show JSON schema:
Fields:

criteria

pydantic-field A nonempty mapping of labels to text, asset, object, or array descriptions, or None for undescribed labels.

instructions

pydantic-field The question to ask, expressed as text, an asset, a JSON object, or an array; optional.

typesafe_sdk.Score

pydantic-model Bases: _Question, wire.ScoreQuestion A question that assigns a score using an ordered rubric. See the score primitive for details.
Show JSON schema:
Fields:

criteria

pydantic-field A nonempty, ordered list of text, asset, object, or array descriptions, one per score from zero.

instructions

pydantic-field The question to ask, expressed as text, an asset, a JSON object, or an array; optional.

typesafe_sdk.Box

pydantic-model Bases: _Question, wire.BoxQuestion A question that locates what its instructions describe in the request’s image. Examples:
Show JSON schema:
Fields:

instructions

pydantic-field What to locate in the request’s image, expressed as text, an asset, a JSON object, or an array; optional.

typesafe_sdk.Question

module-attribute A question object or question dictionary.

typesafe_sdk.Questions

module-attribute Question inputs keyed by the names used to identify their answers.

Question dictionaries

Question dictionaries include a type key: "noul", "choice", "score", or "box". You can mix dictionaries and question objects in the same request.

typesafe_sdk.NoulModel

Bases: TypedDict A yes/no question dictionary with type="noul". See the noul primitive for details.

type

instance-attribute

instructions

instance-attribute The question to ask, expressed as text, an asset, a JSON object, or an array; optional when criteria describes an outcome.

criteria

instance-attribute Optional descriptions of the yes and no outcomes; required when instructions is None.

typesafe_sdk.ChoiceModel

Bases: TypedDict A choice question dictionary with type="choice". See the choice primitive for details.

type

instance-attribute

instructions

instance-attribute The question to ask, expressed as text, an asset, a JSON object, or an array; optional.

criteria

instance-attribute A nonempty mapping of labels to text, asset, object, or array descriptions, or None for undescribed labels.

typesafe_sdk.ScoreModel

Bases: TypedDict A score question dictionary with type="score". See the score primitive for details.

type

instance-attribute

instructions

instance-attribute The question to ask, expressed as text, an asset, a JSON object, or an array; optional.

criteria

instance-attribute A nonempty, ordered list of text, asset, object, or array descriptions, one per score from zero.

typesafe_sdk.BoxModel

Bases: TypedDict A box question dictionary with type="box".

type

instance-attribute

instructions

instance-attribute What to locate in the request’s image, expressed as text, an asset, a JSON object, or an array; optional.

typesafe_sdk.QuestionModel

module-attribute A question dictionary identified by its type key.