bots


Multiple assistant.ask or assistant.tell statement without user input


I needed a clarification since I am a stuck.
When I give multiple assistant.ask statements, it displays only one and then waits for the user's response.
Is there a way to send multiple statements to user?
Let's say user asks for weather.
I reply saying. "Sure, let me look up and find it out for you."
Now, I make a API call to find the weather which is async.
Then once I get the response, I want to send the response to the user "Here is the weather for the location...."
So, in between two responses, there is no user input. Any way to do this?
You haven't indicated if you are using API.AI or the Actions API directly, but it sounds like you're using the Actions API. From your description, it sounds like you're writing the function linearly - as if you're expecting assistant.ask() to stop the program and wait for a reply from the user. This isn't how assistant.ask(), or Actions in general, work.
Think of the Google Home as a web browser, and your Action will be running on a web server somewhere. assistant.ask() is equivalent to sending back a message to the browser and closing the connection (but not closing the microphone). There is no additional processing that can be done, so having statements after the ask() doesn't make sense.
The assistant.ask() replies are, themselves, handled asynchronously. The program logic doesn't pause and wait for a reply - the replies are handled by a separate call to your program.
If you're using the Actions API directly, you'll need to keep track of where in the conversation you are (the state - or what questions have been asked so far and what answers you've gotten) and execute different code paths appropriately.
You may be more interested in API.AI, which lets you build the conversations more interactively and indicate only which commands will need to send your webhook the information. Using API.AI, your programming logic doesn't need to keep track of where in the conversation you are - you build the state machine and conversation path through API.AI.
There is no way to send something unprompted through Actions right now. So the reply of "Sure, let me look that up for you" before looking up the information wouldn't be appropriate.

Related Links

How to access the filled data when using Formflow Namespace in Skype Bot Framework?
Microsoft bot framework getting the users time zone
How to get credentials for the Direct Line API microsoft bot framework?
Telegram bots: How much API keys can I generate?
Weird rendering in “Fetch as Google”
Effective way of training the bot, language processing APIs
What would be the right way to ask the person to enter a city inside a bot?
What is the right way to save/track state inside a Facebook Messenger bot?
How to implement a chatbot to human executive switch using Microsoft Bot Framework?
How to stop or throttle bot traffic
Skype bot card images not showing up
Bot Framework - Sign-In Card, how get auth result
How to stop my telegram bot replying to a message multiple times
Empty message body in receive messages from telegram bot
Bot Framework Facebook Messenger Account Linking
Slack bot - using Botkit to clear old messages

Categories

HOME
firebase
protocol-buffers
opencart
focus
scroll
foaf
code-formatting
whmcs
elk-stack
jint
video-streaming
cdi
wine
lc3
tiff
clish
pushdown-automaton
asp.net-core-1.0
nest-api
uima
boomi
gmp
renderscript
azure-machine-learning
altium-designer
backendless
tortoisehg
laravel-4.2
region
social-networking
snap-framework
delayed-job
bean-validation
keyboard-layout
redgate
runtimeexception
telephonymanager
uipickerview
resampling
yoast
latexml
doctrine-extensions
section508
beeline
cordova-ios
sharpdx
winmerge
patternlab.io
kendo-editor
degrees
petsc
deviare
gcloud-node
fragmentstatepageradapter
android-syncadapter
canopy
vdm-sl
domino-designer-eclipse
karma-coverage
componentart
com0com
nanomsg
adhoc-polymorphism
global-scope
visual-c++-2012
bittorrent-sync
radius-protocol
xmi
strdup
progress-db
postgres-xc
ax
dynamic-rdlc-generation
daap
coordinate
netstream
wcf-callbacks
mmc3
drawimage
glassfish-esb
data-dump
uipasteboard
canonicalization
formal-semantics
pinax
iphone-sdk-3.1.3
jboss-mdb
chronic
word-automation

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App