From c4b765adc0b03836aa0a3bde06265ee911d5834f Mon Sep 17 00:00:00 2001 From: aleksandarmijat Date: Wed, 26 Jun 2024 11:56:57 +0200 Subject: [PATCH 1/2] Change missing domain log level in rasa-sdk from ERROR to DEBUG --- rasa_sdk/endpoint.py | 2 +- rasa_sdk/interfaces.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/rasa_sdk/endpoint.py b/rasa_sdk/endpoint.py index 0a032604..46b97862 100644 --- a/rasa_sdk/endpoint.py +++ b/rasa_sdk/endpoint.py @@ -158,7 +158,7 @@ async def webhook(request: Request) -> HTTPResponse: body = {"error": e.message, "action_name": e.action_name} return response.json(body, status=404) except ActionMissingDomainException as e: - logger.error(e) + logger.debug(e) body = {"error": e.message, "action_name": e.action_name} return response.json(body, status=449) diff --git a/rasa_sdk/interfaces.py b/rasa_sdk/interfaces.py index 21791f41..50723a55 100644 --- a/rasa_sdk/interfaces.py +++ b/rasa_sdk/interfaces.py @@ -386,7 +386,9 @@ class ActionMissingDomainException(Exception): def __init__(self, action_name: Text, message: Optional[Text] = None) -> None: self.action_name = action_name - self.message = message or "Domain context is missing." + self.message = ( + message or "Missing domain context, assistant will retry the request." + ) def __str__(self) -> Text: return self.message From 6785065659d1fcfee116fd812bd5ad4af255c2a5 Mon Sep 17 00:00:00 2001 From: aleksandarmijat Date: Thu, 27 Jun 2024 12:57:11 +0200 Subject: [PATCH 2/2] Add changelog, update log message --- changelog/1113.misc.md | 3 +++ rasa_sdk/interfaces.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changelog/1113.misc.md diff --git a/changelog/1113.misc.md b/changelog/1113.misc.md new file mode 100644 index 00000000..2df4ed79 --- /dev/null +++ b/changelog/1113.misc.md @@ -0,0 +1,3 @@ +- Changed log message level from `error` to `debug`. +- Rephrased the log message to precisely describe that the request is being retried if the domain context is missing. +- Referenced this behavior in the documentation. \ No newline at end of file diff --git a/rasa_sdk/interfaces.py b/rasa_sdk/interfaces.py index 50723a55..21d20116 100644 --- a/rasa_sdk/interfaces.py +++ b/rasa_sdk/interfaces.py @@ -387,7 +387,10 @@ class ActionMissingDomainException(Exception): def __init__(self, action_name: Text, message: Optional[Text] = None) -> None: self.action_name = action_name self.message = ( - message or "Missing domain context, assistant will retry the request." + message + or "Missing domain context, assistant will retry the request and include " + "the domain in the request payload. For more information please see " + "https://rasa.com/docs/rasa-pro/action-server/" ) def __str__(self) -> Text: