import type { Tracer, TracerProvider } from "@opentelemetry/api"; import type { InstrumentationConfig, InstrumentationModuleDefinition } from "@opentelemetry/instrumentation"; import { InstrumentationBase } from "@opentelemetry/instrumentation"; import type openai from "openai"; import type { TraceConfigOptions } from "@arizeai/openinference-core"; import { LLMProvider } from "@arizeai/openinference-semantic-conventions"; /** * Maps hostname suffixes to their corresponding LLM provider value. */ export declare const HOST_SUFFIX_TO_PROVIDER: Record; /** * Return the LLM provider name for the given API hostname. */ export declare function getProviderFromHost(host: string): LLMProvider | undefined; /** * function to check if instrumentation is enabled / disabled */ export declare function isPatched(): boolean; /** * An auto instrumentation class for OpenAI that creates {@link https://github.com/Arize-ai/openinference/blob/main/spec/semantic_conventions.md|OpenInference} Compliant spans for the OpenAI API * @param instrumentationConfig The config for the instrumentation @see {@link InstrumentationConfig} * @param traceConfig The OpenInference trace configuration. Can be used to mask or redact sensitive information on spans. @see {@link TraceConfigOptions} */ export declare class OpenAIInstrumentation extends InstrumentationBase { private oiTracer; private tracerProvider?; private traceConfig?; constructor({ instrumentationConfig, traceConfig, tracerProvider, }?: { /** * The config for the instrumentation * @see {@link InstrumentationConfig} */ instrumentationConfig?: InstrumentationConfig; /** * The OpenInference trace configuration. Can be used to mask or redact sensitive information on spans. * @see {@link TraceConfigOptions} */ traceConfig?: TraceConfigOptions; /** * An optional custom trace provider to be used for tracing. If not provided, a tracer will be created using the global tracer provider. * This is useful if you want to use a non-global tracer provider. * * @see {@link TracerProvider} */ tracerProvider?: TracerProvider; }); protected init(): InstrumentationModuleDefinition; /** * Manually instruments the OpenAI module. This is needed when the module is not loaded via require (commonjs) * @param {openai} module */ manuallyInstrument(module: typeof openai): void; get tracer(): Tracer; setTracerProvider(tracerProvider: TracerProvider): void; /** * Patches the OpenAI module */ private patch; /** * Un-patches the OpenAI module's chat completions API */ private unpatch; } //# sourceMappingURL=instrumentation.d.ts.map