Dialogflow es 更新Dialogflow";转接电话;来自后端的字段(Node.js)
我尝试使用Node.js更新“应答”选项卡(“电话”->“添加应答”按钮)下“转接呼叫”字段中给定意图的电话号码,但我不能。 新的更新删除了带有旧电话号码的旧“转接电话”字段(我在控制台中手动创建该字段是为了进行测试) 请帮忙 下面是示例代码:Dialogflow es 更新Dialogflow";转接电话;来自后端的字段(Node.js),dialogflow-es,Dialogflow Es,我尝试使用Node.js更新“应答”选项卡(“电话”->“添加应答”按钮)下“转接呼叫”字段中给定意图的电话号码,但我不能。 新的更新删除了带有旧电话号码的旧“转接电话”字段(我在控制台中手动创建该字段是为了进行测试) 请帮忙 下面是示例代码: 详细的响应可以在这里找到,但是这里有正确的代码样本(测试和工作) 谢谢你,古科马尔,我会查一查的 const dialogflow = require('dialogflow') const intentsClient = new dialogflow.
详细的响应可以在这里找到,但是这里有正确的代码样本(测试和工作)
谢谢你,古科马尔,我会查一查的
const dialogflow = require('dialogflow')
const intentsClient = new dialogflow.IntentsClient({ keyFilename: 'key.json' })
const fulfillmentMessages = [ { platform: 'TELEPHONY',
telephonySynthesizeSpeech: { text: 'Hello World' } },
{ platform: 'TELEPHONY',
telephonyTransferCall: { phoneNumber: '+12132954242' } },
{ text: { text: [ '' ] } } ]
const intent = {
name: 'projects/example/agent/intents/2ef3e0b6-6cd7-4d5b-a8ca-ce11111125e019',
displayName: 'Test',
fulfillmentMessages: fulfillmentMessages
}
const updateIntentRequest = { intent: intent }
intentsClient.updateIntent(updateIntentRequest).then((data) =>{ console.log(data)}, (e) => {
console.log(e) })
const dialogflow = require('dialogflow');
const intentsClient = new dialogflow.v2beta1.IntentsClient({ keyFilename: 'key.json' }) //Note that dialogflow will be using v2beta1 api
const message_to_set = [
{
platform: 10,
telephonySynthesizeSpeech: {
text : 'Hello World'
},
telephonyTransferCall: {
phoneNumber: '+12132954242'
}
}
]
const intent = {
name: 'projects/example/agent/intents/2ef3e0b6-6cd7-4d5b-a8ca-ce11111125e019',
displayName: 'Forward',
messages: message_to_set //Note parameter was switched from fulfillmentMessages to messages
}
const updateIntentRequest = { intent: intent }
intentsClient.updateIntent(updateIntentRequest).then((data) =>{ console.log(data)}, (e) => { console.log(e) })