Class ToolCall.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • id

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

      id: Optional. Unique identifier of the tool call. The server returns the tool response with the matching `id`.

    • clearId

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

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

      toolType: Optional. The type of tool that was called.

    • clearToolType

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

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

      toolType: Optional. The type of tool that was called.

    • toolType

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

      toolType: Optional. The type of tool that was called.

    • args

      public abstract ToolCall.Builder args(Map<String,Object> args)
      Setter for args.

      args: Optional. The tool call arguments. Example: {"arg1" : "value1", "arg2" : "value2" , ...}

    • clearArgs

      @CanIgnoreReturnValue public ToolCall.Builder clearArgs()
      Clears the value of args field.
    • toolName

      public abstract ToolCall.Builder toolName(String toolName)
      Setter for toolName.

      toolName: Optional. The name of the tool that was called. This field is not supported in Vertex AI.

    • clearToolName

      @CanIgnoreReturnValue public ToolCall.Builder clearToolName()
      Clears the value of toolName field.
    • build

      public abstract ToolCall build()