I am trying to deploy an index.js file in the dialogflow. so when I finish the steps if the deployment I am supposed to receive a Project Console and a Function Url. This function url is supposed to be added to the Fulfillment url to get the chatbot running. But I receive only the Project console as can been seen in the screenshot attached.
Anyone has an idea why?
Related
I'm using Twilio functions (Node) to connect to other service endpoint, messages content works smooth, but the problem I have is because I can't catch image URL to send it.
If I watch "Programmable Messaging"/"Logs/"Message Details" I see image correctly.
In "Studio"/"Webchat Flow" on Trigger/incoming message, I set the variables, according with documentation, image URL come in variable trigger.message.MediaUrl0...1...2... But... Variable content it's allways empty. I try with other variables, even I log "trigger" directly:
"{message={EventType=onMessageSent, InstanceSid=***********, Attributes={\"proxied\":true}, DateCreated=2020-10-15T13:47:35.945Z, Index=156, From=whatsapp_********, MessageSid=*****************, Source=API, AccountSid=*******************, ChannelSid=*********, RetryCount=0, WebhookType=studio, To=**********, Body=, ChannelAttributes={status=ACTIVE, long_lived=false, forwarding=true, serviceNumber=whatsapp_txmo0zqebp5s5kmxt5ivs7ofuyhgxpdl, twilioNumber=whatsapp:+TWILIO_NUMBER, from=whatsapp:+MYNUMBER, channel_type=whatsapp, proxySession=****************}, WebhookSid=*************}}"
What I'm doing wrong?
Kind regads
I have an MS Teams adapter written using the botframeworks sdk v4 for node js which works perfectly for normal conversations. But when I try to do a task/fetch, it returns an error message "Unable to reach app. Please try again." on the task module popup
I can see from the inspector that it returns 502 response for the request to invoke the task module
The task module returns a simple adaptive card and I can see that I get a callback on my handleTeamsTaskModuleFetch function from the logs
The adapter runs on a docker container with an nginx proxy and the nginx logs shows that, it returns a 200 response whenever I click on the task module launch button
I have a similar setup in my dev and taskmodule works perfect there
Any help is highly appreciated
Update
I have tried hardcoding the adaptive card. That doesnt help either
Eventually it was found that there was a problem with one of the csp headers and microsoft was not happy about it.
I removed the CSP headers and the taskmodule started working
Thanks to #gousia-msft for your help in debugging the issue
I was successfully set the Alexa Build steps(checklist) on Alexa Developer Console.
As endpoint I want to use my own remote server(nodeJS, not AWS lambda), I found the next example and trying to use it now:
https://github.com/Glogo/alexa-skill-sample-nodejs-express
By using POSTMAN I can send a JSON with intent to my nodeJS server and successfully get a response.
But once I try to test the flow through Alexa Test Simulator (Test tab in Alexa Developer Console) I don't get any response... On the server side, I can't see any request that comes from Alexa.
I wonder, what is the problem in this case?
Maybe I didn't understand how it should work... I expect to receive a JSON request from Alexa and to output a response.
It's important to mention that I didn't set any properties "Distribution" and "Certification" tabs. As I understand, for testing it's not necessary.
From the screenshot of test simulator, you didn't invoke/launch your skill. Once you launch your skill, a request JSON will be generated by which you can check whether your nodejs server can handle that request.
You can invoke your skill from Test Simulator by:
open, <skill invocation name>
This will trigger a LaunchRequest
You can directly trigger an intent of your skill by,
ask <skill invocation name> <a sample intent utterance>
This will trigger an IntentRequest with the mapped intent
For different invocation phrases, check this.
You first need to open your skill, because the simulator won't open it for you. You can do this by typing/saying
open/start/launch <invocation name>
To trigger one of your intent use
ask/tell <invocation name> <a sample utterance for your intent>
I'm using Claudia to transform my node.js app into an AWS lambda function. The integration works fine and I can access the index of my serverless website at this address:
https://*******.execute-api.eu-west-2.amazonaws.com/latest
Now I have a login page and a link to go to the page. My problem is when I click on this link, the URL is:
https://*********.execute-api.eu-west-2.amazonaws.com/login
which only returns me a forbidden message because the real page is located at:
https://******.execute-api.eu-west-2.amazonaws.com/latest/login
How can I get rid of the /latest OR how can I handle it?
Thanks for your help!
I'm trying to make an app using DialogFlow which finds a specific object in a specific place.
This is a generic example.
The user would say something like "Where to I find Dog in Europe" and the app would reply with "Dog can be found in Europe via: breeding, finding it out in the wild or by buying it"
considering Dog as input1 and europe as input2
Ideally the app should be able to cross reference input1 and input2 to find the correct response. Can I implement a database like structure and do this?
You can't access a database from Dialogflow directly, but you can build your own fulfillment backend that can do anything you want. It communicates with Dialogflow via HTTP requests/responses in the Dialogflow Webhook format.
Here is an example fulfillment that reads data from Firebase database - https://github.com/actions-on-google/dialogflow-updates-nodejs
You can't access a database directly in Dialog flow, but you can build your own fulfillment back end. I have been using Airtable as a database and Integromat and Webhooks to query the database and parse the results back to Dialogflow. As a novice coder I found this to be the simnplest way.
KaySubb is right, you can make a fulfillment that reads data from a firebase database(or firestore).
You can do this turning on fulfillment at the bottom page of the intent page.
First go to https://console.firebase.google.com/ (login with google account) and you should be able to see your google cloud platform project.
To use firebase, you need to first install it. Get node.js as you need npm first. I'm not sure what OS you're on but go into command line or terminal and type.
npm install firebase --save
then type:
firebase login
this will authenticate your login and connect your project when you deploy.
Then use go to the directory you want to create your project in:
firebase init functions
Select your project and select javascript, install all dependencies
Now go to functions and open the index.js file. Here you can change you write code needed in js.
Write your functions and type:
firebase deploy
in the command line open in the file directory. When it completes, it will
give you a link. This as the webhook URL in dialogflow (it should start with
https://us-central). If you see only 1 link which says
console.firebase.google.com....... then open that link on a browser, click on
"functions" on the left side of the screen and get the link from there.
This should get you started with firebase, now you can link your project to firebase fulfillment. There is great firestore explanation here
https://www.youtube.com/watch?v=kdk6MhhI8oc
But I'll give you a brief explanation:
On the top of your index.js file you will need:
const functions = require('firebase-functions');
var admin = require("firebase-admin");
admin.initializeApp(functions.config().firebase);
var firestore = admin.firestore();
The basic code is here:
exports.webhook = functions.https.onRequest((request, response) => {
switch(request.body.result.action){
case 'saveData':
let params = request.body.result.parameters
firestore.collection('colName').doc('docName').add({
name:params.name
age:params.age
}).then(() => {
response.send({
speech:
`this is a response for "${params.name}".`
});
})
.catch((e => {
console.log('Error getting documents', e);
response.send({
speech:
`Sorry, something has gone wrong. Try again and if the problem persists, please report it.`
});
}))
break;
default:
}
})
I'll explain what it does:
You need the switch to decide which intent to do. request.body.result.action returns the action name (write this in dialogflow just above the parameters).
Once that is decided request.body.result.parameters give you the parameters from the intent. params.______ gives you the parameter.
I would definitely recommend reading the official documentation:
https://firebase.google.com/docs/firestore/quickstart
to help understand the data structure to help create the ideal database for you. Essentially a collection is a list and within that a doc is one entry. You can name them yourself of using the entries from param.
respond.send is what the bot will reply to the user, I've also shown how to use the parameters in the response.
.catch will just store any errors in the log, you can read the log in console.firebase.google.com.... open your project and click on function. There will be a place to read logs there. You can check any errors encountered over there.
default: will output whatever default response you wrote on dialogflow at the bottom of the intent.
Hope this helps,comment any questions. I have gone through a huge amount as concisely as I could. This will take some time to get used to and become good at, follow the docs and the youtube videos if you have a lot of trouble!
If you're having even more trouble, there is a slack that helps people that I can direct you to.