2
0

🚸 (openai) Improve streaming bubble sequence and visual

This commit is contained in:
Baptiste Arnaud
2023-10-09 11:30:51 +02:00
parent 8eb9f2568b
commit 49826d1303
10 changed files with 69 additions and 25 deletions

View File

@@ -72,19 +72,23 @@ export const createChatCompletionOpenAI = async (
options.advancedSettings?.temperature
)
const assistantMessageVariableName = typebot.variables.find(
(variable) =>
options.responseMapping.find(
(m) => m.valueToExtract === 'Message content'
)?.variableId === variable.id
)?.name
if (
isPlaneteScale() &&
isCredentialsV2(credentials) &&
newSessionState.isStreamEnabled &&
!newSessionState.whatsApp
!newSessionState.whatsApp &&
isNextBubbleMessageWithAssistantMessage(typebot)(
blockId,
assistantMessageVariableName
)
) {
const assistantMessageVariableName = typebot.variables.find(
(variable) =>
options.responseMapping.find(
(m) => m.valueToExtract === 'Message content'
)?.variableId === variable.id
)?.name
return {
clientSideActions: [
{
@@ -93,10 +97,6 @@ export const createChatCompletionOpenAI = async (
content?: string
role: (typeof chatCompletionMessageRoles)[number]
}[],
displayStream: isNextBubbleMessageWithAssistantMessage(typebot)(
blockId,
assistantMessageVariableName
),
},
expectsDedicatedReply: true,
},