2
0

🐛 (openai) Fix 2 openai streaming back to back

This commit is contained in:
Baptiste Arnaud
2023-10-12 13:59:03 +02:00
parent a48026c707
commit 42fd6037f7
8 changed files with 30 additions and 16 deletions

View File

@ -29,11 +29,18 @@ type ContextProps = {
state: SessionState
currentReply?: ChatReply
currentLastBubbleId?: string
firstBubbleWasStreamed?: boolean
}
export const executeGroup = async (
group: Group,
{ version, state, currentReply, currentLastBubbleId }: ContextProps
{
version,
state,
currentReply,
currentLastBubbleId,
firstBubbleWasStreamed,
}: ContextProps
): Promise<ChatReply & { newSessionState: SessionState }> => {
const messages: ChatReply['messages'] = currentReply?.messages ?? []
let clientSideActions: ChatReply['clientSideActions'] =
@ -44,10 +51,13 @@ export const executeGroup = async (
let newSessionState = state
let index = -1
for (const block of group.blocks) {
index++
nextEdgeId = block.outgoingEdgeId
if (isBubbleBlock(block)) {
if (firstBubbleWasStreamed && index === 0) continue
messages.push(
parseBubbleBlock(block, {
version,