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

dispatcher.utter_message in a slot validation action does not display in a conversation #612

Closed
1 task
ancalita opened this issue Nov 25, 2021 · 5 comments
Closed
1 task
Labels
area:rasa-sdk 🧑‍💻 Everything that touches our python Rasa SDK type:bug 🐛 Something isn't working

Comments

@ancalita
Copy link
Member

Problem description:
Using a dispatcher.utter_message(text=..) inside a custom validation method in a custom action extending ValidationAction does not get displayed to the user in a rasa shell conversation, although the debug log shows that the BotUttered event was added to the tracker.

Example of custom action code:

class TravelSlotValidation(ValidationAction):
    @staticmethod
    def location_db() -> List[Text]:
        """Database of supported locations."""
        return ["copenhagen", "vancouver", "london", "paris", "lima",
                "san sebastian", "aspen", "queenstown", "new york", "milan"]

    def validate_location(
        self,
        slot_value: Any,
        dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: DomainDict,
    ) -> Dict[Text, Any]:
        if slot_value.lower() in self.location_db():
            return {"location": slot_value}
        else:
            dispatcher.utter_message(text='Your city is not yet supported. Please try again')
            return {"location": None}

Definition of Done

  • bot message is shown to user in rasa shell.
@ancalita ancalita added area:rasa-sdk 🧑‍💻 Everything that touches our python Rasa SDK type:bug 🐛 Something isn't working labels Nov 25, 2021
@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 16, 2022
@stale
Copy link

stale bot commented Apr 28, 2022

This issue has been automatically closed due to inactivity. Please create a new issue if you need more help.

@stale stale bot closed this as completed Apr 28, 2022
@ancalita ancalita removed the stale label Apr 29, 2022
@ancalita ancalita reopened this Apr 29, 2022
@rajpar29
Copy link

rajpar29 commented Jul 4, 2022

Do we have any updates on this?
@ancalita did you find a fix or workaround?

@ancalita
Copy link
Member Author

ancalita commented Aug 5, 2022

Fix released in rasa-oss version 3.2.5.

@ancalita ancalita closed this as completed Aug 5, 2022
@tedd0n
Copy link

tedd0n commented Feb 4, 2024

Still having the same problem. Rasa version 3.6.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-sdk 🧑‍💻 Everything that touches our python Rasa SDK type:bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants