-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmain.py
31 lines (26 loc) · 1007 Bytes
/
main.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
from utils import *
def chat():
nam = "Unknown"
# call = multiFunctionCall({"whoIs":whoIs,"emo":emo, "identifyu":identifyu, "whathappen":whathappen, "learnq":learnq, "learna":learna})
firstQuestion="Hi, I am chatbot."
template = "Unknown.template"
#print(template)
decryp(template)
Chat(template).converse(firstQuestion)
from os import path
if path.exists(nam+".txt"):
with open(nam+".txt", "r") as myfile:
daa = myfile.read()
with open(nam+".template", "a") as myf:
now = str(datetime.now())
myf.write("\n{ mood "+now+": "+sas(daa)+" }")
myf.write("\n{ reason "+now+": "+daa+" }")
os.remove(nam+".txt")
if path.exists("learn.txt"):
with open("learn.txt", "r") as myfile:
daa = myfile.read()
with open(nam+".template", "a") as myf:
myf.write(daa)
os.remove("learn.txt")
encryp(template)
chat()