ToolResultMessage class final
The result of executing a tool the model asked to invoke.
Ported from pi's ToolResultMessage (without the details generic and
addedToolNames, which belong to a later phase).
- Implemented types
Constructors
-
ToolResultMessage({required String toolCallId, required String toolName, required List<
ContentBlock> content, required bool isError, required DateTime timestamp}) -
const
-
ToolResultMessage.fromJson(Map<
String, dynamic> json) -
Deserializes from a JSON map produced by toJson.
factory
Properties
-
content
→ List<
ContentBlock> -
Result content: text and/or images.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isError → bool
-
Whether the tool execution failed.
final
- role → String
-
The role discriminator:
user,assistant, ortoolResult.no setteroverride - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timestamp → DateTime
-
When this message was created.
final
- toolCallId → String
-
The ToolCall.id this result answers.
final
- toolName → String
-
The name of the tool that produced this result.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes to a JSON map with a
rolediscriminator (pi shape).override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited