mirror of
https://github.com/DinoMalin/paranoia-1.0.git
synced 2025-10-29 03:05:59 +00:00
i fucking don't know why but it sometimes works
This commit is contained in:
parent
4f64be0b6d
commit
fb7b3bbe01
13
ai.py
13
ai.py
@ -93,7 +93,6 @@ def ask_ai(prompt):
|
||||
}
|
||||
}
|
||||
)
|
||||
print(response)
|
||||
data = json.loads(response.choices[0].message.content);
|
||||
if (not "content" in data) or (not "emotion" in data) or (not "score" in data):
|
||||
print("Error: AI failed to fill the corresponding fields.")
|
||||
@ -101,21 +100,13 @@ def ask_ai(prompt):
|
||||
|
||||
add_content("assistant", data["content"])
|
||||
send_emotion(data["emotion"])
|
||||
# say_out_loud(data["content"])
|
||||
say_out_loud(data["content"])
|
||||
|
||||
print(data["emotion"])
|
||||
print(data["score"])
|
||||
|
||||
i = 0
|
||||
while True:
|
||||
if i == 0:
|
||||
ask_ai("Mais la terre, elle est ronde !")
|
||||
elif i == 1:
|
||||
ask_ai("Je suis pas d'accord du tout avec toi !")
|
||||
elif i == 2:
|
||||
ask_ai("Ok, tu as totalement raison, je suis completement d'accord avec toi.")
|
||||
elif i == 3:
|
||||
i = 0
|
||||
# ask_ai(listen_voice())
|
||||
ask_ai(listen_voice())
|
||||
i += 1
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#include "Face.h"
|
||||
#include "characters.h"
|
||||
|
||||
hd44780_I2Cexp lcd; // auto-detects the I2C address
|
||||
hd44780_I2Cexp lcd;
|
||||
LCD _lcd(&lcd);
|
||||
Face face(_lcd);
|
||||
char last = 0;
|
||||
@ -28,8 +28,10 @@ void loop() {
|
||||
if (Serial.available() > 0) {
|
||||
char c = Serial.read();
|
||||
|
||||
if (c != last && c >= '1' && c <= '5')
|
||||
if (c != last && c >= '1' && c <= '5') {
|
||||
Serial.println(c);
|
||||
lcd.clear();
|
||||
}
|
||||
if (c < '1' || c > '5') // repeat
|
||||
c = last;
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user