LangSmithTelemetry(config: LangSmithTelemetryConfig): any| Name | Type | Description |
|---|---|---|
config | LangSmithTelemetryConfig |
Creates a LangSmith Telemetry for the Vercel AI SDK.
This adapter implements the Vercel AI SDK's Telemetry interface
and maps lifecycle events to LangSmith traces. It creates a root span for
the entire generation, child LLM spans for each step, and tool spans for
tool calls.
import { generateText, registerTelemetry } from "ai";
import { LangSmithTelemetry } from "langsmith/experimental/vercel";
registerTelemetry(LangSmithTelemetry());
const result = await generateText({
model: openai("gpt-4o"),
prompt: "Hello!",
});
Only available in Vercel AI SDK 7.