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. See the noul primitive for details.

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

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, a JSON object, or an array; optional.

criteria

pydantic-field Optional descriptions of the yes and no outcomes.

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 Labels mapped to text, object, or array descriptions, or None for undescribed labels.

instructions

pydantic-field The question to ask, expressed as text, 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, object, or array descriptions, one per score from zero.

instructions

pydantic-field 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". See the noul primitive for details.

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". See the choice primitive for details.

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". See the score primitive for details.

type

instance-attribute

instructions

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

criteria

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

typesafe_sdk.QuestionModel

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