Mycroft Community Forum

Get_response() not always working

Hi!
I have a skill that I need to have the user interact with and I’m using the get_response() method to try save users responses. My problem is that sometimes this works and sometimes it doesn’t leading me to believe I’m not using it correctly. An example of how my code works is as follows:

@intent_handler(IntentBuilder('HelloWorld').require('Hello').require('World'))
def handle_hello_world(self, message):
   self.speak("Hello")
   name = self.get_response("Whats your name")
   if name = "john":
      self.speak("Hi john")
   else:
      self.speak("Hi stranger")

When I type a name into the mycroft-cli after the “Whats your name” dialogue, I sometimes get “I don’t understand” etc, while other times it picks me up perfectly.
My Logs look like the following:

|Timeout occurred check responses
|Searching for john
|Removing event fallback-query.mycroftai:QuestionQueryTimeout

I’d to know how to better use the get_responses() function to get more consistent results. All help is appreciated thank you!

I have found when using the cli you need to ensure that mycroft is prepared to listen before sending the response. Under normal conversation mycroft would respond with a sound indicating it is listening but when using the cli if you don’t wait for that sound before sending the response it may get missed as the command line may respond with the get_response question before it is ready to listen. Watch the cli window for something like this before sending the cli response

1 Like

Sometimes I don’t see this pop up but when I do and I respond on cue, it works, thank you!

1 Like