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()Optional.static ToolCall.Builderbuilder()Instantiates a builder for ToolCall.static ToolCallDeserializes a JSON string to a ToolCall object.id()Optional.abstract ToolCall.BuilderCreates a builder with the same values as this instance.toolName()Optional.toolType()Optional.Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString
-
Constructor Details
-
ToolCall
public ToolCall()
-
-
Method Details
-
id
Optional. Unique identifier of the tool call. The server returns the tool response with the matching `id`. -
toolType
Optional. The type of tool that was called. -
args
Optional. The tool call arguments. Example: {"arg1" : "value1", "arg2" : "value2" , ...} -
toolName
Optional. The name of the tool that was called. This field is not supported in Vertex AI. -
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.
-