-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
30 lines (27 loc) · 1.02 KB
/
main.py
File metadata and controls
30 lines (27 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from speech_handler import listen, sr
from gemini_handler import get_response, give_get_response
from tts_handler import speak
from functions import *
while True:
try:
text = input("Enter Prompt: ") #"It is too dark in this room"
#text = listen()
print("📝 You said:", text)
command, reply = get_response(text)
#print("🤖 Little Bot says:", reply)
#print("Command", command)
print("..excecuting command")
if "get_response" in command:
speak(reply)
run_command("from gemini_handler import my_initial_question; "+command, globals())
run_command(command)
else:
run_command("from gemini_handler import my_initial_question; "+command, globals())
speak(reply)
publish("0")
except sr.UnknownValueError:
print("❌ Sorry, I couldn't understand that.")
except sr.RequestError as e:
print(f"🔌 Request error: {e}")
except Exception as e:
print(f"⚠️ Error: {e}")