mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-07-09 17:28:45 +00:00
parent
a6f720e6ca
commit
57d96d72ed
2 changed files with 9 additions and 0 deletions
|
|
@ -79,6 +79,9 @@ const RETRYABLE_PROVIDER_ERROR_PATTERN = buildProviderErrorPattern([
|
|||
"you can retry your request",
|
||||
"try your request again",
|
||||
"please retry your request",
|
||||
|
||||
// gRPC based providers (e.g. NVIDIA NIM)
|
||||
"ResourceExhausted",
|
||||
]);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ const openAIExplicitRetryMessage =
|
|||
"An error occurred while processing your request. You can retry your request, or contact us through our help center at help.openai.com if the error persists. Please include the request ID req_******** in your message.";
|
||||
const bedrockExplicitRetryMessage =
|
||||
'{"message":"The system encountered an unexpected error during processing. Try your request again."}';
|
||||
const nvidiaNIMResourceExhaustedMessage = "ResourceExhausted: Worker local total request limit reached (288/48)";
|
||||
const bunFetchSocketClosedMessage =
|
||||
"The socket connection was closed unexpectedly. For more information, pass `verbose: true` in the second argument to fetch()";
|
||||
|
||||
|
|
@ -21,6 +22,11 @@ describe("provider retry classification", () => {
|
|||
fauxAssistantMessage("", { stopReason: "error", errorMessage: bedrockExplicitRetryMessage }),
|
||||
),
|
||||
).toBe(true);
|
||||
expect(
|
||||
isRetryableAssistantError(
|
||||
fauxAssistantMessage("", { stopReason: "error", errorMessage: nvidiaNIMResourceExhaustedMessage }),
|
||||
),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("matches Bun fetch socket drop wording", () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue