- Hands-On Chatbots and Conversational UI Development
- Srini Janarthanam
- 305字
- 2021-07-02 19:15:26
Managing context
In any conversation, the context of conversation needs to be managed. Context can be maintained by creating a local cache where the information transferred between the two dialogue partners can be stored. For instance, the user may tell the chatbot their food preferences, and this information can be stored in context for future reference if not used immediately. Another instance is in a conversation where the user is asking questions about a story. These questions may be incomplete and may need to be interpreted in terms of the information available in the context.
In this section, we will explore how context can be recorded and utilized during the conversation in Chatfuel. Let's take the task of finding a restaurant as part of your tour guide chatbot. The conversation between the chatbot and the user might go as follows:
User : Find a restaurant
Bot : Ok. Where?
User : City center.
Bot : Ok. Any cuisine that you fancy?
User : Indian
Bot : Ok. Let me see... I found a few Indian restaurants in the city center.
Here they are.
In the preceding conversation, up until the last bot utterance, the bot needs to save the information locally. When it has gathered all the information it needs, it can go off and search the database with appropriate parameters. Notice that it also needs to use that information in generating utterances dynamically. Let's explore how to do these two—dynamically generating utterances and searching the database.
First, we need to build the conversational flow to take the user through the conversation just as we discussed in the Next steps section. Let's assume that the user clicks the Find_a_restaurant button on the welcome block. Let's build the basic blocks with text messages and buttons to navigate through the conversation:

- 物聯(lián)網(wǎng)與北斗應(yīng)用
- 廣電5G從入門到精通
- 物聯(lián)網(wǎng)(IoT)基礎(chǔ):網(wǎng)絡(luò)技術(shù)+協(xié)議+用例
- 網(wǎng)管員典藏書架:網(wǎng)絡(luò)管理與運(yùn)維實(shí)戰(zhàn)寶典
- 局域網(wǎng)組建、管理與維護(hù)項(xiàng)目教程(Windows Server 2003)
- 互聯(lián)網(wǎng)安全的40個(gè)智慧洞見:2014年中國互聯(lián)網(wǎng)安全大會(huì)文集
- 物聯(lián)網(wǎng)與無線傳感器網(wǎng)絡(luò)
- Mastering TypeScript 3
- 面向5G-Advanced的關(guān)鍵技術(shù)
- React Cookbook
- AWS Lambda Quick Start Guide
- LwIP應(yīng)用開發(fā)實(shí)戰(zhàn)指南:基于STM32
- 5G非正交多址接入技術(shù):理論、算法與實(shí)現(xiàn)
- 路由與交換技術(shù)
- 5G新型多址技術(shù)