Skip to content

Function: noRetry()

@providerprotocol/ai


@providerprotocol/ai / @providerprotocol/ai / noRetry

noRetry(): RetryStrategyFactory

Defined in: src/http/retry.ts:188

Creates a no-retry strategy that fails immediately on any error.

Use this strategy when:

  • Retries are handled at a higher level in your application
  • You want immediate failure feedback
  • The operation is not idempotent
  • Time sensitivity requires fast failure

RetryStrategyFactory

A factory that creates no-retry strategy instances

// Disable retries for time-sensitive operations
const provider = createOpenAI({
retryStrategy: noRetry()
});