RecordingLLMClient class
Wraps an inner LLMClient and records every successful (request, response) pair into a RecordingStore. Reads still go through the inner client; the store is a write target only.
If a RateLimitGate is provided, every real upstream call awaits the gate first. This is the wiring point for RFC §6.15 (concurrency vs rate-limit decoupling).
Per-trial salt: when trialSalt is non-null, every recorded hash includes it. This preserves non-determinism across trials — trial #0 and trial #1 of the same task receive different cache keys, so the cache stores N different responses (one per trial) instead of overwriting to one. Construct one client per trial via withTrialSalt from inside EvalEnvironment.prepare. Leave it null for one-off requests (judges, ad-hoc analysis) where caching across trials is the desired behavior.
- Implemented types
Constructors
- RecordingLLMClient({required LLMClient inner, required RecordingStore store, LLMRequestHash? hasher, RateLimitGate? rateLimitGate, String? trialSalt})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasher → LLMRequestHash
-
final
- inner → LLMClient
-
final
- rateLimitGate → RateLimitGate
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- store → RecordingStore
-
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) → RecordingLLMClient -
Returns a copy of this client bound to
salt. Convenience for per-trial wrapping inside an environment'sprepare().
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited