SubstageCountMetric

@Serializable
@SerialName(value = "substageCount")
data class SubstageCountMetric(val key: MetricKey<SubstageCountMetric> = KEY, val finished: Int = 0, val completed: Int = 0, val failed: Int = 0, val completedRatio: Ratio = Ratio.ZERO, val failedRatio: Ratio = Ratio.ZERO, val currentSubstageName: String? = null) : Metric

Tracks processed / completed / failed substage counts and ratios, and the currently running substage name.

Constructors

Link copied to clipboard
constructor(key: MetricKey<SubstageCountMetric> = KEY, finished: Int = 0, completed: Int = 0, failed: Int = 0, completedRatio: Ratio = Ratio.ZERO, failedRatio: Ratio = Ratio.ZERO, currentSubstageName: String? = null)

Types

Link copied to clipboard
object Companion

Key holder for SubstageCountMetric.

Properties

Link copied to clipboard
val completed: Int = 0

Substages that completed successfully (no failure).

Link copied to clipboard
Link copied to clipboard
@EncodeDefault(mode = EncodeDefault.Mode.NEVER)
val currentSubstageName: String? = null

Name of the substage currently running, or null when none is in flight.

Link copied to clipboard
val failed: Int = 0

Substages that ended in failure.

Link copied to clipboard
Link copied to clipboard
val finished: Int = 0

Number of substages that have finished (the denominator for the ratios).

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

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

Functions

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

Recompute this metric from the full list of substages records.