ToolResultPart class final

The output of a tool, fed back to the model and shown to the user.

Inheritance

Constructors

ToolResultPart({required String toolCallId, required Object? result, bool isError = false})
Creates a tool-result part.
const
ToolResultPart.fromJson(Map<String, Object?> json)
Reconstructs a ToolResultPart from json.
factory

Properties

hashCode → int
The hash code for this object.
no setteroverride
isError → bool
Whether result represents an error rather than a success payload.
final
result → Object?
The tool's output. Any JSON-encodable value, or null.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
toolCallId → String
The id of the ToolCallPart this result answers.
final

Methods

copyWith({String? toolCallId, Object? result, bool? isError}) → ToolResultPart
Returns a copy with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
Serializes this part, including its type discriminator.
override
toString() → String
A string representation of this object.
override

Operators

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