@temporalio/vercel-ai-sdk
v1.0.0
Published
Temporal AI SDK integration package
Readme
Temporal Vercel AI SDK integration
Release stage: Generally Available.
Run Vercel AI SDK agents as durable Temporal Workflows. Model and MCP requests execute as Activities so Temporal can record results, retry failures and replay completed calls.
// Worker setup
import { AiSdkPlugin } from '@temporalio/vercel-ai-sdk';
import { openai } from '@ai-sdk/openai';
const plugins = [new AiSdkPlugin({ modelProvider: openai })];// Workflow code
import { generateText } from 'ai';
import { temporalProvider } from '@temporalio/vercel-ai-sdk/workflow';
export async function answer(prompt: string): Promise<string> {
const result = await generateText({
model: temporalProvider.languageModel('gpt-4o-mini'),
prompt,
});
return result.text;
}Register plugins with the Temporal Worker. Provider credentials belong in the
Worker environment. See the integration guide
for model, tool, streaming and MCP configuration. That guide currently uses the
SDK-owned @temporalio/ai-sdk name; this repository owns the new
@temporalio/vercel-ai-sdk coordinate.
Development and migration details are in typescript/README.md.
