2
0

Add dynamic timeout to bot engine api

This commit is contained in:
Baptiste Arnaud
2023-12-08 13:43:58 +00:00
parent 8819e9e567
commit 957eaf33dd
16 changed files with 124 additions and 31 deletions

View File

@ -41,10 +41,11 @@ import { getBlockById } from '@typebot.io/lib/getBlockById'
type Params = {
version: 1 | 2
state: SessionState
startTime?: number
}
export const continueBotFlow = async (
reply: string | undefined,
{ state, version }: Params
{ state, version, startTime }: Params
): Promise<
ContinueChatResponse & {
newSessionState: SessionState
@ -127,7 +128,13 @@ export const continueBotFlow = async (
...group,
blocks: group.blocks.slice(blockIndex + 1),
} as Group,
{ version, state: newSessionState, visitedEdges, firstBubbleWasStreamed }
{
version,
state: newSessionState,
visitedEdges,
firstBubbleWasStreamed,
startTime,
}
)
return {
...chatReply,
@ -165,6 +172,7 @@ export const continueBotFlow = async (
state: newSessionState,
firstBubbleWasStreamed,
visitedEdges,
startTime,
})
return {