import { CostRecordInput } from "./types.js"; import { CostTracker } from "./cost-tracker.js"; //#region src/cost/delegate.d.ts /** * Structural mirror of the info object `withCostTracking`'s `onUsage` * hook receives (no provider dependency). * * @stable */ interface ProviderUsageInfoLike { readonly modelId: string; readonly promptTokens: number; readonly completionTokens: number; readonly cachedReadTokens?: number; readonly cacheWriteTokens?: number; readonly costUsd: number; } /** * Attribution ids for one recorded call. `spanId` is mandatory (the * tracker keys rollups on it); everything else is optional scope * attribution. * * @stable */ type CostTrackerDelegateIds = Pick; /** * Build an `onUsage` callback that records into `tracker`. Pass either * static ids (a provider instance bound to one session) or a resolver * invoked per call (a shared provider serving many runs). A zero * `costUsd` records token figures WITHOUT a cost so a price-less * middleware does not fabricate a $0 USD cost entry. * * @stable */ declare function costTrackerUsageDelegate(tracker: Pick, ids: CostTrackerDelegateIds | ((info: ProviderUsageInfoLike) => CostTrackerDelegateIds)): (info: ProviderUsageInfoLike) => void; //#endregion export { CostTrackerDelegateIds, ProviderUsageInfoLike, costTrackerUsageDelegate }; //# sourceMappingURL=delegate.d.ts.map