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, and Score to define questions with named arguments.

typesafe_sdk.NoulCriteria

Bases: TypedDict Optional descriptions of the yes and no outcomes.

true instance-attribute

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

false instance-attribute

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

typesafe_sdk.Noul

Bases: wire.NoulQuestion A yes/no question with optional descriptions for either outcome. See the noul primitive for details.

instructions class-attribute instance-attribute

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

criteria class-attribute instance-attribute

Optional descriptions of the yes and no outcomes.

typesafe_sdk.Choice

Bases: wire.ChoiceQuestion A question that selects between named alternatives. See the choice primitive for details.

criteria instance-attribute

Labels mapped to text, object, or array descriptions, or None for undescribed labels.

instructions class-attribute instance-attribute

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

typesafe_sdk.Score

Bases: wire.ScoreQuestion A question that assigns a score using an ordered rubric. See the score primitive for details.

criteria instance-attribute

Nonempty text, object, or array descriptions indexed from zero, with no gaps in dictionary keys.

instructions class-attribute instance-attribute

The question to ask, expressed as text, 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", or "score". You can mix dictionaries and question objects in the same request.

typesafe_sdk.NoulModel

Bases: TypedDict A yes/no question dictionary with type="noul", allowing extra JSON fields.

type instance-attribute

instructions instance-attribute

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

criteria instance-attribute

Optional descriptions of the yes and no outcomes.

typesafe_sdk.ChoiceModel

Bases: TypedDict A choice question dictionary with type="choice", allowing extra JSON fields.

type instance-attribute

instructions instance-attribute

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

criteria instance-attribute

Labels mapped to text, object, or array descriptions, or None for undescribed labels.

typesafe_sdk.ScoreModel

Bases: TypedDict A score question dictionary with type="score", allowing extra JSON fields.

type instance-attribute

instructions instance-attribute

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

criteria instance-attribute

Nonempty text, object, or array descriptions indexed from zero, with no gaps in dictionary keys.

typesafe_sdk.QuestionModel module-attribute

A question dictionary identified by its type key.