Skip to content

Commit

Permalink
fix: generating message is gone after switching to another thread
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan committed Dec 23, 2024
1 parent 365cdfa commit 7de6bdc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions web/helpers/atoms/ChatMessage.atom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,17 @@ export const updateMessageAtom = atom(
// Update thread last message
if (text.length)
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',
})
}
}
)

0 comments on commit 7de6bdc

Please sign in to comment.