/** * Worker-measured timing of one streamed model call, in whole milliseconds. * Stored on the call's `agent.model.usage` event and its `model_call_facts` * row so speed (time to first token, duration, output tokens per second) can be * analysed later. Every field is null when it was not observed: a call with no * streamed text has no time to first text, and a provider that reports no * dispatch has no timing at all. */ export type ModelCallTiming = { /** Opengeni work from SDK model entry (including waiting for the previous * response to settle) to the call's first literal provider dispatch. */ preDispatchMs: number | null; /** First dispatch to the first streamed reasoning or answer fragment. */ timeToFirstTokenMs: number | null; /** First dispatch to the first streamed answer text fragment. */ timeToFirstTextMs: number | null; /** First dispatch to the terminal response, as read by the worker. A call * that needed a transport retry or a provider continuation includes them. */ durationMs: number | null; }; /** * Accept only whole, non-negative millisecond values; anything else becomes * null. Timing is observational, so a malformed value never fails a fact. */ export declare function modelCallTimingOrNull(value: unknown): ModelCallTiming | null; /** The `model_call_facts` columns for a call's timing (all null when absent). */ export declare function modelCallTimingColumns(timing: ModelCallTiming | null): { preDispatchMs: number | null; timeToFirstTokenMs: number | null; timeToFirstTextMs: number | null; durationMs: number | null; };