Skip to main content

Module reply

Module reply 

Source
Expand description

classify.run replies and the provider’s answer objects.

After admission the batch never fails as a whole: every item gets answers or error, at its position in the request.

Structs§

Answer
One answer, the provider’s answer object as returned. Which members are present depends on the question type:
ClassifyReply
The classify.run reply.
ItemResult
One item’s outcome: answers if it succeeded, error if it failed, never both.
Usage
Token usage. A count the provider did not report is absent, never zero.

Functions§

check_reply
Check a reply against the request it answers: the same batch and model, one item per request item in request order, each with exactly one of answers and error, and every answered item answering exactly the request’s questions with answers of the asked type. The error names the first problem.
sum_usage
The batch’s usage: each count summed over the items that reported it, and absent when none did.