Package com.t4a.processor
Class ActionProcessor
java.lang.Object
com.t4a.processor.ActionProcessor
- All Implemented Interfaces:
AIProcessor
- Direct Known Subclasses:
SpringAwareActionProcessor
The main processor class, can execute single action or multiple action in sequence - based on prompt can predict and trigger action - based on prompt can predict and trigger multiple actions sequentially - based on prompt can predict and trigger multiple actions parallely - Can take HumanInLoop object and wait for Human Validation - Can take ExplainDecision Object and provide why the decision was taken by AI
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn all the actions comma seperatedprocessMultipleAction
(String promptText, int num) processMultipleAction
(String promptText, int num, HumanInLoop humanVerification, ExplainDecision explain) processMultipleActionDynamically
(String promptText, HumanInLoop humanVerification, ExplainDecision explain) Converts one big prompt into JSON and process them as single prompts one by one or parallely based on dependency orderprocessSingleAction
(String promptText) Process Multiple actions sequentially based on predictionprocessSingleAction
(String promptText, AIAction action) Directly pass the action object with the prompt , this is useful in case of spring beans as the actions can be initialized as spring boot as beans with other dependencyprocessSingleAction
(String promptText, AIAction predictedAction, HumanInLoop humanVerification, ExplainDecision explain) Process single action based on predictionprocessSingleAction
(String promptText, HumanInLoop humanVerification, ExplainDecision explain) processSingleAction
(String promptText, String actionName) Trigger the action by specifically passing the name, prediction wont be called .
-
Constructor Details
-
ActionProcessor
public ActionProcessor()
-
-
Method Details
-
processSingleAction
public Object processSingleAction(String promptText, HumanInLoop humanVerification, ExplainDecision explain) throws AIProcessingException - Specified by:
processSingleAction
in interfaceAIProcessor
- Throws:
AIProcessingException
-
processSingleAction
public Object processSingleAction(String promptText, AIAction predictedAction, HumanInLoop humanVerification, ExplainDecision explain) throws AIProcessingException Process single action based on prediction- Specified by:
processSingleAction
in interfaceAIProcessor
- Parameters:
promptText
- prompthumanVerification
-explain
-- Returns:
- Throws:
AIProcessingException
-
processSingleAction
Process Multiple actions sequentially based on prediction- Parameters:
promptText
-- Returns:
- Throws:
AIProcessingException
-
processSingleAction
Directly pass the action object with the prompt , this is useful in case of spring beans as the actions can be initialized as spring boot as beans with other dependency- Parameters:
promptText
-action
-- Returns:
- Throws:
AIProcessingException
-
processSingleAction
public Object processSingleAction(String promptText, String actionName) throws AIProcessingException Trigger the action by specifically passing the name, prediction wont be called . This action will be executed Parameters for the action will be taken from the prompt- Parameters:
promptText
-actionName
-- Returns:
- Throws:
AIProcessingException
-
processMultipleAction
- Throws:
AIProcessingException
-
processMultipleAction
public List<Object> processMultipleAction(String promptText, int num, HumanInLoop humanVerification, ExplainDecision explain) throws AIProcessingException - Throws:
AIProcessingException
-
processMultipleActionDynamically
public String processMultipleActionDynamically(String promptText, HumanInLoop humanVerification, ExplainDecision explain) throws AIProcessingException Converts one big prompt into JSON and process them as single prompts one by one or parallely based on dependency order- Parameters:
promptText
-humanVerification
-explain
-- Returns:
- Throws:
AIProcessingException
-
getActionList
Return all the actions comma seperated- Returns:
-