Class ToolResponse.Builder

java.lang.Object
com.google.genai.types.ToolResponse.Builder
Enclosing class:
ToolResponse

public abstract static class ToolResponse.Builder extends Object
Builder for ToolResponse.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • id

      public abstract ToolResponse.Builder id(String id)
      Setter for id.

      id: The identifier of the tool call this response is for.

    • clearId

      @CanIgnoreReturnValue public ToolResponse.Builder clearId()
      Clears the value of id field.
    • toolType

      public abstract ToolResponse.Builder toolType(ToolType toolType)
      Setter for toolType.

      toolType: The type of tool that was called, matching the tool_type in the corresponding ToolCall.

    • clearToolType

      @CanIgnoreReturnValue public ToolResponse.Builder clearToolType()
      Clears the value of toolType field.
    • toolType

      @CanIgnoreReturnValue public ToolResponse.Builder toolType(ToolType.Known knownType)
      Setter for toolType given a known enum.

      toolType: The type of tool that was called, matching the tool_type in the corresponding ToolCall.

    • toolType

      @CanIgnoreReturnValue public ToolResponse.Builder toolType(String toolType)
      Setter for toolType given a string.

      toolType: The type of tool that was called, matching the tool_type in the corresponding ToolCall.

    • response

      public abstract ToolResponse.Builder response(Map<String,Object> response)
      Setter for response.

      response: The tool response.

    • clearResponse

      @CanIgnoreReturnValue public ToolResponse.Builder clearResponse()
      Clears the value of response field.
    • build

      public abstract ToolResponse build()