This somehow does not work for me. Let me show you my code, maybe I am doing something wrong:
my request body (GET request via postman http://localhost:5005/webhooks/rest/webhook
) is:
{
"sender": "5db1ad69-b004-4aa4-a4bf-037abd7ba9af",
"message": "List all my courses",
"metadata": {
"token": "some extra information"
}
}
And in the action.py I just do print(tracker.latest_message)
:
from typing import Text, Dict, Any, List
from rasa_sdk import Action, Tracker
from rasa_sdk.events import SlotSet
from rasa_sdk.executor import CollectingDispatcher
class ActionCheckRestaurants(Action):
def name(self) -> Text:
return "action_get_courses"
def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
print(tracker.latest_message)
dispatcher.utter_message(text = "Hello")
return []
with the following result:
{'intent': {'id': -3970330514659824069, 'name': 'get_courses', 'confidence': 0.9978423714637756}, 'entities': [], 'text': 'List all my courses', 'message_id': 'ded8a95b1c0f4230932d2f8a35279f26', 'metadata': {}, 'intent_ranking': [{'id': -3970330514659824069, 'name': 'get_courses', 'confidence': 0.9978423714637756}, {'id': 9073406446022162066, 'name': 'out_of_scope', 'confidence': 0.0020098222885280848}, {'id': -5089103512759352920, 'name': 'thank', 'confidence': 8.310468547279015e-05}, {'id': 2222171025580606878, 'name': 'affirm', 'confidence': 3.207153713447042e-05}, {'id': 1515188917182966015, 'name': 'faq', 'confidence': 1.7392963854945265e-05}, {'id': 5517892651944656367, 'name': 'goodbye', 'confidence': 1.4894237210683059e-05}, {'id': 3016223801878893438, 'name': 'greet', 'confidence': 2.8274325813981704e-07}, {'id': 1952904714508125642, 'name': 'deny', 'confidence': 7.317380124050032e-08}], 'response_selector': {'all_retrieval_intents': ....
So metadata seems to be an empty object. Am I missing something?