Botsquad leverages the NLP engine of Google Dialogflow for matching of intents and extracting of entities based on a trained Dialogflow agent.
Dialogflow intents in Bubblescript¶
You can link any intent to its DialogFlow equivalent to enable the triggering of the dialog when an intent gets classified:
@greeting intent(dialogflow: "project.intents.greeting") dialog trigger: @greeting do say "Hello to you too!" log intent end
intent.entities variable holds any entities that were matched
as a result of DialogFlow's intent classification.
Connecting your own Dialogflow agent¶
By default, Botsquad's
dialogflow intents are looked up in the
default Botsquad agent. In order to connect your own Dialogflow agent,
you need to connect your agent's service account with your Botsquad
In order to enable your own Dialogflow agent, follow the following steps:
- In Dialogflow, click the gear icon next to your agent's name
- In the settings form that opens, ensure that you checked the V2 API tab. If not, check it, and click Save.
- Under the Google project section, click the "+" button in the table row that says Service account, to create a service account for your agent.
- Wait for a few seconds while Google creates a new service account
- The table now refreshes and shows a link to the service account (something like email@example.com). Click the link to open the service account.
- You are now taken to the cloud console. Click the three dots next to your service account and choose Create key.
- In the following dialog, ensure the "Key type" is set to JSON and click the Create button.
- A JSON file is now downloaded to your computer.
- Open the Botsquad studio and create a new YAML script. ("Add YAML
file" in the add script dropdown menu). Name the script
- Empty the script file and paste the contents of the downloaded JSON file in the newly created YAML file.
- That's it, any intents will now be queried on your own Dialogflow agent instead of the default Botsquad one.