All the scripts needed for ApiAi Management.
Conversion tool between api.ai zip file and a single json file containing all the relevant data.
Conversion tool between our custom api.ai json file to json file ready for translation (have a look at : /apiai)
Tool to update all the api.ai agents at once.
-
It will get the associate archive depending on the language of the bot. You can either restore or update the agent (
option
->reset
). Restoration is discouraged as it might alter the language property of the agent -
It requires to have a cookie string containing the session information in order to authenticate. This cookie string must be in the
APIAI_COOKIE
environment variable. -
It can filter the agents, you'll have to change the
filter
options in theGruntfile
, the list is extracted from https://console.api.ai/api-client/agents/, each agent is send to the filter: list.filter(filterFunction)
-
Work on one agent in api.ai, add you intents and entities, with example and (if needed) the responses.
-
Download the agent archive (
Settings/Export and Import/Export as Zip
) and copy it toapiai/archives/ovh-chatbot.zip
-
$ grunt export
: it will create theapiai/translations
folder and thetemplate.json
based on theapiai/archives/ovh-chatbot.zip
. -
Provide all the translations files needed based of the generated translation file:
translations/apiai_fr.json
-
Update the translations
-
Set the
APIAI_COOKIE
environment variable, how to do it:- Login to api.ai.
- Open the developer tools.
- Go to https://console.api.ai/api-client/user/.
- In your developer tools window, go to the network tab.
- Find the request.
- The cookie value, in the request headers is what you need.
-
$ grunt import
: it will generate back the different archives and upload it to api.ai -
You're done! Each agent in api.ai has been updated to the last translations files and the new intents and entities have been added 🎉
-
(optional) If you add a new language, don't forget to update the mongo db with the new locale and token