@bonaroo/use-chat
v0.1.1
Published
UseChat is a simple HTTP component that can be embedded on any webpage. You can use this component to connect to a Vercel AI SDK compatible AI agent.
Readme
USE CHAT
UseChat is a simple HTTP component that can be embedded on any webpage. You can use this component to connect to a Vercel AI SDK compatible AI agent.
Usage
For this example, I'm using our serve-ai app as a server:
<use-chat api="http://localhost:4999/api/chat" id="my-chat"></use-chat>This will render a chat, automatically connected to the given API URL.
You can have any amount of chats on a page, as long as their IDs are unique. The ID is used to persist messages client-side.
Be sure to add the script & css to your HTML somewhere:
<script src="https://unpkg.com/@bonaroo/[email protected]/public/assets/use-chat.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@bonaroo/[email protected]/public/assets/use-chat.min.css">