mirror of
https://github.com/DinoMalin/paranoia-1.0.git
synced 2025-10-29 19: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);
|
data = json.loads(response.choices[0].message.content);
|
||||||
if (not "content" in data) or (not "emotion" in data) or (not "score" in data):
|
if (not "content" in data) or (not "emotion" in data) or (not "score" in data):
|
||||||
print("Error: AI failed to fill the corresponding fields.")
|
print("Error: AI failed to fill the corresponding fields.")
|
||||||
@ -101,21 +100,13 @@ def ask_ai(prompt):
|
|||||||
|
|
||||||
add_content("assistant", data["content"])
|
add_content("assistant", data["content"])
|
||||||
send_emotion(data["emotion"])
|
send_emotion(data["emotion"])
|
||||||
# say_out_loud(data["content"])
|
say_out_loud(data["content"])
|
||||||
|
|
||||||
print(data["emotion"])
|
print(data["emotion"])
|
||||||
print(data["score"])
|
print(data["score"])
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
while True:
|
while True:
|
||||||
if i == 0:
|
ask_ai(listen_voice())
|
||||||
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())
|
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#include "Face.h"
|
#include "Face.h"
|
||||||
#include "characters.h"
|
#include "characters.h"
|
||||||
|
|
||||||
hd44780_I2Cexp lcd; // auto-detects the I2C address
|
hd44780_I2Cexp lcd;
|
||||||
LCD _lcd(&lcd);
|
LCD _lcd(&lcd);
|
||||||
Face face(_lcd);
|
Face face(_lcd);
|
||||||
char last = 0;
|
char last = 0;
|
||||||
@ -28,8 +28,10 @@ void loop() {
|
|||||||
if (Serial.available() > 0) {
|
if (Serial.available() > 0) {
|
||||||
char c = Serial.read();
|
char c = Serial.read();
|
||||||
|
|
||||||
if (c != last && c >= '1' && c <= '5')
|
if (c != last && c >= '1' && c <= '5') {
|
||||||
|
Serial.println(c);
|
||||||
lcd.clear();
|
lcd.clear();
|
||||||
|
}
|
||||||
if (c < '1' || c > '5') // repeat
|
if (c < '1' || c > '5') // repeat
|
||||||
c = last;
|
c = last;
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user