TestToolkit class final

Wraps inner: records every call it runs, and holds back the answers of gatedTool until gate completes (the call itself starts at once, so it reads its list items when it is made).

Inheritance

Constructors

TestToolkit(Toolkit inner)

Properties

annotations → List<Map<String, Object?>>
The annotations each of calls ran with.
final
calls → List<ToolCall>
Every call run, in order, as the assistant ran it.
final
gate ↔ Completer<void>?
Completing it lets the held answers go.
getter/setter pair
gatedTool ↔ String?
The tool whose answers wait for gate; null holds nothing back.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
inner → Toolkit
The toolkit it forwards to.
finalinherited
resets ↔ int
Times reset was called.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sources → List<ToolCallSource>
Who asked for each of calls.
final
specs → List<ToolSpec>
The tools, in prompt order.
no setterinherited

Methods

coerce(ToolCall call) → Map<String, Object?>
The model's arguments rewritten leniently, before anything checks them (default: unchanged).
inherited
confirmationQuestion(ToolCall call, ConfirmationContext context) → String?
The question call asks before it runs; null uses AssistantStrings.confirmDefault.
inherited
execute(ToolCall call, ToolContext context) → Future<ToolResult>
Runs call. A model's mistake is a ToolFailure; an exception follows AssistantConfig.toolErrors. The call must start synchronously (before the first await): the assistant reads ToolContext.annotations in the same step.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
A new conversation starts: forget what the old one did (a backend's ledgers).
override
restoreState(Map<String, Object?> state) → void
Takes back what saveState gave, after a reset.
inherited
saveState() → Map<String, Object?>?
What a conversation snapshot keeps of the toolkit; null for nothing.
inherited
spec(String name) → ToolSpec?
The spec of name; null for a tool the toolkit does not have (the assistant answers unknown tool).
inherited
statusLabel(ToolCall call) → String?
The label shown while call runs; null uses AssistantStrings.working.
inherited
timeoutOf(ToolCall call) → Duration?
Longest wait for call's result; null uses AssistantConfig.toolTimeout.
inherited
toString() → String
A string representation of this object.
inherited
validate(ToolCall call) → List<String>
The problems of call's (coerced) arguments; empty when valid. Default: validateArguments against the spec.
inherited

Operators

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