Skip to main content

Module session

Module session 

Source
Expand description

The thing you are building in the REPL: a state, some named questions, a model.

Structs§

Session
Everything the next :ask will send.
Turn
One turn of a conversation held as the state: who spoke, and what they said.

Functions§

from_body
Rebuild a session from a saved request body (:open), keeping typed questions where the type is one this SDK models.
is_empty_value
Whether a value is empty enough that there is nothing to judge.
parse_choice
name instructions | label=description | bare_label | …
parse_noul
name instructions [| yes: ...] [| no: ...]
parse_raw
name {json} — a hand-built question object, like Question::Raw.
parse_score
name instructions | level | level | …
parse_turn
who: what they said, or just what they said.
question_from_json
Map a wire question back to a typed one; anything unfamiliar stays Question::Raw.
turn_text
customer: The payout failed again — one turn on one line.
turns_of
Read a state as a conversation, or None when it is not one.
turns_to_json
Turns as they go on the wire: who only when there is one, so nothing empty is paid for.
value
Instructions, descriptions and levels accept any JSON, so {…}/[…] is parsed as such and anything else is sent as a plain string.

Type Aliases§

Entry
A question under construction, kept in the order it was added (answers come back in that order).