-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
31 lines (25 loc) · 1.14 KB
/
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
import requests
import json
import time
url = "http://localhost:8000/api"
print("------+------+-----+------+-----+-----+-----+------+------")
print(" TChatBot Session Initializing......")
print("------+------+-----+------+-----+-----+-----+------+------\n")
print("TChatBot Session started at : {} ".format(time.ctime()))
print("Type \'quit\' to end chat session")
print("\n------+------+-----+------+-----+-----+-----+------+------")
time.sleep(1)
print("\nTChatBot (Bot): Hey! I'm TChatBot :)") #This will be done in the JS Backend by default
while True:
input_data = input("\nUser (Human): ")
if(str(input_data).lower()=='quit'):
print("------+------+-----+------+-----+-----+-----+------+------")
print(" TChatBot Session Expiring......")
print("------+------+-----+------+-----+-----+-----+------+------")
print("Exited Chat Session....")
print("------+------+-----+------+-----+-----+-----+------+------\n")
exit()
data = json.dumps({"input":input_data})
r = requests.post(url,data)
out = r.json()["reply"]
print("TChatBot (Bot): {}".format(out))