dialogflow-fulfillment-utils
Utility lib for handling Dialogflow v2 API detectIntent
Response object's filfillment
object
Installation
- Requires Dialogflow SDK or similar
- Install module with
npm
:
npm install --save dialogflow-fulfillment-utils
Usage
Below is an example how to use the module along with the api
module.
const dialogflow = ;const uuid = ;const dffUtils = ; /** * Send a query to the dialogflow agent, and return the query result. * @param */ { // A unique identifier for the given session const sessionId = uuid; // Create a new session const sessionClient = ; const sessionPath = sessionClient; // The text query request. const request = session: sessionPath queryInput: text: // The query to send to the dialogflow agent text: 'hello' // The language used by the client (en-US) languageCode: 'en-US' ; // Send request and log result const responses = await sessionClient; // get all the messages from fulfillment var messages = dffUtils; // only get the messages for Facebook Messenger var fbMessages = dffUtils; // only get the messages for Slack var slackMessages = dffUtils; }
Documentation
View documentation for an overview of all functions and their parameters
License
See LICENSE.