Prompt Buddy logoPrompt Buddy

vercel · Vercel AI SDK Docs

AI SDK UI: Generative User Interfaces

Implements generative user interfaces by allowing LLMs to stream and render interactive React components directly within a chat interface.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

AI SDK UI: Generative User Interfaces

Implements generative user interfaces by allowing LLMs to stream and render interactive React components directly within a chat interface.

When To Use

Use when you need to build chat applications that render dynamic, interactive React components instead of just plain text or markdown based on model outputs.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/ai-sdk-ui-generative-user-interfaces-workflow-guide.mdA guide explaining how to build generative user interfaces by allowing large language models to generate UI components through tool calling.Questions about a guide explaining how to build generative user interfaces by allowing large language models to generate UI component...
examples/ai-sdk-ui-generative-user-interfaces-react-usechat.textA React client component demonstrating the use of the useChat hook to implement generative user interfaces within the AI SDK.Exact payloads, commands, or snippets shown in A React client component demonstrating the use of the useChat hook to implement generative user interfaces within the...
examples/ai-sdk-ui-generative-user-interfaces-nextjs-route-handler.textA Next.js route handler implementation using streamText to process UIMessages for generative user interfaces.Exact payloads, commands, or snippets shown in A Next.js route handler implementation using streamText to process UIMessages for generative user interfaces.
examples/ai-sdk-ui-generative-user-interfaces-tool-definition.textA TypeScript code example demonstrating how to define a weather tool using the AI SDK tool function and Zod schema for generative user interfaces.Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating how to define a weather tool using the AI SDK tool function and Zod schema fo...
examples/ai-sdk-ui-generative-user-interfaces-nextjs-route-handler-2.textA Next.js route handler implementation using streamText to process UIMessage arrays for generative user interfaces.Exact payloads, commands, or snippets shown in A Next.js route handler implementation using streamText to process UIMessage arrays for generative user interfaces.
examples/ai-sdk-ui-generative-user-interfaces-weather-component-typescript.textA TypeScript definition and React component for a Weather UI element used in generative user interfaces.Exact payloads, commands, or snippets shown in A TypeScript definition and React component for a Weather UI element used in generative user interfaces.
examples/ai-sdk-ui-generative-user-interfaces-react-usechat-weather-component.textA React client component demonstrating how to use the useChat hook to render dynamic weather components within a generative user interface.Exact payloads, commands, or snippets shown in A React client component demonstrating how to use the useChat hook to render dynamic weather components within a gene...
examples/ai-sdk-ui-generative-user-interfaces-stock-tool-definition.textA TypeScript code snippet defining a stock price tool using createTool for generative user interfaces.Exact payloads, commands, or snippets shown in A TypeScript code snippet defining a stock price tool using createTool for generative user interfaces.
examples/ai-sdk-ui-generative-user-interfaces-stock-component-typescript.textA TypeScript definition for a Stock component used to demonstrate generative user interfaces within the AI SDK UI.Exact payloads, commands, or snippets shown in A TypeScript definition for a Stock component used to demonstrate generative user interfaces within the AI SDK UI.
examples/ai-sdk-ui-generative-user-interfaces-react-usechat-2.textA React client component demonstrating how to use the useChat hook to render dynamic UI components like Weather and Stock based on AI responses.Exact payloads, commands, or snippets shown in A React client component demonstrating how to use the useChat hook to render dynamic UI components like Weather and S...

What This Skill Covers

  • Generative user interfaces (generative UI) is the process of allowing a large language model (LLM) to go beyond text and "generate UI". This creates a more e...
  • Main sections: Build a Generative UI Chat Interface, Basic Chat Implementation, Create a Tool, Update the API Route, Create UI Components.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://ai-sdk.dev/docs/ai-sdk-ui/generative-user-interfaces