Tool<Input, Output> class
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
-
key
↔ String?
-
The fully-qualified registry key (
/$actionType/$name) or, for actions
resolved through a dynamic action provider, the DAP key
(/dynamic-action-provider/<host>:<actionType>/<name>).
getter/setter pairinherited
-
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, CancellationToken? cancel})
→ 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, CancellationToken? cancel})
→ Future<RunResult<ToolResult<Output>>>
-
inherited
-
runRaw(dynamic input, {StreamingCallback<void>? onChunk, Map<String, dynamic>? context, Stream<Input>? inputStream, dynamic init, TraceStartCallback? onTraceStart, CancellationToken? cancel})
→ Future<RunResult<ToolResult<Output>>>
-
inherited
-
stream(Input? input, {Map<String, dynamic>? context, Stream<Input>? inputStream, void init, CancellationToken? cancel})
→ ActionStream<void, ToolResult<Output>>
-
inherited
-
streamBidi({Stream<Input>? inputStream, StreamingCallback<void>? onChunk, Map<String, dynamic>? context, void init, CancellationToken? cancel})
→ BidiActionStream<void, ToolResult<Output>, Input>
-
inherited
-
toJson()
→ Map<String, dynamic>
-
inherited
-
toString()
→ String
-
A string representation of this object.
inherited