import { type LLMProviders, type LLMPurposes, type LLMServiceByPurpose, type LLMServiceOptions } from './LLMService.typedefs'; import { type LLMGatewayOptions } from './LLMGateway.typedefs'; import { type LLMReporterInterface } from './utilities/reporter'; import { type LLMFallbackMetricDimensions, type LLMGatewayTracer, type LLMTraceContext } from './utilities/llmTracing'; /** * An explicitly constructed gateway: every service it hands out is wired to the * tracer this instance was built with. `LLMServiceFactory` stays available for * call sites that want no tracing, so nothing depends on process-wide state. */ export declare class LLMGateway { private readonly tracer; private readonly fallbackMetricEmitter; constructor(options?: LLMGatewayOptions); getCompletionService | undefined = undefined>(options: LLMServiceOptions): LLMServiceByPurpose[LLMPurposes.Completion]; getAssistanceService | undefined>(options: LLMServiceOptions): LLMServiceByPurpose[LLMPurposes.Assistance]; getSpeechToTextService | undefined>(options: LLMServiceOptions): LLMServiceByPurpose[LLMPurposes.SpeechToText]; getTextToSpeechService | undefined>(options: LLMServiceOptions): LLMServiceByPurpose[LLMPurposes.TextToSpeech]; getTracer(): LLMGatewayTracer; /** * Starts a trace around `fn`; every gateway call inside nests into it. */ withTrace(name: string, context: LLMTraceContext, fn: () => Promise): Promise; /** * Flushes buffered traces. Serverless handlers call this on completion; the * long-running API calls it from its shutdown hook only. */ flush(): Promise; emitFallbackServed(dimensions: LLMFallbackMetricDimensions): void; private traced; }