Package com.google.genai.types
Class ToolCall
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.ToolCall
A predicted server-side `ToolCall` returned from the model.
This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolResponse`.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.google.genai.JsonSerializable
MAX_READ_LENGTH_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionargs()The tool call arguments.static ToolCall.Builderbuilder()Instantiates a builder for ToolCall.static ToolCallDeserializes a JSON string to a ToolCall object.id()Unique identifier of the tool call.abstract ToolCall.BuilderCreates a builder with the same values as this instance.toolType()The type of tool that was called.Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString
-
Constructor Details
-
ToolCall
public ToolCall()
-
-
Method Details
-
id
Unique identifier of the tool call. The server returns the tool response with the matching `id`. -
toolType
The type of tool that was called. -
args
The tool call arguments. Example: {"arg1": "value1", "arg2": "value2"}. -
builder
Instantiates a builder for ToolCall. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a ToolCall object.
-