Basic Chat
The simplest use case — streaming AI conversation with auto-scroll, stop button, and keyboard handling. All in 10 lines with AgentsKit.
With AgentsKit
import { useChat, ChatContainer, Message, InputBar } from '@agentskit/react'
import { anthropic } from '@agentskit/adapters'
import '@agentskit/react/theme'
function Chat() {
const chat = useChat({ adapter: anthropic({ apiKey: 'key', model: 'claude-sonnet-4-6' }) })
return (
<ChatContainer>
{chat.messages.map(msg => <Message key={msg.id} message={msg} />)}
<InputBar chat={chat} />
</ChatContainer>
)
}