[英]Using the Bot Framework to send message on the user's behalf
我目前正在尝试接受来自用户的语音输入,将其输入到Bing Speech API中以获取文本,并将该文本作为用户响应传递。 我已经收到了来自Bing的回信,但我不确定如何发送该文本作为用户回复。 我一直在搜索GitHub,因此感谢您提供任何反馈。 相关代码如下:
function(session){
var bing = new client.BingSpeechClient('mykey');
var results = '';
var wave = fs.readFileSync('./new.wav');
const text = bing.recognize(wave).then(result => {
console.log('Speech To Text completed');
console.log(result.header.lexical)
console.log('\n');
results.response = result.header.lexical;
});
}]
您应该使用session.send
。
我建议您看一下Intelligence-SpeechToText示例,该示例显示了类似的情况。
更新:弄清楚了(排序)。 为了利用发送回该用户输入的优势,我不得不使用另一张卡。 在卡片的背景下,我可以使用imBack函数
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.