Help us improve
Share bugs, ideas, or general feedback.
From vercel-ai-sdk-knowledge-patch
Provides knowledge patch for Vercel AI SDK 4.0-4.1 features: PDF support, computer use tools, continuation, image generation, stream smoothing, tool repair. Load before AI SDK tasks.
npx claudepluginhub nevaberry/nevaberry-plugins --plugin vercel-ai-sdk-knowledge-patchHow this skill is triggered — by the user, by Claude, or both
Slash command
/vercel-ai-sdk-knowledge-patch:vercel-ai-sdk-knowledge-patchThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Claude Opus 4.6 knows AI SDK through 3.x. It is **unaware** of the features below, which cover AI SDK 4.0 (2024-11-18) through 4.1 (2025-01-20).
Provides expert guidance on Vercel AI SDK for building AI features like chat interfaces, text generation, structured output, tool calling, agents, streaming, embeddings, reranking, image generation, and LLM providers.
Delivers production-ready backend AI using Vercel AI SDK v5 for text generation, structured output, tools, agents with multi-provider support (OpenAI, Anthropic, Google). Resolves errors like AI_APICallError and streaming issues.
Provides expertise on Vercel AI SDK for React/Next.js apps: core APIs (generateText, streamText, generateObject), UI hooks (useChat, useCompletion), tool calling, streaming responses, and structured data generation.
Share bugs, ideas, or general feedback.
Claude Opus 4.6 knows AI SDK through 3.x. It is unaware of the features below, which cover AI SDK 4.0 (2024-11-18) through 4.1 (2025-01-20).
| Topic | Reference | Key features |
|---|---|---|
| 4.0 & 4.1 features | references/ai-sdk-4-features.md | PDF files, computer use tools, continuation, image generation, stream smoothing, createDataStreamResponse, tool context/repair, structured outputs with tools, new providers |
Send PDFs as file type in message content:
const result = await generateText({
model: anthropic('claude-3-5-sonnet-20241022'),
messages: [{
role: 'user',
content: [
{ type: 'text', text: 'Summarize this.' },
{ type: 'file', data: fs.readFileSync('./doc.pdf'), mimeType: 'application/pdf' },
],
}],
});
Works with Anthropic, Google Generative AI, and Vertex AI.
Anthropic tools accessible via anthropic.tools:
const computerTool = anthropic.tools.computer_20241022({
displayWidthPx: 1920, displayHeightPx: 1080,
execute: async ({ action, coordinate, text }) => { /* implement actions */ },
experimental_toToolResultContent: (result) => /* format result */,
});
await generateText({
model: anthropic('claude-3-5-sonnet-20241022'),
tools: { computer: computerTool },
maxSteps: 10,
});
Also: anthropic.tools.textEditor_20241022(), anthropic.tools.bash_20241022().
Auto-continue when generation hits length limit:
await generateText({
model: openai('gpt-4o'),
maxSteps: 5,
experimental_continueSteps: true,
prompt: 'Write a long essay...',
});
import { experimental_generateImage as generateImage } from 'ai';
import { replicate } from '@ai-sdk/replicate';
const { image } = await generateImage({
model: replicate.image('black-forest-labs/flux-1.1-pro-ultra'),
prompt: 'A cityscape at sunset',
size: '16:9',
n: 3,
});
// image.base64, image.uint8Array
Providers: replicate.image(), openai.image(), vertex.image(), fireworks.image().
import { smoothStream, streamText } from 'ai';
const result = streamText({
model, prompt,
experimental_transform: smoothStream(),
});
Stream custom data before/alongside LLM output:
import { createDataStreamResponse, streamText } from 'ai';
return createDataStreamResponse({
execute: async (dataStream) => {
dataStream.writeData({ type: 'source', url: '...' });
const result = streamText({ model, messages });
result.mergeIntoDataStream(dataStream);
},
});
Execute context: execute(args, { toolCallId, messages, abortSignal }).
Tool call repair:
await generateText({
model, tools, prompt,
experimental_repairToolCall: async ({ toolCall, tools, parameterSchema, error }) => {
if (NoSuchToolError.isInstance(error)) return null;
const { object } = await generateObject({ model, schema: tools[toolCall.toolName].parameters, prompt: '...' });
return { ...toolCall, args: JSON.stringify(object) };
},
});
Structured outputs with tools via experimental_output: Output.object({ schema }) (OpenAI only).
| Package | Provider |
|---|---|
@ai-sdk/xai | xAI Grok |
@ai-sdk/groq | Groq |
@ai-sdk/replicate | Replicate (image) |
@ai-sdk/fireworks | Fireworks (language + image) |
@ai-sdk/deepinfra | DeepInfra |
@ai-sdk/deepseek | DeepSeek |
@ai-sdk/cerebras | Cerebras |
| File | Contents |
|---|---|
| ai-sdk-4-features.md | Complete API reference for all 4.0 and 4.1 features with full code examples |