File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 1
1
.idea /
2
2
logs /*
3
3
! logs /
4
- * .pyc
4
+ * .pyc
5
+ venv /
6
+ env /
Original file line number Diff line number Diff line change
1
+ import requests ,json
2
+
3
+ '''
4
+ define initial payload
5
+ set input = 'init_conversation' so that bot will return default welcome message
6
+ '''
7
+ payload = {
8
+ "currentNode" : "" ,
9
+ "complete" : None ,
10
+ "context" : {},
11
+ "parameters" : [],
12
+ "extractedParameters" : {},
13
+ "speechResponse" : "" ,
14
+ "intent" : {},
15
+ "input" : "init_conversation" ,
16
+ "missingParameters" : []
17
+ }
18
+
19
+ while True :
20
+ r = requests .post ("http://localhost:8001/api/v1" , json = payload )
21
+ # replace payload variable with api result
22
+ payload = json .loads (r .text )
23
+
24
+ print ("Iky\t " + payload .get ("speechResponse" ))
25
+
26
+ # read user input
27
+ payload ["input" ]= raw_input ("You:\t " )
You can’t perform that action at this time.
0 commit comments