Today, we are starting open beta testing of the
Yandex.Dialogues platform, with the help of which any developer will be able to teach Alice new skills and attract users to their services and developments. In this post we will not retell all the documentation, but we will give a general idea of the work of the platform on the example of the most popular game for Alice.

Alice’s voice assistant, which we first talked about on Habré last fall, is already working in the Yandex, Yandex Browser application, and also in the beta version for Windows. Every day, millions of users of these products solve certain tasks with the help of a voice assistant - for example, they will recognize the weather forecast. We regularly add new features, but it is impossible to cover all the interests of users on our own. The skills of Alice are designed to fill this gap, the features of which we will describe under the cut.
')
If you are developing a text game, an informational bot, or even a home delivery service, then you can now add them to Alice. At the technical level, this means that you can connect the service running on your server to the Alice platform. When a user activates such a skill, Alice translates the user's remarks to your server, and responds with the text you send. Speech recognition in the text and back platform takes over. For a user, a conversation using the skill looks like a normal dialogue with a voice assistant.

In order not to turn this post into a retelling and so enough detailed documentation, we will talk about the features of creating skills on the example of the game in the city.
Alice, let's play in the cityLast year we began to teach Alice various
games . We never talked about this, but almost all of them were added using the Yandex.Dialogy platform, to the testing of which we open up access today. The most popular among them is the game in the city, which we consider in more detail.

The game, like any other skill, begins with the recognition of a phrase like "Alice, turn on the game into the cities." The word "turn on" is a signal to Alice that you need to launch a skill, and not to look for an answer using a search. There are several signal words. And part of the "game in the city" in the spoken phrase - this is one of the activation names that are set by the developer when publishing the skill in the Dialogues platform. The voice assistant can understand the different morphological forms of the same activation name to trigger even with inaccurate coincidences.
Alice, call the game in the city
Alice, let's play cities
Alice, run the game in the city
In the usual situation, Alice is looking for answers using Yandex services, but if we are talking about skill, then after recognizing the activation name, she sends a POST request to the server specified by the developer. The request is a familiar JSON and contains text from the user, as well as service information (user IDs and sessions).
Request example{
"meta": {
"locale": "ru-RU",
"timezone": "Europe/Moscow",
"client_id": "ru.yandex.searchplugin/5.80 (Samsung Galaxy; Android 4.4)"
},
"request": {
"type": "SimpleUtterance",
"markup": {
"dangerous_context": true
},
"command": "",
"original_utterance": " . .",
"payload": {}
},
"session": {
"new": true,
"session_id": "2eac4854-fce721f3-b845abba-20d60",
"message_id": 4,
"skill_id": "3ad36498-f5rd-4079-a14b-788652932056",
"user_id": "AC9WC3DF6FCE052E45A4566A48E6B7193774B84814CE49A922E163B8B29881DC"
},
"version": "1.0"
}
. C++,
Node.js Python. – 1,5 .
JSON- , . :
{
"response" : {
"tts" : "--+. . . . . «».",
"end_session" : false,
"text" : "--. . . . . «».",
"buttons" : [
{
"url" : "https://www.yandex.ru/search/?text= --",
"title" : " "
},
{
"hide" : 1,
"title" : ""
}
]
},
"version" : "1.0",
"session" : {
"message_id" : 35,
"user_id" : "9F2D0DFC3E56611A1428DBD1ED22E8C7028BD06416F0A9B4F245D2896BA93C7B",
"session_id" : "6f586354-45bbe1e6-647f5637-e008",
"new" : null,
"skill_id" : "672f7477-d3f0-443d-9bd5-2487ab0b6a4c"
}
}
,
TTS (text-to-speech). . , .
, JSON- . . ( ), . , , .

. , . , . , , , , .
:, , . , . . . , .
. , :) , . – . : .

. , . , . . , (, ).

– . , Flowwow.com, . , McDonald’s « ».
?1.
., . Now, .
2.
.. , (
).
3. . ,
- ( « » ). , .
- . , . ,
,
. !