The Assistant component by Google's Dialogflow gives you the power of a Google Home or Amazon Alexa all from the comfort of your mobile device's built-in microphone.
An agent is the voice-enabled chatbot that is programmed to listen and respond to your given conversation
There are 3 fields you'll need to fill out on the Thunkable properties panel to connect it to Dialogflow:
Private Key and
To get the
Project Id, simply navigate to the ⚙settings on your Dialogflow account.
To get the
Client Email and
Private Key, will require you to create a new Google Cloud Platform Service Account. This is a bit of an extra step but it is put in places to provide extra security so that Google knows it is only you accessing your app.
To get to the Google Cloud Platform, simply click on the Service Account link that is below the Project Id field.
That will take you to the page below on the Google Cloud platform account.
After signing in, select the three-dotted menu button and select the option to Create key.
It will then prompt you to select the format of the key. Select JSON and select Create.
This will download the JSON file to your computer.
Open the JSON file in your favorite text editor and you'll find the Client Email and Private Key as fields in the file. Copy and paste these to the appropriate fields in your Assistant properties panel on Thunkable.
Phew! That's it for set-up. You are now ready to program your Assistant.
The magic of the Assistant component is that it can listen for certain spoken phrases or intents and trigger a response based on those phrases. The more intents The more intents that you create, the more commands or questions the Assistant will be able to respond to. Since the Assistant is powered by a breakthrough technology called natural language processing, the user won't have to always say exactly what is specified in the intents (although the more expressions the better).
To program an intent, you simply create new intents in the Dialogflow interface.
Intents are meant to trigger a specific response, and for most users, this will simply be a simple text response.
The text response above can then be programmed with Thunkable blocks to complete a certain action e.g. play a specific sound file as in the sample app, Dad.
text response you program in Dialogflow is the same as the
value output of the Start listening block on Thunkable as shown below.
The following event blocks are available to program into your app on Thunkable.
Asks the Assistant to start listening to a voice query. You must use both the Start Listening and Stop Listening events to. When it detects a programmed intent, it will respond accordingly with a
Asks the Assistant to stop listening to a voice query
Submits a query to the Assistant in text form
For more advanced users, Dialogflow also allows you to program actions in the following 3rd party applications. Each application has a different integration process so follow the instructions carefully if you want to use this option.
The agent is currently available to understand the following languages with more added periodically (apologies if the list below is not up to date):
Refers to both the language recognized by the Assistant and the language which it speaks aloud. Currently available:
To change the language, simply change it in the Assistant properties panel and in your Dialogflow dashboard
Upgrading from V1 to V2 involves two steps.
First, navigate to the Dialogflow ⚙settings page and make sure the V2 API is selected
Second, you'll need to follow these steps to re-connect your Dialogflow agent with Thunkable.
You'll have to retrieve the
Project Id from the Dialogflow page you visited and create a new security key on the Google Cloud Service Account to retrieve the
Client Email and
Private Key. It sounds like a lot but if you follow the instructions, it should be relatively painless.