agentskit.js
Examples

Basic Chat

The simplest use case — streaming AI conversation with auto-scroll, stop button, and keyboard handling. All in 10 lines with AgentsKit.

The simplest use case — streaming AI conversation with auto-scroll, stop button, and keyboard handling. All in 10 lines with AgentsKit.

AgentsKit — BasicChat
Assistant
Hi! I'm your AI assistant. Ask me anything about streaming, React hooks, or how AgentsKit works under the hood.

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>
  )
}
✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page