StreamingToolExecutor class
Executes tools as they stream in with concurrency control.
- Concurrent-safe tools can execute in parallel
- Non-concurrent tools must execute alone (exclusive access)
- Results are buffered and emitted in the order tools were received
Constructors
-
StreamingToolExecutor({required List<
ToolDefinition> toolDefinitions, required CanUseToolFn canUseTool, required ToolUseContext toolUseContext})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addTool(
ToolUseBlock block, AssistantMessage assistantMessage) → void - Add a tool to the execution queue. Starts executing immediately if conditions allow.
-
discard(
) → void - Discards all pending and in-progress tools.
-
getCompletedResults(
) → List< MessageUpdate> - Get completed results that haven't been yielded yet.
-
getRemainingResults(
) → Stream< MessageUpdate> - Wait for remaining tools and return their results.
-
getUpdatedContext(
) → ToolUseContext - Get the current tool use context.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited