🐛 (openai) Fix streaming when starting with OpenAI block
This commit is contained in:
@@ -175,11 +175,12 @@ const startSession = async (startParams?: StartParams, userId?: string) => {
|
|||||||
const { messages, input, clientSideActions, newSessionState, logs } =
|
const { messages, input, clientSideActions, newSessionState, logs } =
|
||||||
await startBotFlow(initialState, startParams.startGroupId)
|
await startBotFlow(initialState, startParams.startGroupId)
|
||||||
|
|
||||||
const containsSetVariableClientSideAction = clientSideActions?.some(
|
const clientSideActionsNeedSessionId = clientSideActions?.some(
|
||||||
(action) => 'setVariable' in action
|
(action) =>
|
||||||
|
'setVariable' in action || 'streamOpenAiChatCompletion' in action
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!input && !containsSetVariableClientSideAction)
|
if (!input && !clientSideActionsNeedSessionId)
|
||||||
return {
|
return {
|
||||||
messages,
|
messages,
|
||||||
clientSideActions,
|
clientSideActions,
|
||||||
|
|||||||
Reference in New Issue
Block a user