Manual Action necessary for the API to return Entities ? - dialogflow-es

I am using Dialogflow’s API to feed intents and their respective entities. We’re doing this as a team so modifications are made on a pretty regular basis.
In the meantime, we select some utterances for which we know the desired classification, and we check via Dialogflow’s API (the /query endpoint) that the actual result meets the expectations.
For intents, the results are great. We always get an intent back from the API, and all is well.
As far as entities are concerned however, we have a peculiar behavior :
when we update the training (we add utterances, intents and entities) via the API without any manual action on the DialogFlow console, we don’t get any entities in the JSON response to /query
when we do the same thing, but we manually click on the « Save » button of all the intents,** we get entities in the JSON response** after the « Agent Started Training » flash message disappears.
Does this mean that there is always at least one manual action required for the training to actually be fully done and for entities to be returned in JSON response to the /query endpoint ? Is there a way for us to launch that training via API and prevent the manual save of the 100+ intents we have for our Agent ?
Thanks for any help you can provide !
Best regards

Related

Do we need webhook when our server is interacting with dialogflow?

We are implementing our customized chatbot using dialog flow. When user enters any text, our javascript code sends this text to our python server and the server interacts with google dialog flow and server gets complete response. I just have couple of questions as below.
When server gets the response from dialog flow, it will process the
response and sends some response to UI. Do we still need to have
fulfillment enabled as our server is getting response? Basically if
server is interacting with dialog flow and getting response, what is
the use of webhook?
Is there anyway to enforce the dialog flow intents require at least
one of entities? I went through Can I make Dialogflow intents require atleast one of the trained entities? which says to enable webhook fulfillment for that intent and if no entities were provided, re prompt the user for at least one of a list of entities. So in my case, if webhook is not needed, do I need to do it in the server once server receives response or is there anyway dialog flow will automatically enforce the condition with out server taking the responsibility?
In your case, no, you don't need to use webhook fulfillment.
You may still wish to use it, however, if you want to separate business logic (which would be in the webhook) from UI/UX logic (which would be in your python server and in the javascript client). But there is no requirement that you separate things this way.
Similarly, you can use your python code to enforce "at least one of" the parameters matching - you're moving that logic from the webhook into your existing server.
Either way, this is a bit kludgy. One alternative if you have different entity types is to have multiple Intents, one for each possible type, and to mark the parameter as required. This way the Intent will only match if the parameter is provided. If you then need to report each of these Intents as the "same" Intent, you can add that logic to your python code.

Dialogflow query working in console but not when you use embedded url

I have made a query flow in dialogflow and it has four intent and in the last intent it uses a webhook to get data from server side and displays the result. It is trained automatically and works perfectly in dialogflow console returning response and query answer. The issue is it does not work when I use embedded url. It fails to recognize the name intent and asks (Can you repeat again or fallback intent). I've removed all intents and made query again, there is no similar name intents. Yet it works well in console and not in embedded url.
For the webhook part I've used node.js service.
Please help in this issue.
By 'embedded url' if you mean Dialogflow Web Demo (DWD), you should keep in mind that DWD can be used only for simple text messages. It does not support messages from webhook or even rich responses. However, if you steel need a web widget to embed your bot to your webpage you either create your own or you should use third party solutions (like Kommunicate). Here's the link regarding the limitations of DWD.

How to clear the session between two consecutive intents?

We are using bot trees master which uses bot graph dialog for loading graph based dialogs dynamically. We have created a scenario to load multiple intents(whose intents scores are nearly matching). Now the problem I am facing is when I request for single intent , I am getting the bot response and able to enter into next intent but when I request for multiple intents bot is giving the response and when I request for another intent , bot is giving the same response of multiple intents. When bot is entering into multiple intent handler it is not clearing the session and not coming out of that handler. I have tried using session.endConversation().
To understand about bot graph dialog:
https://www.microsoft.com/developerblog/2016/11/11/extending-microsofts-bot-framework-with-graph-baseddialogs-/
Can somebody help on this. Thank you
the builder.IntentDialog() used in this project is no longer considered a best practice. Additionally, further support is not expected. Instead, you will want to use bot.Dialog() to create your dialog flows with a .triggerAction(). The trigger matches on phrases which you can set a score to. Unfortunately, it means you will need to recreate the bot-trees project to fit this new model.
You can find information on managing conversations here, including creating triggers.
If you need a more robust system, you can integrate LUIS into your project. Information regarding recognizing intents with LUIS can be found here.

Server-side query using events or/and context?

I’m coding a bot using PHP-BotMan for complexity reasons and using Dialogflow query api to extract and manipulate the informations from the response. I saw examples and hints from people here and on dialogflow forum suggesting using context or events, some of them mixing both. What is the better way to handle this?
The flow of the application is:
user messages bot
bot queries (text or/and #event?) dialogflow
internally process a reply or return dialogflow slotfilling* request
text response bot reply user with last reply or asking to fill slot
Also, how can I be sure that a slotfilling process is finished with “actionIncomplete” only having two values, NULL or TRUE? The dialogflow query response doesn’t show wich slotfilling parameters are required or not…
Thanks for the help!!
slotfilling is when dialogflow sends a text response requesting required parameters to finish an intent, adding those replied values to the context
I was trying something similar to your scenario, here are few points i found helpful:
When Slotfitting with webhook, i can't use the "Required" params field since i have to control the input parameters via webhook (query database to provide options). Which means actionIncomplete field is not useful anymore.
I personally prefer to use context as it can add/remove params which gives you more control.
Hence the dialog was designed to use webhook to check all required params before move on to next conversation flow. and pop quick replies menu to ease and restrict possible input from users.
HTH.

How to train api.ai/dialogflow chatbot dynamically?

I am trying to generate some "quick reply templates" i.e possible reply according to previous messages in a chat thread using Api.ai/Dialogflow.
I have trained api.ai agent to some extent to generate replies only for some selected queries. Now, I want to enhance it to generate replies for more queries but training an agent manually for a large number of queries is not practically possible. Is there any way to train the api.ai chatbot dynamically by analysing the previous chat thread, i already have stored in db or using the data of ongoing chats.
Users are some sellers so i assume they will talk regarding there product only, so questions will be somewhat similar in every chat thread.
Looks like there is now the ability to train via the API: https://dialogflow.com/docs/training, along with uploading text files with training lists.
You can add more Training Phrases using the POST and PUT API methods for the /intents endpoint.
Any changes made via the API to alter the agent's behavior, initiate the training in the same way when you save an intent. This trains the agent with the changes delievered through the API.
There currently isn't a API for training.
If you have a log of the queries for your agent (via the API or your webhook), you could "train" your agent by using those log to determine the most common unanswered queries by looking at how many queries match the default fallback intent and create new intents and responses for those queries using Dialogflow's API: https://dialogflow.com/docs/reference/agent/intents#post_intents

Resources