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: 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: 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: The type of tool that was called.

    • toolType

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

      toolType: The type of tool that was called.

    • args

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

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

    • clearArgs

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

      public abstract ToolCall build()