I have written a smart speaker app for Google Home using DialogFlow, and am now in the process of porting it over to Alexa.
One of the fundamental differences seems to be the inability to easily trigger follow-up intents. For example, I have a dialog that asks the user a series of questions, one after the other, before providing a result based on the answers provided. e.g. ({slot types})
Do you like a low maintenance or working garden? {low maintenance}{working}
Do you like a garden you can relax in? {yes/no}
Would you like to grow vegetables in your garden? {yes/no}
This is easy to achieve using DialogFlow follow-up intents, but I have no clue where to start with Alexa and there dont seem to be many examples out there. All I can find seems to focus on slot filling for a single dialog.
I am using my own API service to serve results (vs Lambda).
Can anybody recommend a way of achieving this in an Alexa Skill?
I managed to achieve this by adding a single utterance with three individual slots, one for each of the answers required:-
inspire me {InspireMaintenance} {InspireRelax} {InspireVeg}
These Slots back onto one SlotType - Custom_YesNo, which had Yes and No values + synonyms. My C# service then checks for each of these required slots and where one is missing it triggers the relevant question as a response. Once all slots are filled it provides the answer.
Not as intuitive as Dialogflow and requires code to achieve what can be done without code in DF, but at least it works :)
Related
So I am currently working on this project and I am confused on how to tackle this issue I am having.
I am creating this website that will go behind the scenes and input the data the user is providing us with and checking to see availability on various websites. I am confused on how the logistics of this would work. Would it make more sense to use API's rather than create maybe a bot (I don't even know if this would work) or even if there was a way to code it in myself.
A similar platform to what the general idea behind what operations would be used is vaccines.gov where the system will display the availability of vaccines nearby (a value inputted by user is zipcode). I just need to be pushed in a general direction as I am unsure how to approach this.
Thank you!
In an Alexa Skill, I have an intent of ordering an ice cream. I know I can check some information in an API or whatever function I have built inside my Python code, but only if that function is literally atomical.
If I have slots, asking for more information, I cannot check for api info or other personal functions, because having slots in Alexa is not like having slots in a chatbot, for example. There is no "dialog tree" or anything similar.
The Ice cream example is simple, but I tried first on doing this before moving on something more complex.
This would be the very basic format of the intent:
But what I want is during this execution, get some information, inside the intent!
I have searched everywhere, and I have not found anything useful. I asked the Alexa Developer support, and they told me to check Dialog. This was also part of the answer:
Skill interaction model completely depends on slots defined in your skill. But you can even make it more dynamic depending on no of slot values provided by user but it will always from interaction model already defined in your skill.
You can't create dynamic response based on the data you are getting from APIs or from skill.
But seeing other Alexa skills that are deployed, I guess it should be possible!
What I thought on doing is several functions like:
get the icecream: only that, getting an icecream flavour. Identifying the flavour in python and calling the api. Saving the flavour in a slot/dynamodb.
Add something: Everytime the user wants to add something (like whipped cream), call this function. Checking the api depending on what the user wants to add.
This makes it a bit dirty in my opinion, and makes the user lose a bit of flow with Alexa, but might do the job. But is there any way to do it directly in only one function (even though it is atomical)?
Is it possible to launch an Alexa App with just its name? This is similar to when you ask it what the weather is.
"Alexa, weather"
However I would like to be able to say
"Alex, weather in Chicago" and have it return that value
I can't seem to get the app to launch without a connecting word. Things like ask, open, tell would count as a connecting word.
I have searched the documentation but can't find mention of it, however there are apps in the app store that do this.
It is documented in the first item here.
I've verified that this works with my own skill. One thing I've noticed is that Alexa's speech recognition is much worse when invoked in this manner presumably because it requires matching against a greater set of possible words. I have to really enunciate in a quiet room to get Alexa to recognize my invocation name in this context.
When developing a custom skill you have to use the connecting words e.g. Alexa, ask your invocation name to do something.
If you want to pass a variable, you have to specify the sample utterances:
OneshotTideIntent get high tide
OneshotTideIntent get high tide for {City} {State}
Then you handle cases in your code when user does not provide these values. For examples see https://github.com/amzn/alexa-skills-kit-js
When writing the example phrases you use the following construct:
"Alexa, [connecting word] [your invocation name], [sample utterance]". As far as I have noticed she is rather picky and you have to be exact when invoking custom skill (the voice recognition works way better with built in skills)
EDIT: launching skill without connecting word is possible when developing "smart home" skill
Apologies for posting a basic question and not a detailed programming problem! Alas, IBM send people here for BlueMix support.
We're evaluating different AI Bots, and with Watson what we want to do, I think, is use Alchemy to analyze our web site, and have a chat bot that can answer random questions using general knowledge as well as what Alchemy has learnt from our site.
But, I can't find an example of how to hook up Alchemy to a chat bot. Could any of you point me in the right direction? I'll try to come back with more difficult questions another day!
I think, is use Alchemy to analyze our web site, and have a chat bot that can answer random questions using general knowledge as well as what Alchemy has learnt from our site.
There is two ways to do this.
You can create a controller that sits in front of Alchemy API + Dialog. The user talks to the controller and it sends the information to Dialog. Dialog can then request a lookup to the controller. This option is only useful if you don't expect Dialog to be maintained at a later date (or you are using earlier versions of WEA).
The better option is to use the FUNCTION call within Dialog. This will allow you to talk to a third party system and get information back to work with.
Once you have your data returned, you can use your tags or keywords within the returned data to activate a particular process flow using SEARCH.
One thing to be aware of is that depending on the answer you need to determine how to present it.
If your corpus is stored as conversational, then you can use the content as-is. If it is stored from documentation, then you should have Dialog talk as if it is reviewing the content and coming back with an answer. The latter should be visible in a way that distinguishes it as separate from the conversation.
Thanks in advance for any help offered and patience for my current web-coding experience.
Background:
I'm currently attempting to develop an web based application for my family's business. There is a current version of this system I have developed in C#, however I want to get the system web-based and in the process learn cakephp and the MVC pattern.
Current problem:
I'm currently stuck in a controller that's supposed to take care of a PurchaseTicket. This ticket will have an associated customer, line items, totals etc. I've been trying to develop a basic 'add()' function to the controller however I'm having trouble with the following:
I'm creating a view with everything on it: a button for searching customer, a button to add line items, and a save button. Since I'm used to developing desktop applications, I'm thinking that I might be trying to transfer the same logic to web-based. Is this something that would be recommended or do'able?
I'm running into basic problems like 'searching customer'. From the New Ticket page I'm redirecting to the customer controller, searching and then putting result in session variable or posting it back, but as I continue my process with the rest of the required information, I'm ending up with a bit of "spaghetti" code. Should I do a multi part form? If I do I break the visual design of the application.
Right now I ended up instantiating my PurchaseTicket model and putting it in a session variable. I did this to save intermediate data however I'm not sure if instantiating a Model is conforming to cakephp standards or MVC pattern.
I apologize for the length, this is my first post as a member.
Thanks!
Welcome to Stack Overflow!
So it sounds like there's a few questions, all with pretty open-ended answers. I don't know if this will end up an answer as such, but it's more information than I could put in a comment, so here I go:
First and foremost, if you haven't already, I'd recommend doing the CakePHP Blog Tutorial to get familiar with Cake, before diving straight into a conversion of your existing desktop app.
Second, get familiar with CakePHP's bake console. It will save you a LOT of time if you use it to get started on the web version of your app.
I can't stress how important it is to get a decent grasp of MVC and CakePHP on a small project before trying to tackle something substantial.
Third, the UI for web apps is definitely different to desktop apps. In the case of CakePHP, nothing is 'running' permanently on the server. The entire CakePHP framework gets instantiated, and dies, with every single page request to the server. That can be a tricky concept when transitioning from desktop apps, where everything is stored in memory, and instances of objects can exist for as long as you want them to. With desktop apps, it's easier to have a user go and do another task (like searching for a customer), and then send the result back to the calling object, the instance of which will still exist. As you've found out, if you try and mimic this functionality in a web app by storing too much information in sessions, you'll quickly end up with spaghetti code.
You can use AJAX (google it if you don't already know about it) to update parts of a page only, and get a more streamlined UI, which it sounds like something you'll be needing to do. To get a general idea of the possibilities, you might want to take a look at Bamboo Invoice. It's not built with CakePHP, but it's built with CodeIgniter, which is another open source PHP MVC framework. It sounds like Bamboo Invoice has quite a few similar functionalities to what you're describing (an Invoice has line items, totals, a customer, etc), so it might help you to get an idea of how you should structure your interface - and if you want to dig into the source code, how you can achieve some of the things you want to do.
Bamboo Invoice uses Ajax to give the app a feel of 'one view with everything on it', which it sounds like you want.
Fourth, regarding the specific case of your Customer Search situation, storing stuff in a session variable probably isn't the way to go. You may well want to use an autocomplete field, which sends an Ajax request to server after each time a character is entered in the field, and displays the list list of suggestions / matching customers that the server sends back. See an example here: http://jqueryui.com/autocomplete/. Implementing an autocomplete isn't totally straight forward, but there should be plenty of examples and tutorials all over the web.
Lastly, I obviously don't know what your business does, but have you looked into existing software that might work for you, before building your own? There's a lot of great, flexible web-based solutions, at very reasonable prices, for a LOT of the common tasks that businesses have. There might be something that gives you great results for much less time and money than it costs to build your own solution.
Either way, good luck, and enjoy CakePHP!