fixes AWS Claude throttlingException handling

This commit is contained in:
nai-degen 2024-02-04 20:48:20 -06:00
parent 40240601f5
commit a8fd3c7240
1 changed files with 4 additions and 2 deletions

View File

@ -55,9 +55,11 @@ export class SSEStreamAdapter extends Transform {
// noinspection FallThroughInSwitchStatementJS
case "exception":
case "error":
const type = exceptionType || errorCode || "UnknownError";
const type = String(
exceptionType || errorCode || "UnknownError"
).toLowerCase();
switch (type) {
case "ThrottlingException":
case "throttlingexception":
this.log.warn(
{ message, type },
"AWS request throttled after streaming has already started; retrying"