FinishTaskTool class

Tool that validates final task output and signals completion.

Inheritance

Constructors

FinishTaskTool({required Object taskAgent})
Creates a finish-task tool from an agent-like object.
factory
FinishTaskTool.fromSchema({required String taskAgentName, Object? outputSchema})
Creates a finish-task tool with explicit schema metadata.
factory

Properties

customMetadata Map<String, dynamic>?
Arbitrary metadata attached to this tool declaration.
getter/setter pairinherited
defersResponse bool
Whether response event creation is handled by framework code elsewhere.
getter/setter pairinherited
description String
Human-readable purpose text shown to the model.
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
isLongRunning bool
Whether the tool can outlive a single response turn.
getter/setter pairinherited
name String
Unique tool name used in function-calling payloads.
getter/setter pairinherited
outputSchema Object?
Raw output schema supplied by the task agent.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
taskAgentName String
Agent name this finish-task tool belongs to.
final

Methods

buildInstruction() String
Instruction appended to model requests when this tool is available.
detectErrorInResponse(Object? response) String?
Returns a telemetry error type when response represents a tool error.
override
getDeclaration() FunctionDeclaration
Returns the function declaration exposed to the model, if any.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
processLlmRequest({required ToolContext toolContext, required LlmRequest llmRequest}) Future<void>
Mutates outgoing llmRequest before model generation.
override
run({required Map<String, dynamic> args, required ToolContext toolContext}) Future<Object?>
Executes the tool and returns a JSON-like response payload.
override
toString() String
A string representation of this object.
inherited

Operators

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