SolvedAwareConsumptionMetric

@SerialName(value = "solvedAwareConsumption")
data class SolvedAwareConsumptionMetric(val key: MetricKey<SolvedAwareConsumptionMetric> = KEY, val totalSolvedConsumption: LLMConsumptionOrNA = LLMConsumptionOrNA.NA, val avgPerSolved: Double? = null, val minPerSolved: Double? = null, val maxPerSolved: Double? = null, val averageSolvedCost: Double? = null, val withRetries: ConsumptionWithRetries? = null) : Metric

Solved-aware consumption metric for dataset iterations.

Tracks total LLM consumption split by solved/not-solved, plus per-substage and per-solved aggregations (min, max, avg). Also computes averageSolvedCost: total consumption divided by the number of solved items.

Important: tracks the consumption of all substages (including optimizer substages), not just agent runs. Consider AgentRunStatsMetric if you need agent-specific stats.

Only meaningful on stages created by iterateDataset, where each direct substage represents a dataset item whose solved/not-solved status is known.

The canonical fields above carry the final-attempt view (research signal). When any leaf below has performed retries, a withRetries sub-object is also emitted carrying the *WithRetries / *InRetries totals — auxiliary metrics that quantify the cluster-cost overhead of retries.

Constructors

Link copied to clipboard
constructor(key: MetricKey<SolvedAwareConsumptionMetric> = KEY, totalSolvedConsumption: LLMConsumptionOrNA = LLMConsumptionOrNA.NA, avgPerSolved: Double? = null, minPerSolved: Double? = null, maxPerSolved: Double? = null, averageSolvedCost: Double? = null, withRetries: ConsumptionWithRetries? = null)

Types

Link copied to clipboard

Properties

Link copied to clipboard

Total consumption across all finished items divided by the number of solved items, or null if none solved.

Link copied to clipboard
val avgPerSolved: Double? = null

Mean per-item total cost across solved items, or null if none.

Link copied to clipboard
@Transient
open override val key: MetricKey<SolvedAwareConsumptionMetric>

The key that identifies this metric in a ai.koog.agents.optimization.training.metrics.MetricsMap.

Link copied to clipboard
val maxPerSolved: Double? = null

Largest per-item total cost across solved items, or null if none.

Link copied to clipboard
val minPerSolved: Double? = null

Smallest per-item total cost across solved items, or null if none.

Link copied to clipboard

Total LLM consumption across solved (and not failed) finished items, or NA if none.

Link copied to clipboard

Retries-aware totals. null when no retries fired anywhere under this dataset iteration — the serializer omits the sub-object in that case.

Functions

Link copied to clipboard
open override fun recompute(currentStage: StageRecord, substages: List<TrainingRecord>, isStageUpdate: Boolean): SolvedAwareConsumptionMetric

Recompute this metric from the full list of substages records.