`useChat` response message ID changes during streaming when `streamMode: "text"`
Yonom opened this issue · comments
Simon Farshid commented
Description
When useChat
's streamMode
is set to "text"
, the ID of the response message seems to change on each intermediate stream result.
Expectation: The message ID should be stable, since the result represents the same message. The behavior should be consistent between the two streamMode
variants
The following is the output from the code example:
Code example
const TestButton = () => {
const chat = useChat({ streamMode: "text" });
const handleAdd = () => {
chat.append({
role: "user",
content: "hii"
});
};
console.log(chat.messages);
return <button onClick={handleAdd}>Add test message</button>
}
Additional context
No response
Lars Grammel commented
Simon Farshid commented
Thanks!