Package com.google.genai.types
Class ToolCall
-
- All Implemented Interfaces:
public abstract class ToolCall extends JsonSerializable
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 Modifier and Type Class Description public abstract classToolCall.BuilderBuilder for ToolCall.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description ToolCall()
-
Method Summary
Modifier and Type Method Description abstract Optional<String>id()Unique identifier of the tool call. abstract Optional<ToolType>toolType()The type of tool that was called. abstract Optional<Map<String, Object>>args()The tool call arguments. static ToolCall.Builderbuilder()Instantiates a builder for ToolCall. abstract ToolCall.BuildertoBuilder()Creates a builder with the same values as this instance. static ToolCallfromJson(String jsonString)Deserializes a JSON string to a ToolCall object. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
id
abstract Optional<String> id()
Unique identifier of the tool call. The server returns the tool response with the matching `id`.
-
args
abstract Optional<Map<String, Object>> args()
The tool call arguments. Example: {"arg1": "value1", "arg2": "value2"}.
-
builder
static ToolCall.Builder builder()
Instantiates a builder for ToolCall.
-
toBuilder
abstract ToolCall.Builder toBuilder()
Creates a builder with the same values as this instance.
-
-
-
-