nip.utils.api

nip.utils.api#

Utilities for dealing with APIs.

Exceptions

ContentFilterError([num_retries])

Raised when the agent's response is blocked by a content filter.

ContentIsNoneError([num_retries])

Raised when the content of the generated message is None.

GenerationError([num_retries])

Base class for exceptions raised during generation of the next message.

InvalidDecisionError(response_text[, ...])

Raised when the agent's decision is invalid (i.e. not accept or reject).

InvalidResponseError(response_text[, ...])

Raised when the agent's response is invalid.

NotAllActiveChannelsInResponseError(...[, ...])

Raised when the response does not contain messages for all active channels.

NotGuessedError([num_retries])

Raised when the agent has not made a decision within the max number of turns.

UnknownFinishReasonError(reason[, num_retries])

Raised when the agent's finishes generating for an unknown reason.