Closed
Description
Description
I'm using a key to refresh useChat and it's non-reactive with new initialMessages:
Code example
const { messages, input, handleInputChange, handleSubmit } = useChat({
initialMessages: gptMessages as Message[],
onFinish,
key: chatMode,
});
Additional context
chatMode is changing dynamically to refresh the session but the initialMessages don't update.