Skip to main content

Module response

Module response 

Source
Expand description

What a call answers with.

The response type is generic in its answers from the start, so the map of answers a runtime question set produces and the struct a derived one produces are the same type at different parameters rather than two types that drift apart.

The received bytes are kept beside the decoded answers. An answer of a kind this version does not model is dropped by the decoder and is still there in the raw body, so a caller is never left with no way to read what the server actually said.

Every container keeps the order that means something: the answers and a choice’s probabilities are in the order the server sent them, which is the order the caller asked in, while a score’s legend and probabilities are sorted by level, so two responses that differ only in the order of a score’s keys compare equal and print the same.

Structs§

Answers
The answers of a response, looked up by question name.
ChoiceAnswer
The option a choice question picked, with how likely each option was.
NoulAnswer
A yes/no answer.
ResponseMeta
The HTTP side of a successful response.
ScoreAnswer
A rating on the levels a score question defined, with the level descriptions it was rated against and how likely each level was.
SystemOneResponse
The answers to one System One call, with the model and token usage the server reported and the HTTP response they came in.
Usage
Token counts for a call, when the server reported them.

Enums§

Answer
One answer, of whichever kind its question was.