Package-level declarations
Types
Controls truncation of string values in substep action logs.
A PromptExecutor that accumulates the LLMConsumption of the calls it intercepts and hands it back via collectAndClear. The training infrastructure creates one per leaf prompt call (via the session's capturingExecutorFactory) and reads its consumption between retry attempts; the concrete provider-aware extraction lives in the app.
A CapturingPromptExecutor that wraps a delegate executor, runs each call through it, and accumulates the LLMConsumption extracted from the returned Message.Response metadata.
Converts a caught exception into an AnalyzedFailure. This is the injection point for provider-specific failure recognition: the library calls it from the retry / stage-failure paths, the app supplies the recognizers (provider-specific and network heuristics).
LiteLLM variant: reads inputTokensCount / outputTokensCount / totalTokensCount from the first response that carries token metadata.
A provider-agnostic FailureAnalyzer that classifies every exception as FailureKind.UNKNOWN / TransiencyLevel.UNKNOWN — i.e. it makes no retryable-vs-terminal judgement.
Outcome of an early-stop check, e.g. the earlyStop callback of ai.koog.agents.optimization.training.dsl.StageScope.iterateDataset.
Core implementation of StageScope.
Log formatting utilities for the training infrastructure.
Shared execution resources created once per training session.
Lifecycle wrapper for a training session.
Functions
Builds a TrainingSession for the common case in a single call, filling in library defaults: no smart failure recognition (NoOpFailureAnalyzer), LiteLLM token capture (LiteLLMConsumptionCapturingPromptExecutor, which reads koog's standard token counts), single-attempt runs (RetryPolicy.None), ActionLogTruncation.DEFAULT, no records file, and no cluster/spend-limit metadata.