gpt4 book ai didi

node.js - Microsoft Botframework Prompts.choice 未获得验证响应

转载 作者:搜寻专家 更新时间:2023-11-01 00:06:04 24 4
gpt4 key购买 nike

我正在使用 chatconnector 将我的机器人连接到前端聊天应用程序并将机器人的响应写入我自己的数据库。问题是当我验证机器人响应的提示时,但没有 API 可供我获取验证响应。

bot.dialog('/', [
function (session) {
builder.Prompts.choice(session, "Which color?", "red|green|blue");

},
function (session, results, next) {
//after the user respond, the bot validates the input, if it's not
//one of the choices, this next function in the waterfall doesn't
//even run, therefore I have no way to write the bot response
//into my own chat database and render it for the user

}])

无论如何我可以获取机器人对验证失败的响应吗?

最佳答案

简短的回答:没有。

长答案:目前这不是 SDK 的一项功能。如果对选择提示的输入响应与提供的任何选项(也称为“意图”)不匹配,则 waterfall 对话不会继续执行第 2 步,因为没有匹配响应。系统设计是警告用户并等待他们按名称或数字(取决于 channel )输入提供的选项之一。例如。如果答案与任何选项都不匹配,框架将提示用户“我不明白。请从列表中选择一个选项。”直到输入有效选项。

黑客回答:在这种情况下,您需要修改 SDK 以满足您的需求,然后使用您定制的 SDK 版本部署您的机器人。您要查找的文件是 Microsoft/BotBuilder/Node/core/src/dialogs/PromptChoice.ts

关于node.js - Microsoft Botframework Prompts.choice 未获得验证响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39101533/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com