Custom action not working - invoking wrong function - Getting Started with Rasa / Tutorials, Resources & Videos - Rasa Community Forum
Custom action not working - invoking wrong function
I’m running into a problem with custom actions in the final slot of a form. The bot doesn’t run the final action, even when directed to with rasa interactive, and instead invokes a ‘hello world action’. I can’t figure out why.
In the domain and action pasted below, the asana_form is the one I’m having trouble with. The last two slots should trigger custom actions, since they have the prefix ‘action_ask’. The second-to-last slot is triggered correctly. But, when the bot asks to log information for the last slot, that’s when I run into a problem.
I’ll type something in for the prompt like ‘this is a note’, and in Rasa interactive, I force it to interpret it as an “inform” intent. But, then it just doesn’t work and instead invokes hello world, and it does that even if I also select “asana_form” from the rasa interactive menu.
thanks for any feedback and let me know if I can clarify this question.
DOMAIN
version: '2.0'
session_config:
session_expiration_time: 60
carry_over_slots_to_new_session: false
intents:
- sleep_log
- affirm
- inform
- greet
- goodbye
- deny
- mood_great
- mood_unhappy
- bot_challenge
- question_test
- trigger_hello_world
- flush_slots
- check_asana
entities:
- exercise
- sleep
- stress
- task_name
slots:
confirm_log:
type: text
influence_conversation: true
sleep_confirm:
type: text
influence_conversation: true
sleep:
type: text
influence_conversation: true
sleep_description:
type: text
influence_conversation: true
goal:
type: text
influence_conversation: true
asana_task_name:
type: text
influence_conversation: true
asana_number_select:
type: text
influence_conversation: true
asana_list_tasks:
type: text
influence_conversation: true
notes_from_asana_task_selected:
type: text
influence_conversation: true
asana_select_options_slot:
type: text
influence_conversation: false
asana_after_note_logged:
type: text
influence_conversation: false
responses:
utter_confirm_sleep:
- text: Do you want to talk about how you slept?
utter_greet:
- text: Hi! It's time for your daily sleep check-in. I'm excited to learn about your experience. Shall we get started?
utter_goodbye:
- text: Thanks for chatting. Bye!
utter_iamabot:
- text: I am a bot, powered by Rasa.
utter_ask_confirm_log:
- text: Did you exercise yesterday? Don't sweat it if you didn't run a marathon - walks count!
utter_ask_exercise:
- text: What kind of exercise did you do 💪 ?
utter_ask_sleep:
- text: How much sleep did you get last night?
utter_ask_sleep_description:
- text: How would you describe your sleep?
utter_ask_diet:
- text: Did you stick to a healthy diet 🥦 yesterday?
utter_ask_stress:
- text: What is your stress level right now 🧘 ?
buttons:
- title: low
payload: '/inform{"stress": "low"}'
- title: medium
payload: '/inform{"stress": "medium"}'
- title: high
payload: '/inform{"stress": "high"}'
utter_ask_goal:
- text: Setting goals - even small ones - is a great way to focus your day. What do you want to accomplish today 🥇 ?
utter_slots_values:
- text: |
You've submitted the following answers:
- Exercised?: {confirm_log}
- Sleep: {sleep}
- Goal: {goal}
utter_no_worries:
- text: No problem :)
utter_ask_continue:
- text: Sorry, I don't quite understand. Do you want to continue?
utter_cheer_up:
- text: 'Here is something to cheer you up:'
image: https://i.imgur.com/nGF1K8f.jpg
utter_did_that_help:
- text: Did that help you?
utter_start_over:
- text: Ok, let's start over.
utter_happy:
- text: Great, carry on!
utter_question_test:
- text: What's your question?
utter_question_color_test:
- text: my favorite color is blue
utter_ask_asana_task_name:
- text: What's the task you'd like to check?
actions:
- action_flush_slots
- action_hello_world
- action_submit_results
- confirm_log
- utter_confirm_sleep
- utter_exercise_info
- validate_health_form
- validate_sleep_form
- validate_sleep_log
- check_asana_action
- select_asana_action
- action_ask_asana_list_tasks
- action_ask_notes_from_asana_task_selected
- action_ask_asana_after_note_logged
forms:
asana_form:
asana_task_name:
- type: from_intent
intent: inform
value: true
asana_list_tasks:
- type: from_intent
intent: inform
value: true
notes_from_asana_task_selected:
- type: from_text
intent: None
not_intent: inform
asana_after_note_logged:
- type: from_text
intent: None
not_intent: inform
sleep_form:
sleep_confirm:
- type: from_intent
intent: affirm
value: true
- type: from_intent
intent: deny
value: false
- type: from_intent
intent: inform
value: true
sleep_description:
- type: from_text
intent: None
not_intent: inform
health_form:
confirm_log:
- type: from_intent
intent: affirm
value: true
- type: from_intent
intent: deny
value: false
- type: from_intent
intent: inform
value: true
sleep:
- type: from_entity
entity: sleep
- type: from_intent
intent: deny
value: None
sleep_description:
- type: from_text
intent: None
not_intent: inform
goal:
- type: from_intent
intent: affirm
value: true
- type: from_intent
intent: deny
value: false
experience_log:
verify_desire_log:
- type: from_intent
intent: affirm
value: true
substance:
- type: from_intent
intent: inform
value: true
dose:
- type: from_text
intent: None
not_intent: inform
note:
- type: from_text
intent: None
not_intent: inform
timing:
- type: from_text
intent: None
not_intent: inform
key_takeaway:
- type: from_text
intent: None
not_intent: inform
explanation_of_mechanism:
- type: from_text
intent: None
not_intent: inform
behavior_change:
- type: from_text
intent: None
not_intent: inform
feeling:
- type: from_text
intent: None
not_intent: inform
post by m.vielkind on Apr 6, 2021
Hi @travelmail26, for the notes_from_asana_task_selected and asana_after_note_logged slots in your asana_form you have not_intent: inform so those slots will not be filled with values that map to the inform intent. In your question you say you are forcing phrases to the inform intent so I’m wondering if removing not_intent: inform from your form slot mappings will help.
post by travelmail26 on Apr 6, 2021
@m.vielkind I’m still running into the same problem even after getting rid of the not_intent linke
notes_from_asana_task_selected:
- type: from_text
intent: None
asana_after_note_logged:
- type: from_text
intent: None
I appreciate the help! What am i doing wrong? after i type a note, which I think is for the asana_after_note_logged slot, it doesn’t complete the previous action and just loops through other actions or intents. thanks again!