Condition in a flow using slots - Detecting Invalid Condition - Rasa Pro CALM - Rasa CALM - Rasa Community Forum

Condition in a flow using slots - Detecting Invalid Condition - Rasa Pro CALM

post by sk1382 on Jul 9, 2024

Slots in the domain.yml:

  annual_income:
    type: float
    mappings:
      - type: from_llm
  cibil_score:
    type: float
    mappings:
      - type: from_llm

Flow having the condition in the flow.yml file:

  loan_eligibility:
    description: checking the eligibility of user for loan
    steps:
      - collect: annual_income
        next:
          - if: ((slots.annual_income > 30,000) and (slots.cibil_score > 650))
            then: eligible
          - else: ineligible
      - action: utter_eligible
        id: eligible
      - action: utter_ineligible
        id: ineligible

Flow after splitting the condition in the flow.yml file:

  loan_eligibility:
    description: checking the eligibility of user for loan
    steps:
      - collect: annual_income
        next:
          - if: slots.annual_income < 30,000
            then:
              - action: utter_ineligible
                next: END
          - else: check_cibil_score
      - collect: cibil_score
        id: check_cibil_score
        next:
          - if: slots.cibil_score < 650
            then:
              - action: utter_ineligible
                next: END
          - else:
              - action: utter_eligible
                next: END

Responses for utterances in the domain.yml:

  utter_eligible:
    - text: "Great news! 🥳 You are eligible to get bike loan. 😃"

utter_ineligible:
    - text: "we are deeply sorry! 😞 We can't give you a bike loan. Better luck next time. 👍"

Error facing while training rasa before splitting if condition:

2024-07-09 19:17:08 ERROR    rasa.validator  - [error    ] Detected invalid condition '((slots.annual_income > 30,000) and (slots.cibil_score > 650))' at step '0_collect_annual_income' for flow id 'loan_eligibility'.
Please make sure that all conditions are valid. event_key=validator.verify_predicates.link.invalid_condition flow=loan_eligibility link=((slots.annual_income > 30,000) and (slots.cibil_score > 650)) step=0_collect_annual_income

Error facing while training rasa after splitting if condition:

2024-07-09 19:46:46 ERROR    rasa.validator  - [error    ] Detected invalid condition 'slots.annual_income < 30,000' at step '0_collect_annual_income' for flow id 'loan_eligibility'.
Please make sure that all conditions are valid. event_key=validator.verify_predicates.link.invalid_condition flow=loan_eligibility link=slots.annual_income < 30,000 step=0_collect_annual_income

I have:

Yet I am facing the same error as mentioned above. I am searching for any other way to work it out.