CREATE A CHATBOT
To create a chatbot in Dialogflow, go to https://dialogflow.cloud.google.com/ and log in with a Google account. Once you are logged in, you will see a tab like the one below:
where you must click on the "CREATE AGENT" button (and then select the name of the chatbot, the language, and the time zone).
Once the chatbot has been created, the so-called "Intents" must be created (for more information, read: https://cloud.google.com/dialogflow/es/docs/intents-overview) that will control the flow of the conversation. Each intent has:
- User expressions: what the user has to write so that the chatbot knows what to answer (Dialogflow is in charge of detecting if similar sentences are written, with capital letters, lowercase, etc.).
- Text responses: the possible responses of the chatbot to the user expressions defined above.
-
Action and parameters: in this section, the different actions to be carried out in Athento will be written, which for the moment could be:
- Select space: this action will be in charge of choosing the space in which the required document will be created (scheme: select-series, select-series{<series name>})
- Upload/update main binary: this action will be in charge of updating the binary of a document (scheme: update-principal-binary)
- Fill metadata: this action will fill a specific metadata (scheme: set-metadata-type-value{<slug of the metadata type>}).
In addition, it has two important booleans:
- Fulfillment: in this section of the intent, there are two options. Enable webhook call for this intent" must be checked for all intents, as shown in the following picture:
- Set this intent as end of conversation: this option shall be checked when the current intent is the end of a Dialogflow (when this end point is reached, the actions decided from the previous intents in Athento shall be executed).
DIALOGFLOW CONNECTION TO ATHENTO
The first thing to do is to go to the Athento advanced and find the API keys model. This key is the one that will allow the connection with Dialogflow.
Just give it a name and when you click on save, the API key will appear on the screen and you will have to copy it to the clipboard.
Now, from Dialogflow, go to the "Fulfillment" section of Dialogflow, activate "WEBHOOK" and fill in the fields:
- In URL put the base url of the instance + /dialogflow/api/fulfillment/execute/
- In HEADERS you have to put as key "authorization" and as value "Api-Key <api key>".
EXAMPLE USE CASE
This use case defines a chat bot which allows two options: to make a complaint or a claim. This flow will create a document in the corresponding space (complaint space or claim space depending on what is chosen).
Example of conversation:
This is configured in Dialogflow as follows:
Welcome attempt: no actions.
Intent space selection: in user expression, an entity defined as Spaces is used, storing the internal name of the spaces to choose (in this case, complaint and claim). More information on entitys at https://cloud.google.com/dialogflow/es/docs/entities-overview. The internal name could also have been passed directly in the action (in the case of only referring to a possible space) by placing the name between braces (example: select-series{<name>}).
Intent binary: the main binary update action is used.
Intents metadata types: actions are used to fill in the description and email metadata, the latter being the end of the conversation.
Comments
0 comments
Please sign in to leave a comment.