question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: No responses defined for platform: DIALOGFLOW_CONSOLE

See original GitHub issue

Hi All,

I am trying to read data from an API in Dialogflow. Below is the code but I am getting the following error and it looks like I have defined my responses in agent.add but still getting the following error. I am not a java expert but trying to learn and maybe I am doing some syntax error. I am not sure but I would appreciate your time and help. Following are errors i am getting:

Error: No responses defined for platform: DIALOGFLOW_CONSOLE
at WebhookClient.send_ (/workspace/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:488:13)
    at promise.then (/workspace/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:306:38)
    at process._tickCallback (internal/process/next_tick.js:68:7)

textPayload: "Error: No responses defined for platform: DIALOGFLOW_CONSOLE
    at WebhookClient.send_ (/workspace/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:488:13)
    at promise.then (/workspace/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:306:38)
    at process._tickCallback (internal/process/next_tick.js:68:7)"
insertId: "000000-1fd08a04-56f8-4c82-b000-360724f95c3a"
resource: {2}
timestamp: "2020-10-21T19:07:49.495Z"
severity: "ERROR"
labels: {1}
logName: "projects/testbigquery-edjv/logs/cloudfunctions.googleapis.com%2Fcloud-functions"
trace: "projects/testbigquery-edjv/traces/e8c0d32bfe9e582267667f01e30c1141"
receiveTimestamp: "2020-10-21T19:07:49.683046180Z"

Function execution took 1294 ms, finished with status: 'crash'
textPayload: "Function execution took 1294 ms, finished with status: 'crash'"
insertId: "000000-0840e9bd-0a4b-4ee3-bf4d-9a1e451a2c0f"
resource: {2}
timestamp: "2020-10-21T19:07:49.497111804Z"
severity: "DEBUG"
labels: {1}
logName: "projects/testbigquery-edjv/logs/cloudfunctions.googleapis.com%2Fcloud-functions"
trace: "projects/testbigquery-edjv/traces/e8c0d32bfe9e582267667f01e30c1141"
receiveTimestamp: "2020-10-21T19:07:49.683046180Z"

My code is below: // See https://github.com/dialogflow/dialogflow-fulfillment-nodejs // for Dialogflow fulfillment library docs, samples, and to report issues ‘use strict’;

const functions = require(‘firebase-functions’); const {WebhookClient} = require(‘dialogflow-fulfillment’); const {Card, Suggestion} = require(‘dialogflow-fulfillment’); const axios = require(‘axios’);

process.env.DEBUG = ‘dialogflow:debug’; // enables lib debugging statements

exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => { const agent = new WebhookClient({ request, response }); console.log('Dialogflow Request headers: ’ + JSON.stringify(request.headers)); console.log('Dialogflow Request body: ’ + JSON.stringify(request.body));

function getSpreadsheetData(){ return axios.get(‘https://sheetdb.io/api/v1/y79vpk8pj29cv’); }

function welcome(agent) { const city =agent.parameters.city; return getSpreadsheetData().then(res => { res.data.map(person => { if(person.City === city) agent.add(Here are the details for ${"city"}.CollectionC: ${person.CollectionC}, Address: ${person.Address}, Phone: ${person.Phone}); }); });
}

function fallback(agent) { agent.add(I didn't understand); agent.add(I'm sorry, can you try again?); }

// // Uncomment and edit to make your own intent handler // // uncomment intentMap.set('your intent name here', yourFunctionHandler); // // below to get this function to be run when a Dialogflow intent is matched // function yourFunctionHandler(agent) { // agent.add(This message is from Dialogflow's Cloud Functions for Firebase editor!); // agent.add(new Card({ // title: Title: this is a card title, // imageUrl: ‘https://developers.google.com/actions/images/badges/XPM_BADGING_GoogleAssistant_VER.png’, // text: This is the body text of a card. You can even use line\n breaks and emoji! 💁, // buttonText: ‘This is a button’, // buttonUrl: ‘https://assistant.google.com/’ // }) // ); // agent.add(new Suggestion(Quick Reply)); // agent.add(new Suggestion(Suggestion)); // agent.setContext({ name: ‘weather’, lifespan: 2, parameters: { city: ‘Rome’ }}); // }

// // Uncomment and edit to make your own Google Assistant intent handler // // uncomment intentMap.set('your intent name here', googleAssistantHandler); // // below to get this function to be run when a Dialogflow intent is matched // function googleAssistantHandler(agent) { // let conv = agent.conv(); // Get Actions on Google library conv instance // conv.ask(‘Hello from the Actions on Google client library!’) // Use Actions on Google library // agent.add(conv); // Add Actions on Google library responses to your agent’s response // } // // See https://github.com/dialogflow/fulfillment-actions-library-nodejs // // for a complete Dialogflow fulfillment library Actions on Google client library v2 integration sample

// Run the proper function handler based on the matched Dialogflow intent name let intentMap = new Map(); intentMap.set(‘Default Welcome Intent’, welcome); intentMap.set(‘Default Fallback Intent’, fallback); // intentMap.set(‘your intent name here’, yourFunctionHandler); // intentMap.set(‘your intent name here’, googleAssistantHandler); agent.handleRequest(intentMap); });

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

5reactions
gjvanouwendorpcommented, Dec 20, 2021

I was struggling with this error for hours, only to find out I needed to change these 2 little things:

  • in package.json, change the version of “dialogflow-fulfillment” to “0.6.1” (instead of 0.5.0)
  • make sure your intent has at least 1 default response in the bottom section of the intent configuration screen (Dialogflow ES)
0reactions
clin366commented, Dec 5, 2022

Pay attention to the code here (`` symbol is very important): axios.post(https://sheetdb.io/api/v1/htvjf0t8az3f8?sheet=Entries, {“data”: { “EntryType”:agent.parameters.entrytype, “Date”:agent.parameters.date, “Amount”:agent.parameters.amount } });

Read more comments on GitHub >

github_iconTop Results From Across the Web

no responses defined for platform: google_telephony at ...
I was able to solve the problem by changing the version of dilogflow-fulfillment to the latest i.e. 0.6.1 in package.json, also replaced ...
Read more >
No responses defined for platform: DIALOGFLOW_CONSOLE
When I look at the logs I see this error when testing from DialogFlow Console: No responses defined for platform: DIALOGFLOW_CONSOLE.
Read more >
Troubleshooting | Dialogflow Documentation - Google Cloud
Issue. Received PERMISSION_DENIED response for API call. Solution. Ensure you have set up (CX, ES) authentication and roles correctly.
Read more >
Build fulfillment (Dialogflow) - Google Developers
Fulfillment defines the conversational interface for your Action to obtain user input and the logic to process the input and eventually ...
Read more >
How to make an employee-facing chatbot with Dialogflow in ...
You can use console.log() to print to the Firebase console, and other debugging and error messages are viewable here. General messages about the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found