Class FunctionCallingUtils

java.lang.Object
com.google.adk.tools.FunctionCallingUtils

public final class FunctionCallingUtils extends Object
Utility class for function calling.
  • Method Details

    • buildFunctionDeclaration

      public static com.google.genai.types.FunctionDeclaration buildFunctionDeclaration(Method func, List<String> ignoreParams)
      Builds a FunctionDeclaration from a Java Method, ignoring parameters with the given names.
      Parameters:
      func - The Java Method to convert into a FunctionDeclaration.
      ignoreParams - The names of parameters to ignore.
      Returns:
      The generated FunctionDeclaration.
      Throws:
      IllegalArgumentException - if a type is encountered that cannot be serialized by Jackson.
    • buildSchemaFromType

      public static com.google.genai.types.Schema buildSchemaFromType(Type type)
      Builds a Schema from a Java Type, creating a new context for the generation process.
      Parameters:
      type - The Java Type to convert into a Schema.
      Returns:
      The generated Schema.
      Throws:
      IllegalArgumentException - if a type is encountered that cannot be serialized by Jackson.