I have a requirement to send a parameter with the call to Rasa endpoint API - http://localhost:5005/webhooks/rest/webhook. I need to set a slot value so I can retrieve it using custom actions. I am unable to set slot value (using button with payload).
domain.yml
version: "3.1"
forms:
td_form:
required_slots:
- td_path
slots:
td_path:
type: text
influence_conversation: true
mappings:
- type: custom
action: action_call_api
conditions:
- active_loop: td_form
requested_slot: td_path
actions:
- action_call_api
entities:
- td_path
intents:
- greet
- select_path
- inform_path
- find_destination
- destinationA
- destinationB
responses:
utter_greet:
- text: "Hello User"
utter_select_path:
- text: "Select your choice"
buttons:
- title: "Find destination A"
payload: /inform_path{{"td_path":"destinationA"}}
- title: "Find destination B"
payload: /inform_path{{"td_path":"destinationB"}}
session_config:
session_expiration_time: 60
carry_over_slots_to_new_session: true
stories.yml
version: "3.1"
stories:
- story: create test data
steps:
- intent: greet
- action: utter_greet
- action: utter_select_path
actions.py
class ActionSetDestinationPath(Action):
def name(self) -> Text:
return "action_call_api"
def run(
self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any]
) -> List[Dict[Text, Any]]:
selected_path = tracker.get_slot('td_path')
dispatcher.utter_message("Selected path is... {selected_path}")
return []
Thanks in advance for all the help.