Package com.google.genai.types
Class ToolResponse
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.ToolResponse
The output from a server-side `ToolCall` execution.
This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolCall`.
-
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 TypeMethodDescriptionstatic ToolResponse.Builderbuilder()Instantiates a builder for ToolResponse.static ToolResponseDeserializes a JSON string to a ToolResponse object.id()The identifier of the tool call this response is for.response()The tool response.abstract ToolResponse.BuilderCreates a builder with the same values as this instance.toolType()The type of tool that was called, matching the tool_type in the corresponding ToolCall.Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString
-
Constructor Details
-
ToolResponse
public ToolResponse()
-
-
Method Details
-
id
The identifier of the tool call this response is for. -
toolType
The type of tool that was called, matching the tool_type in the corresponding ToolCall. -
response
The tool response. -
builder
Instantiates a builder for ToolResponse. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a ToolResponse object.
-