The Dialogflow Java SDK makes it easy to integrate speech recognition with Dialogflow natural language processing API on Android devices. Dialogflow allows using voice commands and integration with dialog scenarios defined for a particular agent in Dialogflow.
Authentication is accomplished through setting the client access token when initializing an AIConfiguration object. The client access token specifies which agent will be used for natural language processing.
Note: The Dialogflow Java SDK only makes query requests, and cannot be used to manage entities and intents. Instead, use the Dialogflow user interface or REST API to create, retrieve, update, and delete entities and intents.
This section contains a detailed tutorial on how to work with libai. This tutorial was written for IntelliJ IDEA.
- Create an Dialogflow agent with entities and intents, or use one that you've already created. See the Dialogflow documentation for instructions on how to do this.
- Open IntelliJ IDEA.
- From the start screen (or File menu) , choose Open....
- In the Open project dialog, fill Path to dialogflow-java-sdk directory, then expand examples directory and choose one of the client examples. Then click Ok.
- Open Run, choose Edit Configuration. In the Run/Debug Configuration Dialog, fill program arguments with your Client access token
- If there are no errors, you can get the result using Idea Input/Output to make text request (text-client).
If you want to work with library source code, for some reason, follow these steps:
- First of all, execute the steps specified in Quick Start. Only then go to the next step here.
- Open File, choose Project Structure..., choose Modules. Add new module libai. After this choose text-client(or voice client) module. Remove Maven: ai.api.libai:1.1.0 and Add Module dependency libai. After this click Apply.
- Try to Run. If there are no errors, you can get the result using Idea Input/Output to make text request (text-client).