fix: generating message is gone after switching to another thread (#4321)
This commit is contained in:
parent
9c4dcd38a8
commit
171dad1eca
@ -175,6 +175,17 @@ export const updateMessageAtom = atom(
|
|||||||
// Update thread last message
|
// Update thread last message
|
||||||
if (text.length)
|
if (text.length)
|
||||||
set(updateThreadStateLastMessageAtom, conversationId, text)
|
set(updateThreadStateLastMessageAtom, conversationId, text)
|
||||||
|
} else {
|
||||||
|
set(addNewMessageAtom, {
|
||||||
|
id,
|
||||||
|
thread_id: conversationId,
|
||||||
|
content: text,
|
||||||
|
status,
|
||||||
|
role: ChatCompletionRole.Assistant,
|
||||||
|
created_at: Date.now() / 1000,
|
||||||
|
completed_at: Date.now() / 1000,
|
||||||
|
object: 'thread.message',
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user