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.

18 lines (15 loc) 523 B
import type { TelemetryIntegration } from './telemetry-integration'; /** * Registers a telemetry integration globally. */ export function registerTelemetryIntegration( integration: TelemetryIntegration, ): void { if (!globalThis.AI_SDK_TELEMETRY_INTEGRATIONS) { globalThis.AI_SDK_TELEMETRY_INTEGRATIONS = []; } globalThis.AI_SDK_TELEMETRY_INTEGRATIONS.push(integration); } export function getGlobalTelemetryIntegrations(): TelemetryIntegration[] { return globalThis.AI_SDK_TELEMETRY_INTEGRATIONS ?? []; }