import { InstrumentationConfig, InstrumentationBase, InstrumentationModuleDefinition } from '@opentelemetry/instrumentation'; type ImageUploadCallback = (traceId: string, spanId: string, filename: string, base64Data: string) => Promise; interface OpenAIInstrumentationConfig extends InstrumentationConfig { /** * Whether to log prompts, completions and embeddings on traces. * @default true */ traceContent?: boolean; /** * Whether to enrich token information if missing from the trace. * @default false */ enrichTokens?: boolean; /** * A custom logger to log any exceptions that happen during span creation. */ exceptionLogger?: (e: Error) => void; /** * Callback function for uploading base64-encoded images. * Used for image generation and vision capabilities. * @default undefined */ uploadBase64Image?: ImageUploadCallback; } declare class OpenAIInstrumentation extends InstrumentationBase { protected _config: OpenAIInstrumentationConfig; constructor(config?: OpenAIInstrumentationConfig); setConfig(config?: OpenAIInstrumentationConfig): void; manuallyInstrument(module: unknown): void; protected init(): InstrumentationModuleDefinition; private patch; private unpatch; private patchOpenAI; private startSpan; private _streamingWrapPromise; private _wrapPromise; private _endSpan; private _shouldSendPrompts; private _addLogProbsEvent; private _encodingCache; private tokenCountFromString; private _detectVendorFromURL; } export { OpenAIInstrumentation }; export type { ImageUploadCallback, OpenAIInstrumentationConfig };