2
0

(openai) Retry OpenAI call if status code is 503

Closes #529
This commit is contained in:
Baptiste Arnaud
2023-06-16 19:31:28 +02:00
parent 524f1565d8
commit dcdf870308
4 changed files with 14 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@typebot.io/js",
"version": "0.0.63",
"version": "0.0.64",
"description": "Javascript library to display typebots on your website",
"type": "module",
"main": "dist/index.js",

View File

@@ -54,7 +54,7 @@ export const streamChat =
if (dataString.includes('503 Service Temporarily Unavailable')) {
if (isRetrying)
return { error: { message: "Couldn't get streamer data" } }
await new Promise((resolve) => setTimeout(resolve, 1000))
await new Promise((resolve) => setTimeout(resolve, 3000))
return streamChat(context)(messages, {
onStreamedMessage,
isRetrying: true,

View File

@@ -1,6 +1,6 @@
{
"name": "@typebot.io/react",
"version": "0.0.63",
"version": "0.0.64",
"description": "React library to display typebots on your website",
"main": "dist/index.js",
"types": "dist/index.d.ts",