
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
dialogflow-api-utils
Advanced tools
Utility lib for working with the Dialogflow (formerly api.ai) API response data
Utility lib for working with Dialogflow (formerly api.ai) API response data
npm
:npm install --save dialogflow-api-utils
Below is an example how to use the module along with the api
module.
const apiai = require('apiai');
// Utilities for v1 of the Dialogflow API
const dfUtils = require('dialogflow-api-utils').v1;
const app = apiai("<your client access token>");
var request = app.textRequest('<Your text query>', {
sessionId: '<unique session id>'
});
request.on('response', function(response) {
// get all the parameters
var params = dfUtils.Query.getResultParameters(response);
// get the value of parameter 'foo', if it isn't set, the return 'bar'
var fooParam = dfUtils.Query.getResultParameter(response, 'foo', 'bar');
// get all the messages from fulfillment
var messages = dfUtils.Query.getFulfillmentMessages(response);
// only get the messages for Facebook Messenger
var fbMessages = dfUtils.Query.getFulfillmentMessages(response, 'facebook');
// only get the messages for Slack
var slackMessages = dfUtils.Query.getFulfillmentMessages(response, 'slack');
// get the context 'userProfile'
var userProfileContext = dfUtils.Query.getResponseContext(response, 'userProfile');
// code to send messages
});
request.on('error', function(error) {
console.log(error);
});
request.end();
View documentation for an overview of all functions and their parameters
See LICENSE.
FAQs
Utility lib for working with the Dialogflow (formerly api.ai) API response data
The npm package dialogflow-api-utils receives a total of 9 weekly downloads. As such, dialogflow-api-utils popularity was classified as not popular.
We found that dialogflow-api-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.