UNPKG

ai

Version:

AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.

21 lines (17 loc) 343 B
import { Tracer, trace } from '@opentelemetry/api'; import { noopTracer } from './noop-tracer'; export function getTracer({ isEnabled = false, tracer, }: { isEnabled?: boolean; tracer?: Tracer; } = {}): Tracer { if (!isEnabled) { return noopTracer; } if (tracer) { return tracer; } return trace.getTracer('ai'); }