Getting text response of the assistant's conversation? - google-assistant-sdk

With the ON_RECOGNIZING_SPEECH_FINISHED event, the user's query is obtained in text. But how do you get a text response of the Assistant's reply ?
Is there any text field in ON_RESPONDING_FINISHED event. I want to display the assistant's reply, how is that possible ?

There is not a way to do this as of the Google Assistant Service developer preview v1alpha2.
See this similar StackOverflow question for more context: How to receive answer from Google Assistant as a String, not as an audio stream
Update 4/18/18: You might want to check out supplemental_display_text. It's not a transcription of the audio, but works pretty well in many cases.

Related

Apple messages auto-call

have an interesting problem I need to solve, I was hoping if anyone could give me some sort of an idea.
For example, if I get a text from someone saying (string) “URGENT” on my iPhone, I want to call them immediately.
So say I get a message, it could be any message but if their message says “urgent”, I need to call them ASAP, even when my phone is turned off.
Is there a way to do this, using API or anything?? I have no idea!!
Example say I get a messages saying:
Number 042XXXXX sends me a text:
"Hi Name, I have some urgent work for you"
Number 1300 XXX XXX sends me a text:
"Urgent help needed"
Both of these messages would be read by iPhone and their respective numbers would be dialled urgently.
Is there such a way to do this/automate this??
Any advice would be appreciated!!
I have no idea what to do, I am blank!!
I think the problem you have needs an indirect solution because, as Paulw11 points out, Apple don't allow you to inspect the message directly.
It would be possible to make use of Twilio's Programmable SMS API to setup a special phone number that customers could send text messages to. Then you use the APIs of Twilio to read the messages and then send an Apple Push Notification message for those the had "urgent" in the message.
You could then write an iOS app which receives push notification messages and takes the actions you desire. For example, it could present a screen which could automatically dial the number in question.

Twilio Programmable Video - Starting a video call without the user having to enter a room ID and name

I'm working with twilio programmable video and I've hit a snag.
My issue with programmable video at the moment is that it requires all users to manually enter a roomID and name. I'd like to send the user a URL with the name and roomID already baked in so they can instantly click and join.
Is this possible?
I know if I hit the /token?identity=Joe&roomName=JoesRoom endpoint, it returns a token, but i'm unsure of how I can leverage that to dynamically enter a room without the user still having to manually enter information.
Any help would be appreciated.
I achieved this by using a hidden form and a little bit of JS to pull the data from the query string.

Deeplink iOS Calendar

Trying to share a calendar event over SMS. The text contains the datetime of the event, which iOS picks up as a link, which opens iCal (Create Event, Create Reminder, Show in Calendar, Copy Event).
When a user taps "Create Event" - it just creates an empty cal event for the datetime. Is there a way to auto-fill the event with details when the users taps "Create Event"? Perhaps through deeplinking a URL or similar?
The behaviour you describe is iphone ios doing some natural language processing and recognising that 'hey that looks like a date or time and location'. When you click on the text, it will offer to create the event but one still has to fill in the rest of the details. It is not yet clever enough to work out the Event subject, and may not be that good at it if it tried.
There is a term 'Rich Media Messaging'(RMM) which aims to get past the limitations of the basic sms (short message system). This is hard if one is looking for universal phone and phone provider support as not all phones do multi media messaging. RMM appears to basically be a combination of multi media messages and short links. So basically there is no 'markup' for simple text messaging.
The only reliable universally acceptable way to 'text' an event via sms, an event with full details that would be recognised by all smart phones is via a link to an ics file. As the standard SMS length is only 160 characters and most hyperlinks are pretty long (usually between 40 to 100 characters), they can eat up necessary space in your message. Unicode characters could use that up quicker, so a user friendly short link might be best.
The ics file has all the info to pass to the system:
the text/calendar mime type tells the system it's got events inside so pass the file to the calendar app
then the contents of the ics file inform the calendar app of all the bits of the event as per the RFC5545.
For demonstration, I texted the "5 May yoga" single event link from this page https://test.icalevents.com/agenda/ to a phone. That ics file only contains a single event.
When one clicks on the link in the text message, the smartphone does as described above and suggests to create an event. This method has the benefit that one could perhaps track the clicks to the short link.

Having a user click a link in a Slack Incoming Webhook Message and getting their response

I'm looking to have a user type something like
/makemeeting today # 4:00pm
this fires a outgoing webhook, which stores the info, then it fires a incoming webhook which would display a message in a channel saying meeting scheduled, and have two links
yes | no
Here's where I'm stuck. I can do everything up till this point. I'd love for any user to be able to click on one of those links and have it perform another outgoing webhook with the proper response.
I know I can just make those links point to a website, but I'd love to keep it all within slack without having to open a browser.
Is this possible? I swear I've seen yes|no, true|false replies before in other commands and bots, but I might be imagining that.
Any help would be appreciated...
thanks
This isn't supported yet but is on Slack's roadmap for the "near term".
https://trello.com/c/DVrJLbxX/12-interactive-messages
A work around is to add reactions to your message. When the user clicks the reaction (to bump up its count), an RTM event will be dispatched for you to handle: https://api.slack.com/events/reaction_added
An live example can be seen with the Meekan calendar app: https://meekan.com/slack/
So you could have two reactions: thumbs up and a thumbs down. And handle which reaction the user clicked.

Twilio send specific message based on message received

I was wondering if anyone knows of good resources for learning how to send Twilio messages based on what message a client sends. For example if a client texts "current song", to send the current song title. If a client texts "current artist", to send the current artist. I wasn't able to find anything about that in the Twilio documentation. I may have overlooked it or something. Wasn't sure how to do a Google/Bing search on the topic as I wasn't getting results with my search term.
Thanks in advance!
Twilio Developer Evangelist here,
For your example, you would want to parse the message body of any incoming SMS and have some logic on your end that checks if that message is "current song" or "current artist" and handle that appropriately. How you handle generating a response is left entirely to the developer's discretion.
To get up and running quickly with receiving and responding to SMS, check out the Twilio documentation if you haven't already. The dropdown on the right hand will let you select from several languages to get started with.
A quick example using NodeJS with Express would look like this:
router.post('/text',function(req,res) {
if(req.body.Body == "current artist"){
console.log("A request for the current artist has been made.");
}
});

Resources