Classify Send Error • AI Agent SDK

classify_send_error: Pure, dependency-free fallback classifier for a send exception.

classify_send_error

Function

</div>

This function is defined in the base module.

Pure, dependency-free fallback classifier for a send exception.

Maps an exception into a :class:SendResult carrying a :class:SendErrorKind and derived `retryable flag, keying primarily off the HTTP/platform status code (highest fidelity) and falling back to a small set of generic, cross-platform substrings. It is deliberately conservative: anything it cannot confidently classify becomes UNKNOWN` (retryable), preserving the historical retry-everything default.

Adapters that know their native exception types should override :meth:BasePlatformAdapter.classify_error for higher fidelity; this ensures adapters that don’t still behave correctly for standard HTTP cases.

Signature

python
def classify_send_error(exc: BaseException) -> 'SendResult'

Parameters

ParamField BaseException

No description available.

Returns

ResponseField 'SendResult'

The result of the operation.

Uses

  • SendResult

Used By

Source

View on GitHub

praisonaiagents/bots/base.py at line 240