ToolCall class final

A request by the model to invoke a tool.

Ported from pi's ToolCall, plus partialArguments for streaming.

Inheritance

Constructors

ToolCall({required String id, required String name, required Map<String, dynamic> arguments, String? parentCallId, String? thoughtSignature, String? partialArguments})
const
ToolCall.fromJson(Map<String, dynamic> json)
Deserializes from a JSON map produced by toJson.
factory

Properties

arguments → Map<String, dynamic>
Parsed tool arguments. Empty while the call is still streaming; see partialArguments.
final
hashCode → int
The hash code for this object.
no setterinherited
id → String
Provider-assigned tool call id (matched by the tool result message).
final
name → String
Name of the tool to invoke.
final
parentCallId → String?
Id of the enclosing tool call for nested (subtool) executions, or null for a top-level call.
final
partialArguments → String?
Raw, not-yet-complete JSON argument text accumulated from ToolCallDeltaEvents. Providers keep the live partial message's tool call block up to date with this; on ToolCallEndEvent the completed JSON is parsed into arguments. null once parsing succeeded.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
thoughtSignature → String?
Google-specific opaque signature for reusing thought context.
final

Methods

copyWith({String? id, String? name, Map<String, dynamic>? arguments, String? parentCallId, String? thoughtSignature, String? partialArguments}) → ToolCall
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 type discriminator (pi shape).
override
toString() → String
A string representation of this object.
inherited

Operators

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