Creates a middleware that retries requests on specific error statuses.
const { text } = awaitai.generate({ model:googleAI.model('gemini-2.5-pro'), prompt:'You are a helpful AI assistant named Walt, say hello', use: [ retry({ maxRetries:2, initialDelayMs:1000, backoffFactor:2, }), ], });
Creates a middleware that retries requests on specific error statuses.