Tool<Input, Output> class

Inheritance

Constructors

Tool({required String name, required String description, required ToolFn<Input, Output> fn, SchemanticType<Input>? inputSchema, SchemanticType<Output>? toolOutputSchema, Map<String, dynamic>? metadata})

Properties

actionType ActionType
finalinherited
description String?
finalinherited
fn → InternalActionFn<Input, ToolResult<Output>, void, void>
finalinherited
hashCode int
The hash code for this object.
no setterinherited
initSchema → SchemanticType<void>?
finalinherited
inputSchema → SchemanticType<Input>?
finalinherited
manifestOutputSchema → SchemanticType?
The output schema surfaced when building action manifests (Dev UI, reflection) and tool definitions.
no setteroverride
metadata Map<String, dynamic>
finalinherited
name String
finalinherited
outputSchema → SchemanticType<ToolResult<Output>>?
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
streamSchema → SchemanticType<void>?
finalinherited
toolOutputSchema → SchemanticType<Output>?
The user-declared output schema (the schema of Output, not ToolResult). Used to build the model-facing tool definition and the action manifest (see manifestOutputSchema).
final

Methods

call(Input? input, {StreamingCallback<void>? onChunk, Map<String, dynamic>? context, Stream<Input>? inputStream, void init, TraceStartCallback? onTraceStart}) Future<ToolResult<Output>>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run(Input? input, {StreamingCallback<void>? onChunk, Map<String, dynamic>? context, Stream<Input>? inputStream, void init, TraceStartCallback? onTraceStart}) Future<RunResult<ToolResult<Output>>>
inherited
runRaw(dynamic input, {StreamingCallback<void>? onChunk, Map<String, dynamic>? context, Stream<Input>? inputStream, dynamic init, TraceStartCallback? onTraceStart}) Future<RunResult<ToolResult<Output>>>
inherited
stream(Input? input, {Map<String, dynamic>? context, Stream<Input>? inputStream, void init}) ActionStream<void, ToolResult<Output>>
inherited
streamBidi({Stream<Input>? inputStream, StreamingCallback<void>? onChunk, Map<String, dynamic>? context, void init}) → BidiActionStream<void, ToolResult<Output>, Input>
inherited
toJson() Map<String, dynamic>
inherited
toString() String
A string representation of this object.
inherited

Operators

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