Package com.t4a.api
Class JavaMethodExecutor
java.lang.Object
com.t4a.api.JavaActionExecutor
com.t4a.api.JavaMethodExecutor
- All Implemented Interfaces:
AIActionExecutor
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis method invokes the action based on the type of the action.com.google.cloud.vertexai.api.FunctionDeclaration
buildFunction
(AIAction action) Take the AIAction class and based on the type it returns a FunctionDeclaration for Geminicom.google.cloud.vertexai.api.FunctionDeclaration
com.google.gson.Gson
getGson()
void
mapMethod
(HttpPredictedAction action) void
Methods inherited from class com.t4a.api.JavaActionExecutor
getBuild, getBuild, getBuildForJson, getBuildFunction, getBuildFunction, getPropertyValuesJsonString, getPropertyValuesJsonString, getPropertyValuesMap, getPropertyValuesMap, getPropertyValuesMapMap, mapClassToFun, mapType, mapType, mapTypeForPojo, protobufToMap
-
Constructor Details
-
JavaMethodExecutor
public JavaMethodExecutor() -
JavaMethodExecutor
public JavaMethodExecutor(com.google.gson.Gson gson)
-
-
Method Details
-
getProperties
- Specified by:
getProperties
in classJavaActionExecutor
-
getGeneratedFunction
public com.google.cloud.vertexai.api.FunctionDeclaration getGeneratedFunction() -
getGson
public com.google.gson.Gson getGson()- Specified by:
getGson
in classJavaActionExecutor
-
buildFunction
Take the AIAction class and based on the type it returns a FunctionDeclaration for Gemini- Parameters:
action
-- Returns:
-
mapMethod
-
mapMethod
-
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
-
action
-
action
public Object action(String params, AIAction instance) throws InvocationTargetException, IllegalAccessException
-