Package-level declarations
Types
Serializes ConsumptionMetric with min / max / avg-per-substage emitted as formatted strings ("N,NNN.NN tokens" / "N,NNN.NN credits") carrying the unit from totalConsumption. The kotlinx default would emit the aggregates as bare Doubles without a unit suffix and without thousand separators.
A wrapper class to serialize nullable consumption properly.
Serializes LLMConsumptionOrNA as "n/a" for LLMConsumptionOrNA.NA, or the wrapped consumption otherwise. JSON only.
Serializes a Duration as a second-rounded, human-readable string (e.g. "1h 2m 3s") via pretty, and parses it back with parsePrettyDuration. Sub-second precision is lost on round-trip.
Serializes SolvedAwareConsumptionMetric with all per-solved aggregates emitted as formatted strings carrying the unit from totalSolvedConsumption. Mirrors ConsumptionMetricSerializer for the solved-aware variant attached to iterateDataset stages.
Functions
Formats this duration as a second-rounded string with h/m/s components (e.g. "1h 2m 3s", "2m 3s", "3s"), omitting leading zero components. Negative durations are prefixed with -, and Duration.ZERO renders as "0s".
Sums the present consumption values in consumptions, skipping LLMConsumptionOrNA.NA entries. Returns LLMConsumptionOrNA.NA when no value is present.