Files
BrowserOS/packages/browseros-agent/.agents/skills/ai-sdk/references/devtools.md
Dani Akash 290ee91a8b Add 'packages/browseros-agent/' from commit '90bd4be3008285bf3825aad3702aff98f872671a'
git-subtree-dir: packages/browseros-agent
git-subtree-mainline: 8f148d0918
git-subtree-split: 90bd4be300
2026-03-13 21:22:09 +05:30

1.2 KiB

title, description
title description
AI SDK DevTools Debug AI SDK calls by inspecting captured runs and steps.

AI SDK DevTools

Why Use DevTools

DevTools 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.

Setup

Requires AI SDK 6. Install @ai-sdk/devtools using your project's package manager.

Wrap your model with the middleware:

import { wrapLanguageModel, gateway } from 'ai';
import { devToolsMiddleware } from '@ai-sdk/devtools';

const model = wrapLanguageModel({
  model: gateway('anthropic/claude-sonnet-4.5'),
  middleware: devToolsMiddleware(),
});

Viewing Captured Data

All runs and steps are saved to:

.devtools/generations.json

Read this file directly to inspect captured data:

cat .devtools/generations.json | jq

Or launch the web UI:

npx @ai-sdk/devtools
# Open http://localhost:4983

Data Structure

  • Run: A complete multi-step interaction grouped by initial prompt
  • Step: A single LLM call within a run (includes input, output, tool calls, token usage)