重复最后一句话 [英] Repeat last sentence
问题描述
我正在使用Google行动和Dialogflow来构建机器人.
我想知道如何在用户询问时轻松地重复最后一句话(请重复").
一种方法是在Dialogflow中具有重复的跟踪意图,但是由于:
- 您需要在每个意图之后添加一个,而我有很多
- 在多用户环境中,您需要跟踪每个用户的最后一句话...
有人知道如何做到这一点吗?
广义上讲,最好的方法是利用Dialogflow
@SysCoder有一个程序包,可帮助您为node.js执行此操作 澄清 这假设您正在通过实现来生成响应.在这种情况下,将要发送回的消息保存在两个位置而不是一个位置应该相当容易.诸如语音中继器或多声的为您处理了很多事情,但做自己并不难. 如果您要通过GUI的响应"部分处理所有答复,那么这种方法将行不通. I am using actions-on-google and Dialogflow to build a bot. I was wondering how I can easily repeat the last sentence when asked by the user ("repeat please"). One way would be to have repeat followup intents in Dialogflow but this is quite heavy since : Does anyone know how to accomplish this? Broadly speaking, the best way would be to take advantage of Dialogflow Contexts. As you send the message, you can also add that message to a context (for example, you can call it "last_message"). You can then have another Intent that takes as an input context the "last_message" context and, if triggered, uses the value saved in the context to repeat it. @SysCoder has a package that will help you do this for node.js. Clarification This assumes that you're generating the response through fulfillment. In cases like this, it should be fairly easy to save the message you're sending back in two places, rather than one. Libraries such as voice-repeater or multivocal handle much of this for you, but it isn't difficult to do yourself. If you're handling all the replies through the Response section of the GUI, then this approach wouldn't work. 这篇关于重复最后一句话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!