Package com.t4a.api

Class JavaMethodExecutor

java.lang.Object
com.t4a.api.JavaActionExecutor
com.t4a.api.JavaMethodExecutor
All Implemented Interfaces:
AIActionExecutor

public class JavaMethodExecutor extends JavaActionExecutor
This is one of the main classes which is part of processing logic. IT does alll the mapping of actions to predicted options and creates the instance of action class. It is also responsible for invoking the correct action and pass back the response.
  • Constructor Details

    • JavaMethodExecutor

      public JavaMethodExecutor()
    • JavaMethodExecutor

      public JavaMethodExecutor(com.google.gson.Gson gson)
  • Method Details

    • getProperties

      public Map<String,com.google.cloud.vertexai.api.Type> getProperties()
      Specified by:
      getProperties in class JavaActionExecutor
    • getGeneratedFunction

      public com.google.cloud.vertexai.api.FunctionDeclaration getGeneratedFunction()
    • getGson

      public com.google.gson.Gson getGson()
      Specified by:
      getGson in class JavaActionExecutor
    • buildFunction

      public com.google.cloud.vertexai.api.FunctionDeclaration buildFunction(AIAction action)
      Take the AIAction class and based on the type it returns a FunctionDeclaration for Gemini
      Parameters:
      action -
      Returns:
    • getAction

      public AIAction getAction()
    • action

      public Object action(com.google.cloud.vertexai.api.GenerateContentResponse response, AIAction instance) throws InvocationTargetException, IllegalAccessException
      This method invokes the action based on the type of the action. It gets the values for the input params from the prompt and populates it for the action
      Parameters:
      response -
      instance -
      Returns:
      Throws:
      InvocationTargetException
      IllegalAccessException