ReplayLLMClient class

Replays from a RecordingStore; falls back to an inner client (or throws) on miss.

CI default: pass strictReplay: true and no fallback so any cache miss fails the build, forcing re-recording.

When a fallback is configured, every fallback (real upstream) call awaits the RateLimitGate first.

Per-trial salt: must match what was used during recording (see RecordingLLMClient.trialSalt). Use withTrialSalt to clone this client per trial inside EvalEnvironment.prepare so each trial looks up its own cache entry instead of collapsing onto one shared response.

Implemented types

Constructors

ReplayLLMClient({required RecordingStore store, LLMClient? fallback, bool strictReplay = true, LLMRequestHash? hasher, RateLimitGate? rateLimitGate, String? trialSalt})

Properties

fallback LLMClient?
final
hashCode int
The hash code for this object.
no setterinherited
hasher LLMRequestHash
final
rateLimitGate RateLimitGate
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
store RecordingStore
final
strictReplay bool
If true, throw on miss instead of falling back.
final
trialSalt String?
final

Methods

generate(List<LLMMessage> messages, {List<Tool>? tools, ToolChoice? toolChoice, required ModelConfig modelConfig, bool? jsonOutput, CancelToken? cancelToken}) Future<ModelMessage>
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
stream(List<LLMMessage> messages, {List<Tool>? tools, ToolChoice? toolChoice, required ModelConfig modelConfig, bool? jsonOutput, CancelToken? cancelToken}) Future<Stream<StreamingMessage>>
override
toString() String
A string representation of this object.
inherited
withTrialSalt(String salt) ReplayLLMClient
Returns a copy of this client bound to salt. Convenience for per-trial wrapping inside an environment's prepare().

Operators

operator ==(Object other) bool
The equality operator.
inherited