EvalContext class
Per-trial context provided by an EvalEnvironment.
The context groups everything the AgentHarnessFactory needs to build and run an agent under test: filesystem root, clock, LLM client (which may be a recording/replay wrapper), application services, and a preconfigured AgentController with trace exporters already attached.
Constructors
-
EvalContext({Directory? workspaceDir, required EvalClock clock, required LLMClient llmClient, required AgentController controller, Map<
Type, Object> servicesMap = const {}, Map<String, dynamic> metadata = const {}})
Properties
- clock → EvalClock
-
Time source. Use
clock.now()instead ofDateTime.now()so trials can be made deterministic. Implementations may wire this up viapackage:clockzones if they wish.final - controller → AgentController
-
Controller pre-attached with trace exporters and listeners. The
harness should reuse this controller, not create its own.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- llmClient → LLMClient
-
LLM client to use during the trial. May be a RecordingLLMClient or
ReplayLLMClient depending on the run mode.
final
-
metadata
→ Map<
String, dynamic> -
Free-form metadata that flows into transcripts and reports.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
servicesMap
→ Map<
Type, Object> -
Application services keyed by Type. Use services for typed lookup.
final
- workspaceDir → Directory?
-
Workspace root (when the agent reads/writes files). May be null for
agents that don't touch the filesystem.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
services<
T> () → T -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited