ai-sdk

Guide developers on using the Vercel AI SDK for text generation and streaming.

1|Updated Feb 1, 2026
One-click install
npx skills add https://github.com/dopiotrek/dotclaude --skill ai-sdk-dopiotrek
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-sdk
Source: https://github.com/dopiotrek/dotclaude/tree/main/skills/ai-sdk
Command: npx skills add https://github.com/dopiotrek/dotclaude --skill ai-sdk-dopiotrek

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers build AI-powered features by providing guidance on using the Vercel AI SDK, including agents, chatbots, RAG systems, and text generation.

Core Features & Use Cases

  • AI SDK Usage: Answers questions about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, and tools.
  • AI Feature Development: Assists in building AI agents, chatbots, RAG systems, and text generation features.
  • Provider & Streaming Support: Provides information on AI providers (OpenAI, Anthropic, Google), streaming, tool calling, structured output, and embeddings.
  • React Hooks: Guides on using React hooks like useChat or useCompletion.

Quick Start

Use the ai-sdk skill to find documentation on how to use the useChat hook.

Frequently Asked Questions about ai-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a chatbot using the Vercel AI SDK and React?

To build a chatbot with the Vercel AI SDK, use the `useChat` React hook to manage chat state and stream responses from AI providers like OpenAI or Anthropic directly to your frontend components.

What is the difference between generateText and streamText in AI SDK?

The `generateText` function in the AI SDK returns a complete text response at once, while `streamText` sends the generated text in chunks as it is produced, enabling real-time streaming UI updates.

Can I use the Vercel AI SDK to create AI agents that call tools?

Yes, the Vercel AI SDK supports agent creation and tool usage. You can use functions like `ToolLoopAgent` to define tools and allow the AI model to automatically call them based on user prompts.

How do I generate structured output with the Vercel AI SDK?

The Vercel AI SDK allows you to generate structured output by defining schemas that the AI model must follow, ensuring the response is returned as formatted JSON instead of plain text.

Does the Vercel AI SDK support embeddings for RAG systems?

Yes, the Vercel AI SDK provides the `embed` function to generate vector embeddings, which are essential for building Retrieval-Augmented Generation (RAG) systems and semantic search features.

Which AI providers are compatible with the Vercel AI SDK?

The Vercel AI SDK integrates with multiple AI providers including OpenAI, Anthropic, and Google, allowing you to easily switch between different models for text generation and streaming tasks.