When submitting the model parameter in the useChat body, the received value is not the latest。@tanstack/ai-react
const chatOptions = React.useMemo(
() =>
createChatClientOptions({
id: `${model}_${new Date().getTime()}`,
connection: fetchServerSentEvents('/api/tanchat'),
body: { model },
// todo Tools
}),
[model],
)
console.log("🚀 ~ AiChat ~ chatOptions:", chatOptions)
const {
messages,
sendMessage,
isLoading: isStreaming,
stop,
// reload,
clear
} = useChat(chatOptions)