gpt4 book ai didi

node.js - 可以在一个triggerAction中使用多个意图吗? [路易斯]

转载 作者:太空宇宙 更新时间:2023-11-03 23:02:04 25 4
gpt4 key购买 nike

我有一个 QnA 机器人,它应该适用于多种意图,我想触发它​​用于“无”意图、“问候”,因为我有一些独特的响应,以及 IT 帮助,因为这是 QnA 机器人的主要目的。我是否必须复制粘贴整个对话框并仅更改意图名称,或者我可以为 matches 方法列出多个意图吗?

  bot.dialog('QnABotRequest', function (session, args) {
//Code
}).triggerAction({
matches: 'Greeting' | 'None' | 'IT Help' //Maybe something like this ?
});

https://docs.botframework.com/en-us/node/builder/chat-reference/modules/_botbuilder_d_.html#matchtype定义它的地方说:

{(RegExp|string)[]}

An array of either regular expressions or named intents can be passed to match the users utterance in a number of possible ways. The rule generating the highest score (best match) will be used for scoring purposes.

最佳答案

使用方法是:

.triggerAction({
matches: [/greeting/i, /none/i, /^it help/i]
)}

.triggerAction({ matches: [
/(roll|role|throw|shoot).*(dice|die|dye|bones)/i,
/new game/i
]});

关于node.js - 可以在一个triggerAction中使用多个意图吗? [路易斯],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45223553/

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