agentskit.js
Examples

Code Assistant

Streaming code with syntax highlighting. AgentsKit's CodeBlock component renders code beautifully as it streams in.

Streaming code with syntax highlighting. AgentsKit's CodeBlock component renders code beautifully as it streams in.

I emit real fenced code blocks β€” ask for a snippet and Markdown will highlight it.

#With AgentsKit

import { useChat, ChatContainer, Message, CodeBlock, Markdown } from '@agentskit/react'

function CodeChat() {
  const chat = useChat({ adapter })
  return (
    <ChatContainer>
      {chat.messages.map(msg => (
        <Message key={msg.id} message={msg}>
          <Markdown content={msg.content} streaming={msg.status === 'streaming'} />
        </Message>
      ))}
      <InputBar chat={chat} placeholder="Ask about code..." />
    </ChatContainer>
  )
}

Explore nearby

✎ Edit this page on GitHubΒ·Found a problem? Open an issue β†’Β·How to contribute β†’

On this page