Documentation Index
Fetch the complete documentation index at: https://www.adaline.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
Vercel AI SDK
Use the Adaline Vercel AI integration to send Vercel AI SDK execution data into Adaline. You wrap the SDK functions you already call — such asgenerateText, streamText, generateObject, streamObject — or a Vercel AI agent, and the wrapper observes their model calls, tool calls, and steps. The package exposes two helpers:
wrapVercelAISDKto wrap SDK functionswrapVercelAIAgentto wrap an agent’sgenerateandstream
Prerequisites
Before you start, make sure you have:- An Adaline account.
- A workspace API key — create one under Settings → API keys.
- Your project ID — copy it from Monitor → Copy Project ID.
Install
ai package and the model-provider package your application already uses (for example @ai-sdk/openai) alongside the Adaline integration package.
Initialize Adaline
Create an Adaline client, then initialize a monitor for the target project.For production guidance — buffering, batching, retries, serverless flushing, and graceful shutdown — see Instrument with the Adaline SDK.
Wrap the Vercel AI SDK
Pass the SDK functions you want to observe towrapVercelAISDK. It returns wrapped versions with the same signatures, so the rest of your code stays unchanged.
Set
experimental_telemetry: { isEnabled: true } on your calls so the Vercel AI SDK emits the step and tool-call events the wrapper needs to build the full span tree.Wrap a Vercel AI agent
If you use a Vercel AI agent, wrap it withwrapVercelAIAgent. The wrapped agent exposes the same generate and stream methods.
Basic example
This example keeps the integration intentionally small: a single wrappedgenerateText call against OpenAI, with the trace flushed to Adaline at the end.
Use an existing parent trace or span
The wrapper accepts an existing Adaline parent context, so Vercel AI work can be attached under a trace or span you created earlier.parentTrace or parentSpan, but not both.
What the Vercel AI integration captures
The Vercel AI integration is designed to capture the execution structure of your wrapped calls, including:- a root operation trace for each wrapped call, tagged with the operation name, model provider, and model
- model step spans with provider, model, finish reason, and prompt, completion, and total token counts
- tool call spans with the tool input, output, duration, and success or failure status
- failures, which mark the root trace and any open tool spans as failed
Next steps
Instrument with the Adaline SDK
Monitor lifecycle, buffering and batching, retries, serverless flushing, and graceful shutdown.
SDK reference
Full class and type reference for the TypeScript and Python SDKs.
All integrations
Browse every framework and AI-provider integration Adaline supports.
View your logs
Open Adaline to see traces and spans land in your project.