How to pass value from one intent to another in bixby - bixby

My app is giving user types of news based on the input. For ex: If user is saying what is happening in sports, so I give user sports news in the form of compound card. Now if user is saying that "Show me similar news", so all i need to do is pass the category id of that news to my other file and process that category id to get more same type of news. I am unable to pass the category id.
My news details file is NewsSearch.model.bxb and input i have taken is categoryName, which I convert into id and pass it to my api.
My similar News file is SimilarNews.model.bxb and input is categoryId, which I am supposed to pass to my api to get the same category news.
How to pass categoryId from NewsSearch.model.bxb to SimilarNews.model.bxb?

This is similar to a Continuation. If NewsSearch concept is not marked as transient, you can create an Action SearchSimilarNews that will take NewsSearch as the input. Since this is a followup query, NewsSearch will be available to the Planner from a historical perspective and will therefore be automatically passed into the input.
You may want to look at the Continuation sample capsule for more ideas https://github.com/bixbydevelopers/capsule-samples-collection/tree/master/continuation-for-training

Related

How to capture negative response from user in bixby

I am using input-view for selection and i can see none button at the bottom of the screen.I haven't included any conversation-driver yet i can see the button. How to avoid that? Event if we can not avoid it, how can i add the event-listener on this? If user click or say none, I want to give user a custom message and pass it to other intent. is it possible?
Also is it possible to give user other option if none of the utterances matched with the defined one? for example
User: what is the temperature of Oakland?
bixby: today, it is 73 F in san francisco.
User: I want to buy land on mars?
These kind of question is out of context. how to handle it?
Now in this case i want user to be prompt like "It is not possible for me to get the information, but I can tell you weather forecast of your current location. Would you like to know?" User might say yes or no. Yes would redirect it to the weather intent and no will say thank you.
A "None" conversation-driver is shown when the input-view is for a Concept that is optional (min(Optional)) for your Action. Changing it to min(Required) will remove the "None" conversation-driver.
If you want to keep the concept Optional as an input for the Action, you can add a default-init (link to relevant docs) to your Action to kick off another Action that would help the user provide you a correct input.
Bixby cannot create a path for out-of-scope utterances. The idea is that, since every user's personal Bixby will contain a number of capsules, your capsule will get called only if a user's utterance matches the types of utterances you have trained Bixby to recognize via your training file.

Is there an easy way to create a "Movie-name" entity in dialogflow

I want to create an action that takes the name of a Movie or Tv show and returns some details about it.
The problem is that I need to add all the possible tv show names to an entity.
Even then there is the limit of 3000 for the maximum number of entities in an Entity. Is there a way around this problem?
Ideally I would like to give it some sample tv show names and when the user says a new tv show name(one that the entity doesn't contain), it is able to recognise it and pass it on to the intent.
You should create a custom entity, and train it with as many examples as you can. Additionally, mark the allowed automatic expansion, so that dialogflow will be able to recognize the names which you have not defined.
The problem could still be there, that dialogflow might recognize something as movie name which is not a movie name, for that you should have a validation function in your webhook code. If validation fails, you can prompt the user again for correct movie name.

Dialogflow(Api.Ai) Doesn't recognize custom entity

I have been working lately with Dialogflow to make chatbots to do some simple tasks. For instance with webhooks and youtube api where the user ask to show him a video and then the bot just answers with the youtube video url.
E.G.
USER SAYS
Show me Neil young harvest moon
AGENT SAYS
Here you go : https://www.youtube.com/watch?v=n2MtEsrcTTs
I do this by using a custom Entity I called "YoutubeQuery" I checked "Allow Automated expansion" and unchecked "Define Synonyms" then I just added 2 values "Kavinsky Night Call" and "Indigo Night Tamino"
In my Intent I just made a couple of training phrases like these:
And everything works.
Now my issue is with a new Agent which I called Orders
I want just to get Order Id's from the firestore database, but before getting there I'm running in kind of a huge problem
I defined the order's ID entity just like the one with the youtubeQuery. And I added some example Order ID's , I want them all to Start with OD and have 4digits after example (DX0001,DX0009,DX9999)
Afterwards I made the intent
Now unless I give the EXACT order ID's from the traininphrase or the ID examples I defined in the Entity it will always give me a response with an empty parameter OrderID
I start my intent by saying "my order" then I get prompted with "What is your ID?
So when I give an ID that has not been used in the training phrases of the Intent I get an empty value in the parameters like this:
But when I give an ID that has been used in the training phrases like for instance the first one DX0808 it does work...
How can I make this work without adding all the possible order id's ranging from DX0001 to DX9999 in the training phrases or the entity.
I mean it does work for my youtube query, I can put anything there it does "catch" the value. Any help please?
It looks like the required parameter is the problem here, my suggestion would be to:
Create intent to get the order id in one sentence without reprompt (turn off required on the order id) and id is always present, ex: "my id is DX0402". Include training response where only ID is provided like "DL3932", ex. below:
Set other intent for scenario when customer wants to provide the id but it is missing, for ex. customer says: "my id" and make your bot ask for the id as an response ex. "ok, provide me your id"
If you do it, in case user doesn't provide the id, intent 2 will be triggered and after id is provided you'll trigger intent 1.
Hope this makes sense.

Dialogflow: Determine product name or Select a product from a list which are fetched using a webhook

I am trying to build a bot(custom UI in my website) where a user will enter a product name to view the details of it and I will provide a link to the product full details page. I have a situation where if the user enters a name and there are multiple results from my database, I want to show him those products as quick replies so that he can select one from them.
How do I recognize that the user has entered the product name and anything else? I can use #sys.any, but all small conversation will also go there, which will be of no use.
The same problem occurs when I display him a list of products with matching name. But now when the user clicks on any of the button I am taking him to a custom follow-up intent where I have entered the template for a product entity. But, dialogflow only recognizes the products that have been defined in the entity(listed few products and checked auto expand).
I have tried using #sys.any instead, but the intent is called for any string the user types in. Lets say, the user does not respond and after a while he types in "hi", my intent with any is being called. How do I overcome this situation?
So far as I understand, I can see two ways to solve this query. First, using an entity & defining your product list over there for bot to understand user responses (which you have done) but this will become an overhead when you have a list of say 1000/more products. Second way, you can continue using #sys.any & define a parameter, write a webhook where you validate user entered response to product list in database & check if it is present over there, if yes, show product details or say, entered response is incorrect.

Sending specific words to webhook

I'm trying to make an agent that can give me details about movies.
For example, the user says "Tell me about (movie-name)", which sends a post request to my API with the (movie-name) which then returns the response.
However, I don't understand how to grab the movie name from the user's speech without creating a movieName entity with a list of all the movies out there. I just want to grab the next word the user says after "tell me about" and store it as a parameter. How do I go about achieving that?
Yes, you must create a movieName entity, but you do not need to create a list of all movies. Maybe you are experienced with Alexa which requires a list of suggested values, but in api.ai you don't need to do that.
I find that api.ai is not very good at figuring out which words are part of a free-form entity like movieName, but hopefully adding enough user expressions will help it with that.
edit: the entity I was thinking of is '#sys.any' but maybe it would be better to use a list of movie names with the 'automated expansion' feature. I haven't tried that, but it sounds like the way that Alexa's custom slots work, which is actually a lot more flexible (just using the list as a guideline) then people seem to think.

Resources