You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
I've been using dialogflow-fulfillment-nodejs library for a few days now, so far, so good.
But when trying to request data from an external API within the fulfillment handler, I've been facing a tenacious error:
(node:67018) UnhandledPromiseRejectionWarning: Error: No responses defined for platform: DIALOGFLOW_CONSOLE
at V2Agent.sendResponses_ (/Users/x99/Documents/Repositories/PROJECT/functions/node_modules/dialogflow-fulfillment/src/v2-agent.js:243:13)
at WebhookClient.send_ (/Users/x99/Documents/Repositories/PROJECT/functions/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:505:17)
at /Users/x99/Documents/Repositories/PROJECT/functions/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:316:38
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:94:32)
Here's the code:
const{ response }=require('express');varhttps=require('https');functionhttpRequest(params,postData){returnnewPromise(function(resolve,reject){varreq=https.request(params,function(res){// reject on bad statusif(res.statusCode<200||res.statusCode>=300){returnreject(newError('statusCode='+res.statusCode));}// cumulate datavarbody=[];res.on('data',function(chunk){body.push(chunk);});// resolve on endres.on('end',function(){try{body=JSON.parse(Buffer.concat(body).toString());}catch(e){reject(e);}resolve(body);});});// reject on request errorreq.on('error',function(err){// This is not a "Second reject", just a different sort of failurereject(err);});if(postData){req.write(postData);}// IMPORTANTreq.end();}).catch(function(error){console.error("Promise rejected");});}exports.howManyTasks=function(agent){console.log("[INFO] howManyTasks");consthost="myapihost.com"constpath="/api/users/myusertoken/task_lists";constbearerToken="mybearertoken";varparams={hostname: host,port: 443,path: path,method: 'GET',headers:{Authorization: ' Bearer '+bearerToken}};httpRequest(params).then(function(body){console.log(body);}).catch(function(){console.error("Promise Rejected");});console.log("[INFO] I'm out!");}
From what I see in the logs, the error comes from the library itself? Knowing that beyond the error, my code successfully retrieves the needed data from the API.
The text was updated successfully, but these errors were encountered:
I have this error too, my code worked before when I deploy it. But after few hours (or other trigger, I don't know for sure) Dialogflow fulfillment's requests have changed and now it come with "originalDetectIntentRequest" field. And I stuck here for 3 days.
Are you found any solution for this? Or alternative library to use with dialogflow fulfillment? Since this library is deprecated.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi there.
I've been using dialogflow-fulfillment-nodejs library for a few days now, so far, so good.
But when trying to request data from an external API within the fulfillment handler, I've been facing a tenacious error:
Here's the code:
From what I see in the logs, the error comes from the library itself? Knowing that beyond the error, my code successfully retrieves the needed data from the API.
The text was updated successfully, but these errors were encountered: