Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New events to jump into states #11

Open
2 of 4 tasks
Aran30 opened this issue Sep 18, 2023 · 2 comments
Open
2 of 4 tasks

New events to jump into states #11

Aran30 opened this issue Sep 18, 2023 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@Aran30
Copy link
Collaborator

Aran30 commented Sep 18, 2023

I'd like to propose some ideas of (specific) events that could cause a jump to another state which I feel might be helpful:

  • 1. Intent but no entity recognized: Sometimes, an intent might be recognized, yet a needed entity wasn't. (Thus, an important variable is missing). A method like "when_intent_without_entity_matched_go_to" could be added or the current "when_intent_matched_go_to" could be extended to have a variable "when_intent_matched_go_to(entity=True/False)".
  • 2. No fitting Intent recognized. Currently, we use the fallback body in case no fitting Intent was found. Yet, I feel it would be interesting to define a state jump in case no intent was found. Take following example: I am at a state, at which a user either inputs the correct and exact name of a bus stop or part of the name. If the user inputs part of the name, I'd like to jump to a state in which the user receives a list of possibilities based on the partial name.
  • 3. Receiving the user's location might also be a possible trigger to jump into another state. Bots (such as a bot to help with public transportation) might need the user's location to execute a function. Thus, a state might be changed once the bot receives the information.
  • 4. Events based on changes to session values. Per session, user variables can be stored. These can change, increase, get removed etc. It would be nice to have state jumps in case a specified change takes place. A method could look like "when_session_value_update_go_to(value_name,value_operation_to_match,state). Value operations could range from comparison, to predefined events such as "var_removed", "var_updated", "var_decreased", etc.
@Aran30 Aran30 added the enhancement New feature or request label Sep 18, 2023
@Aran30
Copy link
Collaborator Author

Aran30 commented Sep 18, 2023

Correction:
Regarding the 2. point, the "go_to" function already does that. Thus, if no matching intents are found, a jump to the next state is made if defined with "go_to".

@Aran30
Copy link
Collaborator Author

Aran30 commented Oct 3, 2023

Update:
4. has been (sort of) completed after PR #22.
Now, it is possible to define an event change based on values stored in the session storage. Yet a check only takes place right after a transition or when a user sends a message. Thus, a value change on itself does not cause a check to see if a jump should take place.

@mgv99 mgv99 added this to the Version 1.0 milestone Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants