mirror of
https://github.com/baptisteArno/typebot.io.git
synced 2026-06-16 21:10:26 +08:00
parent
80498808ff
commit
413e29bc9e
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/js",
|
||||
"version": "0.3.71",
|
||||
"version": "0.3.72",
|
||||
"description": "Javascript library to display typebots on your website",
|
||||
"license": "FSL-1.1-ALv2",
|
||||
"type": "module",
|
||||
|
||||
@ -227,6 +227,11 @@ export const ConversationContainer = (props: Props) => {
|
||||
};
|
||||
|
||||
const sendMessage = async (answer?: InputSubmitContent) => {
|
||||
if (hasError() && clientSideActions().length > 0) {
|
||||
setHasError(false);
|
||||
await processClientSideActions(clientSideActions());
|
||||
return;
|
||||
}
|
||||
setHasError(false);
|
||||
const currentInputBlock = [...chatChunks()].pop()?.input;
|
||||
|
||||
@ -421,6 +426,7 @@ export const ConversationContainer = (props: Props) => {
|
||||
};
|
||||
|
||||
const processClientSideActions = async (actions: ClientSideAction[]) => {
|
||||
let hasStreamError = false;
|
||||
for (const action of actions) {
|
||||
if (
|
||||
"streamOpenAiChatCompletion" in action ||
|
||||
@ -439,6 +445,7 @@ export const ConversationContainer = (props: Props) => {
|
||||
onMessageStream: streamMessage,
|
||||
onStreamError: async (error) => {
|
||||
setHasError(true);
|
||||
hasStreamError = true;
|
||||
await saveLogs([error]);
|
||||
props.onNewLogs?.([error]);
|
||||
},
|
||||
@ -450,6 +457,7 @@ export const ConversationContainer = (props: Props) => {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (hasStreamError) return;
|
||||
|
||||
setClientSideActions((actions) => actions.slice(1));
|
||||
if (response && "logs" in response) saveLogs(response.logs);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/nextjs",
|
||||
"version": "0.3.71",
|
||||
"version": "0.3.72",
|
||||
"license": "FSL-1.1-ALv2",
|
||||
"description": "Convenient library to display typebots on your Next.js website",
|
||||
"type": "module",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/react",
|
||||
"version": "0.3.71",
|
||||
"version": "0.3.72",
|
||||
"description": "Convenient library to display typebots on your React app",
|
||||
"license": "FSL-1.1-ALv2",
|
||||
"type": "module",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user