Skip to content

Commit

Permalink
retry after parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Apr 29, 2024
1 parent 65a9094 commit 062b084
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/aici.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
LanguageModel,
} from "./chat"
import { PromptNode, visitNode } from "./promptdom"
import { fromHex, logError, utf8Decode } from "./util"
import { fromHex, logError, normalizeInt, utf8Decode } from "./util"
import { AICI_CONTROLLER, TOOL_ID } from "./constants"
import { host } from "./host"
import { NotSupportedError, RequestError } from "./error"
Expand Down Expand Up @@ -248,7 +248,7 @@ const AICIChatCompletion: ChatCompletionHandler = async (
r.statusText,
bodyJSON?.error,
body,
parseInt(r.headers.get("retry-after"))
normalizeInt(r.headers.get("retry-after"))
)
}

Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/openai.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { logError, logVerbose } from "./util"
import { logError, logVerbose, normalizeInt } from "./util"
import { host } from "./host"
import {
AZURE_OPENAI_API_VERSION,
Expand Down Expand Up @@ -150,7 +150,7 @@ export const OpenAIChatCompletion: ChatCompletionHandler = async (
r.statusText,
bodyJSON?.error,
body,
parseInt(r.headers.get("retry-after"))
normalizeInt(r.headers.get("retry-after"))
)
}

Expand Down

0 comments on commit 062b084

Please sign in to comment.