Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Vercel AI SDK for building AI-powered applications with streaming, tool calling, and multi-provider support.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/devtools.md
1---2title: AI SDK DevTools3description: Debug AI SDK calls by inspecting captured runs and steps.4---56# AI SDK DevTools78## Why Use DevTools910DevTools captures all AI SDK calls (`generateText`, `streamText`, `ToolLoopAgent`) to a local JSON file. This lets you inspect LLM requests, responses, tool calls, and multi-step interactions without manually logging.1112## Setup1314Requires AI SDK 6. Install `@ai-sdk/devtools` using your project's package manager.1516Wrap your model with the middleware:1718```ts19import { wrapLanguageModel, gateway } from 'ai';20import { devToolsMiddleware } from '@ai-sdk/devtools';2122const model = wrapLanguageModel({23model: gateway('anthropic/claude-sonnet-4.5'),24middleware: devToolsMiddleware(),25});26```2728## Viewing Captured Data2930All runs and steps are saved to:3132```33.devtools/generations.json34```3536Read this file directly to inspect captured data:3738```bash39cat .devtools/generations.json | jq40```4142Or launch the web UI:4344```bash45npx @ai-sdk/devtools46# Open http://localhost:498347```4849## Data Structure5051- **Run**: A complete multi-step interaction grouped by initial prompt52- **Step**: A single LLM call within a run (includes input, output, tool calls, token usage)53