ToolResponse class

The result of a tool invocation, passed back to the API in a subsequent turn alongside the corresponding ToolCall.

Constructors

ToolResponse({String? id, Map<String, dynamic>? response, required ToolType toolType})
Creates a ToolResponse.
const
ToolResponse.fromJson(Map<String, dynamic> json)
Creates a ToolResponse from JSON.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
id String?
Optional identifier of the tool call this response corresponds to, used to match ToolCall.id back to its response.
final
response Map<String, dynamic>?
The response data.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
toolType ToolType
The type of tool that generated this response.
final

Methods

copyWith({Object? id = unsetCopyWithValue, Object? response = unsetCopyWithValue, Object? toolType = unsetCopyWithValue}) ToolResponse
Creates a copy with replaced values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts to JSON.
toString() String
A string representation of this object.
inherited

Operators

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