AI Validated Logic Builder
When building conversation flows, there are times where you will need to add in a logic step that can create branches depending on the response. One method we offer within Capacity is our Simple Logic Builder that includes the option to use Lua as well for more sophisticated logic. These options can work well in a number of scenarios, however there are times where utilizing AI can be a better option. To address that we now have an AI Validate Logic builder option within our Logic GC Card.
Using the AI Validated Logic Builder
AI Validated Logic is great for use cases where you need to interpret language or subject matter. It is not ideal to use for math-based evaluations. Greater than, less than, equal to, etc. - these types of logic operators are not good to replace with AI validators. For math-based conditions, it is best to use the Simple or Lua logic options.
Accessing the AI Logic Builder
The AI Validated Logic builder can be found as part of the Logic card within Guided Conversations. If you add a Logic card to your conversation, you will have the two primary options, Simple and AI Validated.
While you can toggle between the two options, the conditions are constructed in very different ways. We will display a note in the UI to indicate that you will need to make adjustments to save existing conditions in a new logic mode.
Simple logic uses a rigid structure with types and operators that have to be explicitly defined. AI Validated will use LLMs to validate the logical statements provided.
Setting Up Your Conditions
To use AI validated logic, you will need to provide a validation statement that will evaluate to a true or false answer. There is a single input box per condition where it is required that you evaluate an inserted variable from a previous input in the conversation.
When writing the validation statement that evaluates to a true or false, you do not need to enter a condition for both the true and false result. For example, if you want to evaluate if the provided phone number is a valid phone number, you would only need one condition:
[phone_number] is a valid phone number.
If you look at how we would construct that in the builder below, you only need one condition and a fallback. You do not need to set up two conditions, one for the Valid (true) and one for the Invalid (false) result.
If you are not getting the results you would expect, try tweaking your validation statement language.