2
0

🐛 Fix openai total tokens variable set when streaming

This commit is contained in:
Baptiste Arnaud
2024-07-17 14:47:12 +02:00
parent 0ee820b4da
commit c6645d4505
8 changed files with 72 additions and 45 deletions

View File

@@ -3,7 +3,7 @@ import { ChatCompletionOpenAIOptions } from '@typebot.io/schemas/features/blocks
import { OpenAI } from 'openai'
import { decryptV2 } from '@typebot.io/lib/api/encryption/decryptV2'
import { forgedBlocks } from '@typebot.io/forge-repository/definitions'
import { VariableStore } from '@typebot.io/forge'
import { AsyncVariableStore } from '@typebot.io/forge'
import {
ParseVariablesOptions,
parseVariables,
@@ -104,7 +104,7 @@ export const getMessageStream = async ({
credentials.iv
)
const variables: VariableStore = {
const variables: AsyncVariableStore = {
list: () => session.state.typebotsQueue[0].typebot.variables,
get: (id: string) => {
const variable = session.state.typebotsQueue[0].typebot.variables.find(