Skip to content

Retry

Category: LLM Providers

Source: retry.dart

Functions

bool isTransientLlmError(Object error)

Classifies an error thrown by an [LlmClient] stream as transient (worth retrying) or not.

Transient: connection errors ([SocketException], [http.ClientException]), [TimeoutException], and HTTP 429 / 5xx (detected from the stable "<Provider> API error <status>: <body>" message the shared transport throws). Everything else — 4xx-non-429, [ToolsNotSupportedException], and provider-signalled mid-stream errors — is treated as permanent.

Released under the MIT License.