import { MetadataOptions } from './tracing/types.js'; /** * Morph Tracing — Vercel AI SDK helper. * * The Vercel AI SDK emits its own OpenTelemetry spans when you pass * `experimental_telemetry`. There is nothing to monkey-patch; instead you tag * each call with `metadata()` so Morph can attribute the resulting spans to a * user/conversation/event. * * @example * ```ts * import { generateText } from "ai"; * import { metadata } from "@morphllm/morphsdk/tracing/otel"; * * const res = await generateText({ * model: openai("gpt-4o"), * prompt: "Hello!", * experimental_telemetry: { * isEnabled: true, * metadata: metadata({ userId: "user-123", convoId: "convo-456" }), * }, * }); * ``` */ /** * Build the metadata object for the Vercel AI SDK's * `experimental_telemetry.metadata`. The values are propagated to every span the * AI SDK creates for that call. Generate a fresh `eventId` per call for grouping. */ declare function metadata(opts: MetadataOptions): Record; declare const _default: { metadata: typeof metadata; }; declare const otel_metadata: typeof metadata; declare namespace otel { export { _default as default, otel_metadata as metadata }; } export { _default as _, metadata as m, otel as o };