api-ai-agent-downloader

0.0.3 • Public • Published

API.AI Agent Downloader

Programmatically download API.AI agent intents and entities for backup or analysis.

Usage

const agentDownloader = require('api-ai-agent-downloader');
const fs = require('fs');
 
const agentName = 'agent_foo';
const developerToken = 'abc123';
 
agentDownloader.getSummary(agentName, developerToken).then(summary => {
  fs.writeFileSync('./agent_foo.json', JSON.stringify(summary));
});

Note: Requests are throttled to 1 per second to avoid exceeding API.AI usage limits.

Summary format

An agent summary is an object with three keys:

For example, something like:

{
  name: 'pizzeria',
  entities: [
    {
      id: 'abc123',
      name: 'topping',
      entries: [
        {
          value: 'mushrooms',
          synonyms: ['mushrooms', 'shrooms', 'white mushrooms'],
        },
        ...
      ]
    },
    ...
  ],
  intents: [
    {
      id: 'def456',
      name: 'order pizza',
      userSays: [...],
    },
    ...
  ]
}

Readme

Keywords

none

Package Sidebar

Install

npm i api-ai-agent-downloader

Weekly Downloads

4

Version

0.0.3

License

ISC

Last publish

Collaborators

  • maxheinritz