Utter_message Not printing any response

Here are my versions :
rasa_nlu :0.15.1 , rasa_core : 0.14.5 ,rasa_core_sdk : 1.6.1

Here is the custom action file :

class ApiAction(Action): def name(self): return “custom_action_medicinesearch”

  def run(self,  dispatcher: CollectingDispatcher , tracker, domain):
    
      medicine_name = tracker.get_slot('medicine_name') 
      print("slot:" ,medicine_name)
      filename = "Sheet1.json"  
      datastore = dict()
      with open(filename, 'r') as f:
            datastore = json.load(f)
      dispatcher.utter_message('Please wait while I search for {}'.format(medicine_name))  
      flag =0
      response = "couldnot find that !"
      for items in datastore: 
            if items['Brand'] == medicine_name:
                  #print("Medicine Name : " ,items['Brand'])
                  #print("Price : " ,items['Price(In Rs.)'])
                  response = str(items['Brand']) + "\n" + "costs rupees " + str(items['Price(In Rs.)'])
                  flag = 1
                  break
      if flag ==0 :
          print("sorry I could not find that for you :(")
      print("printing :" ,response)
      dispatcher.utter_message(response)
      return[SlotSet("price_details",response)]  

The custom actions.py is getting registered successfully and the output , ie medicine name and price are stored in response is printed in docker container .


However , the utter message command is not working and its reflecting on the chat window . It is jumping to the next action in the story without printing message :frowning:

image

Please Help !

Hi @Kodah you’re mentioning that you’re using separate versions for rasa_nlu and rasa_core - we no longer support those versions. I would suggest that you use rasa version 1.6.1 to get this functioning correctly. You can install that by running:

pip install rasa==1.6.1
1 Like

Thank you so much Akelad for your response , will try it out !

Hi @Kodah, I am facing the same issue. Were you able to fix yours?