这就是它所显示的:
没有名为 process_text 的模块
这是程序:
while(1):
assistant_speaks("What can i do for you?")
text = get_audio().lower()
if text == 0:
continue
if "exit" in str(text) or "bye" in str(text) or "sleep" in str(text):
assistant_speaks("Ok bye, "+ name+'.')
break
# calling process text to process the query
process_text( text )
def process_text( text ):
try:
if 'search' in text or 'play' in text:
search_web(text)
return
elif "who are you" in text or "define yourself" in text:
speak = '''Hello, I am Person. Your Assistant.
I am here to make your life easier. You can command me to perform various tasks such as calculating sums or opening applications etcetera'''
assistant_speaks(speak)
return
except :
assistant_speaks("I don't understand, I can search the web for you, Do you want to continue?")
ans = get_audio()
if 'yes' in str(ans) or 'yeah' in str(ans):
search_web(text)