AI Chatbot SDK
stackfoundry/ai-chatbot-sdkFreeBlock
Vercel AI SDK and AI Elements chatbot shell for a source-owned conversational interface.
Install it
npx shadcn@latest add https://stackfoundry.dev/r/ai-chatbot-sdk.jsonSource
1"use client";23import { useChat } from "@ai-sdk/react";4import { DefaultChatTransport } from "ai";5import { useMemo, useState } from "react";67import { AIConversation, AIMessage, AIPromptInput, AIStatus } from "@/components/ai-elements";89export function ChatbotShell() {10 const [input, setInput] = useState("");11 const transport = useMemo(() => new DefaultChatTransport({ api: "/api/ai/chat" }), []);12 const { messages, sendMessage, status } = useChat({ transport });13 const disabled = status === "submitted" || status === "streaming";1415 function submit() {16 const text = input.trim();17 if (!text || disabled) return;18 sendMessage({ text });19 setInput("");20 }2122 return (23 <AIConversation>24 {messages.map((message) => (25 <AIMessage key={message.id} message={message} />26 ))}27 <AIStatus status={status} />28 <AIPromptInput disabled={disabled} value={input} onSubmit={submit} onValueChange={setInput} />29 </AIConversation>30 );31}
What it pulls in
npm packages
Other registry items
Files it writes
More from stackfoundry
All 157 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Account Deletionaccount-deletion | stackfoundry | Blocks | Free | no deps · 3 files | |
| Account Modesaccount-modes | stackfoundry | Blocks | Free | no deps · 3 files | |
| Account Settingsaccount-settings | stackfoundry | Blocks | Free | no deps · 2 files | |
| Admin Consoleadmin-console | stackfoundry | Blocks | Free | no deps · 2 files | |
| Agent-Ready Installsagent-ready-installs | stackfoundry | Blocks | Free | no deps · 13 files | |
| AI Chatai-chat | stackfoundry | Blocks | Free | 3 deps · 4 files | |
| AI Elementsai-elements | stackfoundry | Blocks | Free | no deps · 5 files | |
| AI SDKai-sdk | stackfoundry | Blocks | Free | 2 deps · 2 files |
