Using a generative AI model in a ruleflow
The generative AI model that you created can be consumed in a rule flow.
Procedure
- In the Dependencies tab in your task model, click Add, and select the generative AI model that you want to use.
- Open the Artifacts tab, and define the following items:
- Click Add variable set to add variables.
- Create functions. See Creating functions.
- Click Add business rule to add business rules. For example:
then set 'my output variable 1' to generated_text of the GenAI model computed from my GenAI variable being 'my input variable' ;
then set 'my output variable 2' to generated_token_count of the GenAI model computed from my GenAI variable being 'my input variable' ;
then print error_code of the GenAI model computed from my GenAI variable being 'my input variable' ;
In these examples, the following items are used:then print error_message of the GenAI model computed from my GenAI variable being 'my input variable' ;
Item Description <gen_ai_model> computed from <variable> beingExpression. GenAI modelGenerative AI model name. my GenAI variableVariable used in the generative AI model. my input variableVariable (type string) defined in the variable set and set as an input parameter in the function for the ruleflow. my output variable 1Variable (type string) defined in the variable set and set as an output parameter in the function for the ruleflow. my output variable 2Variable (type integer) defined in the variable set and set as an output parameter in the function for the ruleflow. - In your ruleflow, click the Open ruleflow button, and select the rule task node that you want to add your business rule to. In the Logic pane, click Select artifacts, and select the business rule that you created.