ai.errors.FinishReasonError

The provider completed a turn with a terminal reason that is not a valid successful completion. This stays distinct from ParseFailed: the response may be syntactically valid but incomplete because the model exhausted its output budget. Host SDKs can map MaxTokens to their legacy `length` finish reason without treating it as a schema-validation failure.

Reference version

Signature

class ai.errors.FinishReasonError

The provider completed a turn with a terminal reason that is not a valid successful completion. This stays distinct from ParseFailed: the response may be syntactically valid but incomplete because the model exhausted its output budget. Host SDKs can map MaxTokens to their legacy length finish reason without treating it as a schema-validation failure.

Source:<builtin>/ai/ns_errors/errors.bamlbytes 78278067

Fields

provider

string

raw_output

string

Implementations