From 99b2de2e210ffc0ce25c5b249649d4354570d50c Mon Sep 17 00:00:00 2001 From: talksik Date: Sat, 29 Apr 2023 11:30:14 -0700 Subject: [PATCH] basic program without conversational loop --- youwilldie/app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/youwilldie/app.py b/youwilldie/app.py index b126b2f..a2d9cb1 100644 --- a/youwilldie/app.py +++ b/youwilldie/app.py @@ -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()