Once the respective actions based on user speech are performed the control fall backs to to NextStep flow wherein Aryan asks users in case of any next set of actions that needs to be performed before going to sleep again.
Do you want to search for anything else?
PrintText(aifriend,"Do you want to search for anything else?")
SpeakText(aifriend,"Do you want to search for anything else?")
r = sr.Recognizer()
with sr.Microphone()as source:
audio = r.listen(source)
speech = r.recognize_google(audio)
On Basis of User response after text transformation, following actions are taken
If response is Yes, then Aryan asks Human on what else I can do and SpeechRecognization flow is triggered to listen to user and take the necessary steps.
PrintText(aifriend,"What else i can do?")
SpeakText(aifriend,"What else i can do?")
If response is No or Thank you, then the AI worker scripts exits, AI Master after this graceful exit falls back to Sleeping mode.