Proper ordering of conditions
Conditions should be always ordered in most restrictive to least restrictive:- ELSE conditions should always come at the end
- e.g if the user agrees to send the message, then say: “Thank you for agreeing to send the message”. if the user disagrees to send the message, then say: “I understand, but I strongly recommend to send the message”
- if you have 2 cases (X & Y, X & ~Y), put the X & Y condition first.
Using Jinja for static conditions
Whenever we have a variable which is not going to change during a conversation (or during a state) it is recommended to use Jinja for IF-ELSE conditions rather than relying on the LLM:{% if loan_type == "TypeA" %} Say A {% else %} Say B {% endif %}
.
e.g {%if variable == “False”%} say: “variable is set as false” {%elif variable == “True”%} say: “variable is set as True” {%else%} say: “variable value is neither True nor False” {%endif%}