-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtalkToAI.js
58 lines (48 loc) · 1.38 KB
/
talkToAI.js
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const express=require('express')
const app=express()
let p = require('python-shell');
app.get('/send',(req,res)=>{
content=[
{
"username": "admin",
"first_name": "",
"last_name": "",
"roles": "system_admin system_user",
"locale": "en",
"delete_at": 0,
"update_at": 1511335509393,
"create_at": 1511335500662,
"auth_service": "",
"email": "[email protected]",
"auth_data": "",
"position": "",
"nickname": "",
"id": "pbjds5wmsp8cxr993nmc6ozodh"
},
{
"username": "chatops",
"first_name": "",
"last_name": "",
"roles": "system_user",
"locale": "en",
"delete_at": 0,
"update_at": 1511335743479,
"create_at": 1511335743393,
"auth_service": "",
"email": "[email protected]",
"auth_data": "",
"position": "",
"nickname": "",
"id": "akxdddp5p7fjirxq7whhntq1nr"
}]
var options = {
args:
[
JSON.stringify(content)
]
}
p.PythonShell.run('compute-input.py', options, function (err, results) {
console.log(results.toString())
});
})
app.listen('5000')