function ChatPage() {
const { messages, input, setInput, sendMessage, isLoading } = useChat('support-bot');
return (
<div>
{messages.map(m => <div key={m.id}>{m.role}: {m.content}</div>)}
<input value={input} onChange={e => setInput(e.target.value)} />
<button onClick={() => sendMessage()} disabled={isLoading}>Send</button>
</div>
);
}
React hook for AI chat with streaming, memory, and history.