Vercel AI SDK Provider

Vercel AI SDK allows you to configure an optional async execute function that the framework uses to execute the tool calls.

The Vercel provider for Composio formats the Composio tools and adds this execute function to the tool calls.

Setup

Vercel AI SDK and the provider are only available for the TypeScript SDK.

TypeScript
1npm install @composio/vercel

You can specify and import the provider in the constructor.

TypeScript
1import { Composio } from "@composio/core";
2import { VercelProvider } from "@composio/vercel";
3
4const composio = new Composio({
5 provider: new VercelProvider(),
6});

Usage

TypeScript
1const tools = await composio.tools.get(userId, "GMAIL_SEND_EMAIL");
2
3const { text } = await generateText({
4 model: anthropic("claude-3-7-sonnet-20250219"),
5 messages: [
6 {
7 role: "user",
8 content:
9 "Send an email to sid@composio.dev saying how 'hi from the ether of composio'",
10 },
11 ],
12 tools,
13 maxSteps: 5,
14});
15
16console.log(text);