basic program without conversational loop
This commit is contained in:
+4
-1
@@ -49,7 +49,7 @@ def turnOnLED():
|
||||
# see if we should execute a certain command based on the current text block
|
||||
def process(text):
|
||||
if "live" in text and "how long" in text:
|
||||
tts.say("")
|
||||
tts.say("Heran")
|
||||
elif "good morning" in text:
|
||||
dt = datetime.now()
|
||||
dayOfWeek = dt.weekday()
|
||||
@@ -57,6 +57,8 @@ def process(text):
|
||||
tts.say(f"Good morning! Today is {full_month_name} {dt.day}, {dt.year}. The day of the week is {dayOfWeek}")
|
||||
|
||||
|
||||
tts.say("hello, how can I help you today?")
|
||||
|
||||
if __name__ == '__main__':
|
||||
while True:
|
||||
state = GPIO.input(BUTTON)
|
||||
@@ -74,6 +76,7 @@ if __name__ == '__main__':
|
||||
print(response.json())
|
||||
results = response.json().get("results")
|
||||
command = results[0].transcript
|
||||
process(command)
|
||||
else:
|
||||
if not audioInstance.isRecording():
|
||||
turnOnLED()
|
||||
|
||||
Reference in New Issue
Block a user