diff --git a/changelog/12790.bugfix.md b/changelog/12790.bugfix.md new file mode 100644 index 000000000000..4715d8ac618a --- /dev/null +++ b/changelog/12790.bugfix.md @@ -0,0 +1 @@ +Fixed `KeyError` which resulted when `domain_responses` doesn't exist as a keyword argument while using a custom action dispatcher with nlg server. \ No newline at end of file diff --git a/rasa/core/nlg/callback.py b/rasa/core/nlg/callback.py index a8d0e681e055..d997f6ace092 100644 --- a/rasa/core/nlg/callback.py +++ b/rasa/core/nlg/callback.py @@ -73,7 +73,7 @@ async def generate( **kwargs: Any, ) -> Dict[Text, Any]: """Retrieve a named response from the domain using an endpoint.""" - domain_responses = kwargs.pop("domain_responses") + domain_responses = kwargs.pop("domain_responses", None) response_id = self.fetch_response_id( utter_action, tracker, output_channel, domain_responses )