Making callouts to webhooks from action skills - ibm-cloud

I am currently making a Watson Assistant in which I need to store data collected in a database. I am trying to do this by calling an endpoint I have created that will insert data into my database, however I do not know how I can use webhooks in my action skills.

The documentation has an overview of where and how webhooks are supported by Watson Assistant. Action skills only offer pre / post message hooks. When you compare an Action skill with a Dialog skill, Action skills are simpler to get started with, but Dialog skills offer all the features. What you are looking for is available for dialog nodes in Dialog skills.

Actions Skill is still quite new compared to Dialog Skill, and we have a lot of really exciting plans for Actions that will be coming out over time. The ability to call out to external systems is being totally revamped, at least compared to Dialog/webhooks, to be much easier to use and scale across your business. It's one of our top priorities for the future but will take some time to release. I can't give a date now but if you need this for your production assistant, as data_henrik said we recommend you use the Dialog skill

Related

Send transcribed, spoken text from smart speakers/displays to server after Conversational Action shutdown?

If I need to explain how insanely important and useful this functionality is, please let me know. However, I suspect this is obvious to everyone except Google.
Please, please tell me there is another way to accomplish this.
I need to do all speech parsing, processing, and responses on my own. And from a smart speaker/display. Conversational Actions allowed for this. As far as I have been able to tell, there is no alternative way to accomplish this. I'm shocked and severely disappointed. You're literally crippling your smart speakers and displays. I have one in every room right now and will be selling them after the shutdown unless something changes. I sure hope you reverse course on this.
We noted your ask here and will continue to monitor for other similar requests involving the Conversational Actions in our support channels. We do collect these requests, share with the teams involved in the planning process, and try to get them in our feature development timeline.
Unfortunately there are no features readily available to replace the capability you mentioned above, but our teams are constantly working towards providing a better Google Smart Home Ecosystem. When we have any updates on these features, we will update our public documentation.

Create custom Google Smart Home Action

I have a Google Nest Hub Max and I want to increase its capabilities for a custom need:
"Hey Google, add xyz to my work planning"
Then I want to make an HTTP call to my private server
The private server returns a text
The text is displayed in the Google Nest Hub Max screen + speak-out.
How can that be achieved?
Originally I thought that this will not be difficult. I've imagined a NodeJs, Java, Python or whatever framework where Google gives me the xyz text and I can do my thing and return a simple text. And obviously, Google will handle the intent matching and only call my custom code when users say the precise phrase.
I've tried to search for how to do it online, but there is a lot of documentation everywhere. This post resumes quite well the situation, but I've never found a tutorial or hello world example of such a thing.
Does anyone know how to do it?
For steps 2. and 3., I don't necessarily need to use a private server, if I can achieve what the private server does inside the Smart Home Action code, mostly some basic Python code.
First - you're on the right track! There are a few assumptions and terminology issues in your question that we need to clear up first, but your idea is fundamentally sound:
Google uses the term "Smart Home Actions" to describe controlling IoT/smart home devices such as lights, appliances, outlets, etc. Making something that you control through the Assistant, including Smart Speakers and Smart Hubs, means building a Conversational Action.
Most Conversational Actions need to be invoked by name. So you would start your action with something like "Talk to Work Planning" or "Ask Work Planning to add XYZ'. There are a limited, but growing, number of built in intents (BIIs) to cover other verticals - but don't count on them right now.
All Actions are public. They all share an invocation name namespace and anyone can access them. You can add Account Linking or other ways to ensure a limited audience, and there are ways to have more private alpha and beta testing, but there are issues with both. (Consider this an opportunity!)
You're correct that Google will help you with parsing the Intent and getting the parameter values (the XYZ in your example) and then handing this over to your server. However, the server must be at a publicly accessible address with an HTTPS endpoint. (Google refers to this as a webhook.)
There are a number of resources available, via Google, StackOverflow, and elsewhere:
On StackOverflow, look for the actions-on-google tag. Frequently, conversational actions are either built with dialogflow-es or, more recently, actions-builder which each have their own tags. (And don't forget that when you post your own questions to make sure you provide code, errors, screen shots, and as much other information as you can to help us help you overcome the issues.)
Google's documentation about how to design and build conversational actions.
Google also has codelabs and sample code illustrating how to build conversational actions. The codelabs include the "hello world" examples you are probably looking for.
Most sample code uses JavaScript with node.js, since Google provides a library for it. If you want to use python, you'll need the JSON format that the Assistant will send to your webhook and that it expects back in response.
There are articles and videos written about it. For example, this series of blog posts discussing designing and developing actions outlines the steps and shows the code. And this YouTube playlist takes you through the process step-by-step (and there are other videos covering other details if you want more).

Can I make google assistant understand my entities and train it for the same or I need DialogFlow?

I know that DialogFlow can be trained for particular entities. But I wanted an insight on whether or not Google Assistant can understand my entities?
I've tried to search on official site but could not get clear understanding on whether or not I need to go for dialogflow.
Actions on Google will allow you to extend Google Assistant by writing your own app (i.e. an Action). In your Action, you can tailor conversational experience between the Google Assistant and a user. To write an action you will need to have a natural language understanding mechanism, which is what Dialogflow provides.
You can learn more about Actions on Google development in the official docs. There are also official informational talks about Actions on Google and Dialogflow online, such as
"An introduction to developing Actions for the Google Assistant (Google I/O '18)"
I'm not quite sure what you mean with your last sentence, there is no way to define entities for Google Assistant other than Dialogflow. Regarding your question, there is indeed no information on how entities are handled and how good one can reasonably expect the recognition to be. This is especially frustrating for the automated expension feature, where it is basically a lottery which values will be picked up and which will not. Extensive testing is really the only thing one can do there.

Accessing Google home for usage statistics

I hope you can help me with a problem:
I want to create a web application that requests user data from a Google Home device. I then want to create an interface that summarizes all this data and shows convenient data analytics to the user. For example: How many times I switched a light on during a week, or what music I'm listening to, or which light are on or off at a certain moment.
The problem is that I have no idea where to begin, I've been searching through Google and stackoverflow without avail. I came across a site called home-assistant.io, but that seems to be a program that consists of different modules and has the Google assistant "on the side" instead of using the Google assistant to gather the data.
So I guess it boils down to is it possible to use the Google Home to gather usage statistics, or isn't that possible (yet)?
In short - it isn't.
Users can see what they've done using their Google account, including through the Assistant, using https://myactivity.google.com.
However, third-party developers have no access to on-device activity, no access to the content at myactivity.google.com, and no way to intercept or view what a user is doing using the Assistant. In short - no way to gather statistics outside of their own, specific, Action.
There are lots of reasons this isn't allowed, but probably the biggest is security and privacy. Google gets a lot of criticism for collecting this information, and would probably get even more if it was possible for those outside Google to get it as well. (Google also has a business reason for limiting outside access to this information, admittedly.)

Is API.AI the native way to build conversational skills for Google Assistant?

I have developed a conversational skill using API.AI and deployed to Google Home but API.AI's support seems limited and I am unable to do certain things like playing an audio file. The question I have is whether it's better to stick with API.AI or switch to Actions on Google for the long term.
Google has said that API.AI is the recommended way to build an agent for 'actions on google' for those who don't need/want to do their own NLU. They seem to expect that most developers will use API.AI because it does some of the work for you, with the NLU being the prime example, cf. Alexa where the developer is expected to specify all the different utterence variations for an intent (well, almost all - it will do some minor interpretation for you).
On the other hand, keep in mind that API.AI was created/designed before 'actions on google' existed and before they were purchased by Google - it was designed to be a generic bot creation service. So, where you gain something in creating a single bot that can fulfill many different services and having it do some of the messy work for you, you will certainly lose something compared to the power and control you have when writing to the API of one specific service - something more then just the NLU IMO, though I can't speak to playing an audio file specifically.
So, if you plan to just target the one service (and an audio bot is not relevant to most of the other services supported by API.AI) and you are finding the API.AI interface to be limiting then you should certainly consider writing your service with the 'actions on google' sdk.