ai-sdk

Answers questions and builds AI features using current Vercel AI SDK documentation.

4|Updated Oct 24, 2025
One-click install
npx skills add https://github.com/sethdavis512/iridium --skill ai-sdk-sethdavis512
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ai-sdk
Source: https://github.com/sethdavis512/iridium/tree/main/.agents/skills/ai-sdk
Command: npx skills add https://github.com/sethdavis512/iridium --skill ai-sdk-sethdavis512

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ai, and includes references (resource) components.

What problem does it solve? The AI SDK evolves rapidly, and model training data contains outdated APIs, deprecated parameters, and incorrect usage patterns. This Skill forces verification against bundled package docs and live documentation so generated code uses current APIs like ToolLoopAgent, inputSchema, and toUIMessageStreamResponse instead of deprecated patterns. ## Core Features & Use Cases - Verified API usage: Searches node_modules/ai/docs and source code, falling back to ai-sdk.dev, so answers reflect the installed SDK version rather than stale memory. - Agent and chatbot building: Guides creation of ToolLoopAgent-based agents with type-safe useChat consumption via InferAgentUIMessage, plus framework-specific integration patterns. - Migration and error fixing: The common-errors reference maps deprecated APIs (maxTokens, maxSteps, parameters, generateObject, tool-invocation parts) to their current replacements. - Use Case: A developer asks to add streaming chat to a React app. The Skill checks the installed ai package docs, fetches current model IDs from the Vercel AI Gateway, and generates code using DefaultChatTransport and typed tool parts. ## Quick Start Ask the assistant to build an AI chat feature with the AI SDK and have it verify the current APIs against the installed package documentation before writing code.

Frequently Asked Questions about ai-sdk

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

FAQPage Schema
How do I build an agent with the Vercel AI SDK?▼

Use the ToolLoopAgent pattern with a model, instructions, and a tools object. Search node_modules/ai/docs for the current agent creation API, and export InferAgentUIMessage<typeof agent> for type-safe useChat consumption on the client.

How do I fix deprecated AI SDK parameters like maxTokens or maxSteps?▼

Replace maxTokens with maxOutputTokens, maxSteps with stopWhen: stepCountIs(n), and tool parameters with inputSchema. The common-errors reference documents each renamed API with before-and-after code examples.

Does useChat still manage input state in the AI SDK?▼

No, useChat no longer manages input state internally. Manage input with useState, pass a transport like new DefaultChatTransport({ api }), and call sendMessage({ text: input }) on submit.

Which model ID should I use with the AI SDK?▼

Never use model IDs from memory since they become outdated. Fetch the current list with curl https://ai-gateway.vercel.sh/v1/models, filter by provider prefix, and pick the highest version number available.

Why does my AI SDK TypeScript code fail after upgrading?▼

Upgrades rename APIs such as tool-invocation parts to typed tool-{toolName} parts, args to input, and result to output. Grep the common-errors reference for the failing property before searching source code.