Skip to main content
@usenarrator/plugin-ai-sdk The AI SDK plugin reads model calls as requests: which model is asked, with what instructions and prompt, which tools it may use, and what your code takes from the result. It covers text and object generation, streaming, tools and agents, providers and middleware, and the React hooks.
The plugin declares library: { name: "ai", versions: ">=6 <8" } and only narrates files that import from ai or an @ai-sdk/* package, or belong to a package that depends on ai (see Dependency detection); that dependency’s major picks the v6 or v7 reading unless version is pinned.

Examples

Generating text
English
A chat route with a tool
English
Structured output
English

AI SDK 6 and 7

Some names changed meaning in AI SDK 7. For example, usage and toolCalls on a multi-step result cover only the final step in version 6 and every step in version 7. In auto mode the plugin avoids saying which steps a value covers. Pin version: 6 or version: 7 to get the precise reading. See Plugin versioning.

What it covers

  • generateText, streamText, generateObject, streamObject, structured output, tool choice and stop conditions.
  • Tools defined with tool() and inline, agents, and callbacks such as onFinish and onChunk.
  • Embeddings, image generation, transcription and speech.
  • Providers, custom providers, registries and middleware.
  • Stream responses for route handlers and the loops that read streams.
  • The UI hooks useChat, useCompletion and useObject, and the functions they return.

Translating

The English phrasebook is exported as en and typed as AiSdkPhrases.