-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.txt
157 lines (116 loc) · 3.17 KB
/
notes.txt
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# threaded http
https://pymotw.com/2/BaseHTTPServer/index.html#module-BaseHTTPServer
# ssl
openssl req -new -keyout crt.pem -out crt.pem -x509 -days 365 -nodes -subj '/CN=site.com/O=user/C=RU'
# GET test
curl http://localhost:8000
# POST test
curl -d '{"request": {"command": "включить"}, "session": {"skill_id": "12345", "message_id": 1, "session_id": "12345", "user_id": "12345", "new": true}, "version": "1.0"}' -H "Content-Type: application/json" -X POST http://localhost:8000
# Yandex.dialogs
https://tech.yandex.ru/dialogs/alice/doc/protocol-docpage/
input example:
{
"meta": {
"locale": "ru-RU",
"timezone": "Europe/Moscow",
"client_id": "ru.yandex.searchplugin/5.80 (Samsung Galaxy; Android 4.4)",
"interfaces": {
"screen": { }
}
},
"request": {
"command": "закажи пиццу на улицу льва толстого, 16 на завтра",
"original_utterance": "закажи пиццу на улицу льва толстого, 16 на завтра",
"type": "SimpleUtterance",
"markup": {
"dangerous_context": true
},
"payload": {},
"nlu": {
"tokens": [
"закажи",
"пиццу",
"на",
"льва",
"толстого",
"16",
"на",
"завтра"
],
"entities": [
{
"tokens": {
"start": 2,
"end": 6
},
"type": "YANDEX.GEO",
"value": {
"house_number": "16",
"street": "льва толстого"
}
},
{
"tokens": {
"start": 3,
"end": 5
},
"type": "YANDEX.FIO",
"value": {
"first_name": "лев",
"last_name": "толстой"
}
},
{
"tokens": {
"start": 5,
"end": 6
},
"type": "YANDEX.NUMBER",
"value": 16
},
{
"tokens": {
"start": 6,
"end": 8
},
"type": "YANDEX.DATETIME",
"value": {
"day": 1,
"day_is_relative": true
}
}
]
}
},
"session": {
"new": true,
"message_id": 4,
"session_id": "2eac4854-fce721f3-b845abba-20d60",
"skill_id": "3ad36498-f5rd-4079-a14b-788652932056",
"user_id": "AC9WC3DF6FCE052E45A4566A48E6B7193774B84814CE49A922E163B8B29881DC"
},
"version": "1.0"
}
output example:
{
"response": {
"text": "Здравствуйте! Это мы, хороводоведы.",
"tts": "Здравствуйте! Это мы, хоров+одо в+еды.",
"buttons": [
{
"title": "Надпись на кнопке",
"payload": {},
"url": "https://example.com/",
"hide": true
}
],
"end_session": false
},
"session": {
"session_id": "2eac4854-fce721f3-b845abba-20d60",
"message_id": 4,
"user_id": "AC9WC3DF6FCE052E45A4566A48E6B7193774B84814CE49A922E163B8B29881DC"
},
"version": "1.0"
}
###################################################################