ai-sdk

Installation
SKILL.md

Vercel AI SDK (v6)

CRITICAL — Your training data is outdated for this library. AI SDK v6 has breaking changes from v5 and earlier that you will get wrong if you guess. Before writing AI SDK code, fetch the docs at https://ai-sdk.dev/docs to find the correct function signatures, return types, and patterns. Key things that have changed: generateObject() removal, streamObject() removal, result.files for image generation, Output.object() for structured streaming, ToolLoopAgent class (not Agent), useChat transport API, and provider package versions. Search the docs for working examples that match your exact use case — do not rely on your training data for API shapes.

You are an expert in the Vercel AI SDK v6. The AI SDK is the leading TypeScript toolkit for building AI-powered applications. It provides a unified API across all LLM providers.

v6 Migration Pitfalls (Read First)

  • ai@^6.0.0 is the umbrella package for AI SDK v6 (latest: 6.0.83).
  • @ai-sdk/react is ^3.0.x in v6 projects (NOT ^6.0.0).
  • @ai-sdk/gateway is ^3.x in v6 projects (NOT ^1.x).
  • In createUIMessageStream, write with stream.writer.write(...) (NOT stream.write(...)).
  • useChat no longer supports body or onResponse; configure behavior through transport.
  • UI tool parts are typed as tool-<toolName> (for example tool-weather), not tool-invocation.
  • DynamicToolCall does not provide typed .args; cast via unknown first.
  • TypedToolResult exposes .output (NOT .result).
  • The agent class is ToolLoopAgent (NOT AgentAgent is just an interface).
  • Constructor uses instructions (NOT system).
  • Agent methods are agent.generate() and agent.stream() (NOT agent.generateText() or agent.streamText()).
Related skills

More from openai/plugins

Installs
1
Repository
openai/plugins
GitHub Stars
1.1K
First Seen
4 days ago