Hi guys! I created a custom action for my Rasa bot, the purpose of this action is to get the slots of 2 entities and according to the values of these 2 slots, in first case the bot has to send a json to my webpage, in the second case he has to do nothing. This is an example of the code:
class get_and_send_Topic(Action):
def name(self):
return "send_Topic"
def run(self, dispatcher, tracker, domain):
get_topic = tracker.get_slot("topic")
get_page = tracker.get_slot("page_url")
if (get_topic == 'arch') and ((get_page == 'first link') or (get_page == 'second link') or (get_page == 'third link') or (get_page == 'fourth link')):
return []
elif (get_topic == 'arch') and ((get_page != 'first link') and (get_page != 'second link') and (get_page != 'third link') and (get_page != 'fourth link')):
j = '{"action" : {"type" : "CHANGE_CANVAS", "parameters" : {"window_id": "main_window", "argument" : "URL OF MY PHOTO"}}}'
.
.
.
other code similar to this
the problem is that even if I am in the condition of the if , so he should just return[] , I see that in every case, the code goes to the elif, in every case. What is wrong with this code?