官术网_书友最值得收藏!

Creating your first agent

Now, you are ready to create the FAQs chatbot. Let's navigate back to Dialogflow. Then, log into Dialogflow and create an agent called FaqChatBot. Ensure that you enable API VERSION to Dialogflow V2 API

The following screenshot shows the Dialogflow development interface, where you can start creating an agent:

Creating a Dialogflow agent

You can think of a Dialogflow agent as a voice translator that receives the user's voice from a device such as a mobile phone or Google Home, and then applies natural language processing to it, converting the user's voice into JSON format so that the user's request can be processed by the backend application server. Then, the backend application server will respond to the Dialogflow agent in JSON format, containing an instruction as to how to respond to the user. Upon receiving the message, the Dialogflow agent will send it back to the device along with the instructions of what to say to the user, and the device will speak to the user with the response.

The following chart shows the process flow of a Dialogflow agent:

Dialogflow agent process flow

Once the FaqChatBot agent has been created, we can take a look at the agent's settings. First, in the General settings, take a note of the API KEYS section; you will need the client access token and developer access token later, in Chapter 4Hosting, Securing, and Testing Fortune Cookie in the Cloud, to programmatically access the Dialogflow agent using the Dialogflow SDK.

The following screenshot shows the FaqChatBot agent settings:

FaqChatBot agent settings-general

The following are the different sections of an FaqChatBot agent:

  • Languages: In the Languages section, you can add multiple languages that the FaqChatBot can understand and translate and, for the purpose of this book, we will be using English.
  • ML Settings: If you look at the ML Settings tab, you will notice the ML CLASSIFICATION THRESHOLD setting. The ML CLASSIFICATION THRESHOLD can be set between 0 and 1, and the default value is set at 0.3. You can think of the ML classification threshold as how confident the FaqChatBot agent is that the agent understood what the user just said. If the agent understood the user request, it will know how to respond; if not, it will tell the user that it did not understand what they said. You will learn more about the ML CLASSIFICATION THRESHOLD in the What are Intents? section of this chapter.
  • Export and Import: In this section, the FaqChatBot can be backed up into the .zip file, restored from the .zip file by replacing the old version of the FaqChatBot agent, and can be imported from the .zip file, whereby the old one will be completely removed and restored from the .zip file.
  • Share: In the Share section, you can give permissions to other developers of the FaqChatBot. This is useful if you have many developers working on a very large project in order to divide the work.

The following screenshot shows the Export and Import section of the FaqChatBot agent:

 
FaqChatBot agent settings - export and import

The following screenshot shows the Share section of the FaqChatBot agent:

FaqChatBot agent settings - share
主站蜘蛛池模板: 惠水县| 高碑店市| 长白| 庆云县| 徐闻县| 尚志市| 五河县| 那坡县| 纳雍县| 门头沟区| 平度市| 海宁市| 华容县| 丹江口市| 临沭县| 垦利县| 乌兰察布市| 吴旗县| 汉中市| 罗城| 搜索| 察雅县| 广东省| 闸北区| 乌审旗| 班戈县| 龙南县| 松阳县| 铁岭县| 融水| 吉水县| 墨江| 邵阳市| 博客| 精河县| 鄢陵县| 东阳市| 武山县| 桃园市| 武乡县| 十堰市|