java.lang.Object
com.google.genai.gaos.models.interactions.Function
All Implemented Interfaces:
AgentTool, FunctionResultSubcontent, Tool

public class Function extends Object implements FunctionResultSubcontent, Tool, AgentTool
  • Constructor Details

    • Function

      public Function(@Nullable Boolean deferLoading, @Nullable String description, @Nullable String name, @Nullable Object parameters, @Nullable String shortDescription)
    • Function

      public Function()
    • Function

      public Function(@Nullable String description, @Nullable String name, @Nullable Object parameters)
      Retained for source and binary compatibility with SDK versions that predate defer_loading and short_description. Prefer builder().
  • Method Details

    • deferLoading

      public Optional<Boolean> deferLoading()
      If true, the function's loading is deferred.
    • description

      public Optional<String> description()
      A description of the function.
    • name

      public Optional<String> name()
      The name of the function.
    • parameters

      public Optional<Object> parameters()
      The JSON Schema for the function's parameters.

      Supports a subset of JSON Schema. `minLength`, `maxLength`, `minProperties`, `maxProperties`, `uniqueItems`, `contains`, `minContains`, and `maxContains` are ignored and not enforced.

    • shortDescription

      public Optional<String> shortDescription()
      A brief description of the function, shown to the model as a short summary of functions with `defer_loading` set to true.
    • type

      public String type()
      Specified by:
      type in interface AgentTool
      Specified by:
      type in interface FunctionResultSubcontent
      Specified by:
      type in interface Tool
    • builder

      public static Function.Builder builder()
    • withDeferLoading

      public Function withDeferLoading(@Nullable Boolean deferLoading)
      If true, the function's loading is deferred.
    • withDescription

      public Function withDescription(@Nullable String description)
      A description of the function.
    • withName

      public Function withName(@Nullable String name)
      The name of the function.
    • withParameters

      public Function withParameters(@Nullable Object parameters)
      The JSON Schema for the function's parameters.

      Supports a subset of JSON Schema. `minLength`, `maxLength`, `minProperties`, `maxProperties`, `uniqueItems`, `contains`, `minContains`, and `maxContains` are ignored and not enforced.

    • withShortDescription

      public Function withShortDescription(@Nullable String shortDescription)
      A brief description of the function, shown to the model as a short summary of functions with `defer_loading` set to true.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object