import { Readable } from "node:stream";
import { LLMEngine } from "@infersec/definitions";
import { Logger } from "@infersec/logger";
export interface EngineUsageMetrics {
    completionTokens: number | null;
    contextUsage: number | null;
    promptTokens: number | null;
    totalTokens: number | null;
}
interface EngineMetricsLoggerOptions {
    agentEngineType: LLMEngine;
    logger: Logger;
    requestBodyBytes: number;
    requestPath: string;
}
interface EngineMetricsCompletion {
    durationMs: number;
    error: Error | null;
    requestBodyBytes: number;
    responseBytes: number;
    timeToFirstTokenMs: number | null;
    usage: EngineUsageMetrics | null;
}
interface MonitorEngineResponseOptions extends EngineMetricsLoggerOptions {
    body: Readable;
    contextLength: number | null;
    engine: LLMEngine;
    onComplete?: (result: EngineMetricsCompletion) => void | Promise<void>;
    parallelism: number | null;
    requestStartedAt?: number;
}
interface EngineMetricsLogOptions extends EngineMetricsLoggerOptions {
    error?: Error;
    level: "info" | "error";
    responseBytes: number;
    usage?: EngineUsageMetrics | null;
}
interface MonitorEngineResponseResult {
    stream: Readable;
}
export declare function monitorEngineResponseStream({ agentEngineType, body, contextLength, engine, logger, onComplete, parallelism, requestBodyBytes, requestPath, requestStartedAt }: MonitorEngineResponseOptions): MonitorEngineResponseResult;
export declare function monitorEngineResponseSingle({ agentEngineType, body, contextLength, engine, logger, onComplete, parallelism, requestBodyBytes, requestPath, requestStartedAt }: MonitorEngineResponseOptions): MonitorEngineResponseResult;
export declare function logEngineMetrics({ agentEngineType, error, level, logger, requestBodyBytes, requestPath, responseBytes, usage }: EngineMetricsLogOptions): void;
export {};
