Comments (25)
At the moment I do the following:
const response = {
followupEvent: {
name: "MyEventName",
data: { value1: "asd", value2: "qwe" }
}
}
return myDialogflowApp.response_.status(200).send(response);
It's dirty, but it works and while waiting for approval and eventual publish I think is better than nothing
from actions-on-google-nodejs.
I could not find anything in the documentation. I found a function in v2 code conv.js
// See followup(event, parameters, lang).
conv.followup(eventName);
from actions-on-google-nodejs.
Well there is a pull request adding this(it works), however the person posting it, has yet to sign the CLA
from actions-on-google-nodejs.
For those who stumble on this issue looking for the followup function, It's there. Typehint the conversation object as type DialogflowConversation in the conversation handler.
See the docs
from actions-on-google-nodejs.
Very hard to find. Cost me two days to find this hint. Thank you so much wubbajack!!
+1 for conv.followup()
Google should update their documentation on dialogflow.com, to help everyone with that issue. And maybe create an example for actions-on-google V2 API. :-)
from actions-on-google-nodejs.
The only thing I can think of, is that you did not create an intnet with the event you want to be activated by the followupEvent command.
from actions-on-google-nodejs.
Hi, I am trying to use the followupEvent by building the JSON response as shown in previous comments but I still cannot trigger the event I want. I get an input.unknown as a result. I have done nothing on the dialogflow side just normal intents with no input/output contexts and both intents are set to use the webhook. Can someone tell me if I have to set up the intents from the dialogflow side to be triggered or any other step that I might have missed? thanks :)
from actions-on-google-nodejs.
I second this request, I am missing this badly!
from actions-on-google-nodejs.
I third it!
Also, something that would allow us to send an E-mail to the user on behalf of our app? On a Google Home app, where there is no display, it is a very common occurrence to want to send a user further materials in the form of a document or a link to a web page, etc. It would be very helpful to send them such an item to their linked Google E-mail account.
from actions-on-google-nodejs.
finally they took my question seriously :-)
---------- Forwarded message ----------
From: Actions on Google Support [email protected]
Date: Wed, Nov 15, 2017 at 7:50 PM
Subject: Re: how to send followup event from webhook using action-on-google lib
To: "[email protected]" [email protected]
Cc: "[email protected]" [email protected]Hi,
Thank you for your patience in this case. I just got an answer from our engineers confirming that it was not possible to fire a followup event with the actions on google nodejs library.
We have taken your request into account and will update you if the feature is pushed live.Kind Regards,
Jean-Charles,
Actions on Google Support Team.--------------- Original Message ---------------
From: inzamam malik [[email protected]]
Sent: 10/7/2017 5:42 AM
To: [email protected]
Subject: Re: how to send followup event from webhook using action-on-google libwhy you are not replying me so far
On Sep 29, 2017 6:00 PM, "inzamam malik" [email protected] wrote:
I have read rest of the api.ai document more then twice and I know well how to send followup events with simple webhook (webhook without action-on-google),
here is my repo with the sample of it (see commented code from line 35 to 54)https://github.com/malikasinger1/quizbot-reactjs-api.ai-firebase-function/blob/master/functions/src/lib/apiai-functions.tsbut my question is how to send it with action-on-google nodejs library (https://www.npmjs.com/package/actions-on-google) since we handover the request object to action-on-google and it gives us an object "app", we have methods in the object like app.ask() app.tell(), app.setContext() so i was expecting for some method like:
app.followupEvent("<event_name>",{
"<parameter_name>":"<parameter_value>>"
})app.ask();
ORapp.askWithFollowupEvent({...
})
so what you say about this? if you dont have these method you should add one,
and please let me know some place where you guise discuss future plannings
On Fri, Sep 29, 2017 at 2:44 PM, Actions on Google Support [email protected] wrote:
Hi,Thank you for your interest in Actions on Google.
I encourage you to read the api.ai documentation on follow-up events as it contains more details and examples than the page you linked to us.Kind Regards,
Jean-Charles,
Actions on Google Support Team.--------------- Original Message ---------------
From: [[email protected]]
Sent: 9/28/2017 4:34 PM
To: [email protected]
Subject: how to send followup event from webhook using action-on-google libThe following message was sent to Google
by [email protected]
at 16:34 PDT on 2017-09-28.Support request
SupportPath: /actions/support/
Sender Email: [email protected]
First Name: inzamam
Last Name: malikrequesttype: support
framework: apiai
prio: mediumSubject: how to send followup event from webhook using action-on-google lib
how to send followup event from webhook using action-on-google lib
followup event doc for reference: https://api.ai/docs/fulfillment#response
from actions-on-google-nodejs.
I really hope this will be added soo.
from actions-on-google-nodejs.
hey collaborators, any update regarding this?
from actions-on-google-nodejs.
Is this feature in the main branch yet, or is the CLA still pending?
from actions-on-google-nodejs.
+1!
from actions-on-google-nodejs.
@Iridio this worked perfectly! Good temporary approach.
from actions-on-google-nodejs.
Closing this as it's merged in v1 and available in v2.
from actions-on-google-nodejs.
is it possible in v2?
from actions-on-google-nodejs.
Wow thank you I have asked this question in the DialogFlow Help Forum and to my local Google rep and have yet to get an answer from either. It would be really nice to see this brought into some of the other documentation that talks about events but never makes mention of this method.
from actions-on-google-nodejs.
Has anyone had success passing parameter data through conv.followup()
with the latest library version?
I can successfully trigger the target intent via the event name configured within dialogflow, however the parameters don't seem to survive the trip other than as the original input parameter data stored in the _actions_on_google
context stored prior to the followup triggering.
Do I need to be retrieving the passed parameter data from the event's contents explicitly, or should I be able to followup with parameters defined in the dialogflow intent?
Cheers 👍
from actions-on-google-nodejs.
from actions-on-google-nodejs.
Has anyone had success passing parameter data through
conv.followup()
with the latest library version?I can successfully trigger the target intent via the event name configured within dialogflow, however the parameters don't seem to survive the trip other than as the original input parameter data stored in the
_actions_on_google
context stored prior to the followup triggering.Do I need to be retrieving the passed parameter data from the event's contents explicitly, or should I be able to followup with parameters defined in the dialogflow intent?
Cheers 👍
did you manage to get it work @grctest ? cause i am facing the same issue. can't seems to use the parameters value in my response
from actions-on-google-nodejs.
@kencanak I did not, however given that v2.4.0 changed followup to not purge 'conv.data', I've chosen to pass data to the followup intent via 'conv.data.variable' fields.
from actions-on-google-nodejs.
The only thing I can think of, is that you did not create an intnet with the event you want to be activated by the followupEvent command.
Thankyou man
from actions-on-google-nodejs.
@grctest @kencanak Seeing the exact same thing, reported it in a separate issue.
from actions-on-google-nodejs.
For anyone doing archaeology on this issue in the future, here is the tl;dr:
-
2 Intents: Parent Intent & Child Intent
-
In the Dialogflow web console, add an event called "my_event" to Child Intent & no training input phrases
-
In the fulfillment code for Parent Intent, you can trigger the Child Intent (which is bound to event my_event) with the following:
app.intent('parent intent', (conv, parameters) => {
conv.followup('my_event');
});
- If you wanted to pass parameters with the event you can do this (but it probably won't work the way you're expecting):
app.intent('parent intent', (conv, parameters) => {
const myData = { a:1, b:2, c:3, d: 'efgh' };
conv.followup('my_event', myData); // pass in object
});
Then in DialogFlow web console, inside Child Intent you would select parameters & explicitly map each property as a parameter.
Important trick: under the value column, you need to following the format of #event.property, ex
|| Value ||
#my_event.name.a
#my_event.name.b
#my_event.name.c
#my_event.name.d
Then in your Child Intent handler code you can access them as parameters:
app.intent('child intent', (conv, parameters) => {
const { a, b, c, d} = parameters;
conv.ask(`Got the data! ${a}, ${b}, ${c}, {d}`)
});
If you can't be bothered with all that to pass around data & trigger an intent, you can use conv.data
as an escape hatch of sorts. Note we still use an event to trigger/invoke the Child Intent, we just don't pass the event data.
From Parent Intent fulfillment handler:
app.intent('parent intent', (conv, parameters) => {
const myData = { a:1, b:2, c:3, d: 'efgh' };
conv.data = myData; // attach whatever data to conv.data
conv.followup('my_event_name'); // No data on event
});
And in Child Intent handler:
app.intent('child intent', (conv, parameters) => {
const { a, b, c, d } = conv.data;
conv.ask(`Got the data! ${a}, ${b}, ${c}, {d}`)
});
from actions-on-google-nodejs.
Related Issues (20)
- Support configuring loggers HOT 1
- Sign homegraph request using IAM API HOT 2
- Link Out Suggestion not working as expected
- smarthome Action: onSync response is invalid (according to GCP logs explorer) HOT 1
- How to bypass middleware and only get JSON response HOT 1
- queryText being sent to Dialogflow is not the original user query HOT 4
- Response is malformed HOT 1
- Smart Home: Cache authorization tokens HOT 14
- Smart Home: Allow to set https agent options HOT 1
- Error, Entity not found
- TypeError: Cannot read property '0' of undefined HOT 1
- npm audit has been reporting vulnerabilities since at least October 2020, please can we update dependencies? HOT 7
- account link success but action response error
- onDisconnect bug
- unable to trigger actions.intent.NO_MATCH HOT 2
- Can't find user access token in requests to fulfilment webhooks HOT 1
- Upgrade "google-auth-library" dependency to latest major version
- TypeError: Cannot read properties of undefined (reading '0')
- Turtorial on authentication
- Typescript doesn't compile with `strictNullChecks: true`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from actions-on-google-nodejs.