Class FunctionCallingConfig.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • mode

      Setter for mode.

      mode: Optional. Function calling mode.

    • clearMode

      @CanIgnoreReturnValue public FunctionCallingConfig.Builder clearMode()
      Clears the value of mode field.
    • mode

      @CanIgnoreReturnValue public FunctionCallingConfig.Builder mode(FunctionCallingConfigMode.Known knownType)
      Setter for mode given a known enum.

      mode: Optional. Function calling mode.

    • mode

      @CanIgnoreReturnValue public FunctionCallingConfig.Builder mode(String mode)
      Setter for mode given a string.

      mode: Optional. Function calling mode.

    • allowedFunctionNames

      public abstract FunctionCallingConfig.Builder allowedFunctionNames(List<String> allowedFunctionNames)
      Setter for allowedFunctionNames.

      allowedFunctionNames: Optional. Function names to call. Only set when the Mode is ANY. Function names should match [FunctionDeclaration.name]. With mode set to ANY, model will predict a function call from the set of function names provided.

    • allowedFunctionNames

      @CanIgnoreReturnValue public FunctionCallingConfig.Builder allowedFunctionNames(String... allowedFunctionNames)
      Setter for allowedFunctionNames.

      allowedFunctionNames: Optional. Function names to call. Only set when the Mode is ANY. Function names should match [FunctionDeclaration.name]. With mode set to ANY, model will predict a function call from the set of function names provided.

    • clearAllowedFunctionNames

      @CanIgnoreReturnValue public FunctionCallingConfig.Builder clearAllowedFunctionNames()
      Clears the value of allowedFunctionNames field.
    • streamFunctionCallArguments

      public abstract FunctionCallingConfig.Builder streamFunctionCallArguments(boolean streamFunctionCallArguments)
      Setter for streamFunctionCallArguments.

      streamFunctionCallArguments: Optional. When set to true, arguments of a single function call will be streamed out in multiple parts/contents/responses. Partial parameter results will be returned in the [FunctionCall.partial_args] field. This field is not supported in Gemini API.

    • clearStreamFunctionCallArguments

      @CanIgnoreReturnValue public FunctionCallingConfig.Builder clearStreamFunctionCallArguments()
      Clears the value of streamFunctionCallArguments field.
    • build

      public abstract FunctionCallingConfig build()