You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP →

ai-fallback

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ai-fallback - npm Package Compare versions

Comparing version

to
0.0.6

@@ -6,2 +6,11 @@ export function createFallback(settings) {

function defaultShouldRetryThisError(error) {
let statusCode = error === null || error === void 0 ? void 0 : error['statusCode'];
if (statusCode &&
(statusCode === 408 || // request timeout
statusCode === 409 || // conflict
statusCode === 429 || // too many requests
statusCode >= 500) // server error)
) {
return true;
}
// Common error messages/codes that indicate server overload or temporary issues

@@ -8,0 +17,0 @@ const retryableErrors = [

{
"name": "ai-fallback",
"version": "0.0.5",
"version": "0.0.6",
"description": "Automatically switch AI SDK model provider when one of the providers has downtime",

@@ -5,0 +5,0 @@ "type": "module",

@@ -30,2 +30,13 @@ import {

function defaultShouldRetryThisError(error: Error): boolean {
let statusCode = error?.['statusCode']
if (
statusCode &&
(statusCode === 408 || // request timeout
statusCode === 409 || // conflict
statusCode === 429 || // too many requests
statusCode >= 500) // server error)
) {
return true
}
// Common error messages/codes that indicate server overload or temporary issues

@@ -32,0 +43,0 @@ const retryableErrors = [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet