ToolResult class

Tool execution result that can be returned to the model

Constructors

ToolResult.new({required String toolCallId, required String content, bool isError = false, Map<String, dynamic>? metadata})
const
ToolResult.error({required String toolCallId, required String errorMessage, Map<String, dynamic>? metadata})
Create an error tool result
factory
ToolResult.fromJson(Map<String, dynamic> json)
factory
ToolResult.success({required String toolCallId, required String content, Map<String, dynamic>? metadata})
Create a successful tool result
factory

Properties

content String
The result content (can be text, JSON, or error message)
final
hashCode int
The hash code for this object.
no setterinherited
isError bool
Whether this result represents an error
final
metadata Map<String, dynamic>?
Optional metadata about the execution
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
toolCallId String
The ID of the tool call this result corresponds to
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

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