-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest6.py
41 lines (38 loc) · 1.33 KB
/
test6.py
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
31
32
33
34
35
36
37
38
39
40
41
from AI import Ai_assistent
from speech import Ai_assis
from mail import Mail
import json
log_data={}
def Bless_ai():
text_output="can u please mail text dev and tell him. taht i am bus right now and I'll arrive college soon"
AI=Ai_assistent()
MAIL=Mail()
user_and_ai=Ai_assis()
mail_json=AI.Mail(text_output)
try:
mail_status=json.loads(mail_json)
print(mail_status)
except:
mail_status={"status":"no"}
pass
if mail_status["status"] == "yes":
Ai_Listen_you="Sure your Email has been sent"
log_data["blessi_text"]=Ai_Listen_you
log_data["mail_status"]=mail_status["status"]
log_data["mail_data"]=mail_status
mail_id=mail_status['details']['mail_id']
subject=mail_status['details']['mail_title']
body=mail_status['details']['mail_desc']
MAIL.send_mail(mail_id,subject,body)
else:
Ai_Listen_you=AI.Assistent_listen(text_output)
log_data["blessi_text"]=Ai_Listen_you
log_data["mail_status"]=mail_status["status"]
log_data["mail_data"]="None"
pass
Bless_ai()
#Some TEST
# AI=Ai_assistent()
# mail_status=AI.Mail("can u mail to my friend on [email protected] where u have ened to say that whazzup brob hows doing ")
# parsed_result = json.loads(mail_status)
# print(parsed_result['details']['mail_id'])