Question - How to set max entity value based on value of other entity

Hi,

tl;dr I’m trying to set the max entity value based on a user saying “all of them” or “everything” but it also depends on the value of another entity.

long: I looked for an answer to my question, but I couldn’t quite find it. I found the section in the documentation about influencing decisions (Domain) but I’m not sure how to implement this in the way I’m trying to. Sorry if this has already been answered. Any help is appreciated.

Here’s a toy example: I have two entities, container and amount. I ask the user what type of container they’re using, either bottle or jug. Regardless of which they select, after they specify which container, the next form question is asked. The second question asks how much they want in the container. I can set the max value in the slot definition, but each unique slot value has a different max. So if they say jug it has a max amount of 64 while bottle has a max amount of 32. I know how to set the value if they say a number, but if I ask “how much do you want” and they say “all of it” or a number greater than the max for that container, how do I set it to 32 if they said bottle or 64 if they said jug?

Thanks!

Hi @brandonbiggs,

nlu:
- intent: check_balance
  examples: |
    - how much do I have on my [savings](account) account
    - how much money is in my [checking]{"entity": "account"} account
    - Whats the balance on my [credit card account]{"entity":"account","value":"credit"}

You can either set the value for the particular entity in the training data, or use a custom action to check the value and set the entity based on that value.

Hi @rasa_learner,

Thank you for the response. Using your example, I currently have the account being set. How do I then use that to reference the max of the next entity? Pseudocode might look like this:

if account == "savings":
max = 100
else if account == "checking":
max = 50
else if account == "credit":
max = 150