TelephonySynthesizeSpeech

TelephonySynthesizeSpeech

本文介绍了DIalogflow Telephony集成将来自webhook的SSML响应解释为普通文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用dialogflow-fulfillment nodejs库将响应(例如: agent.add(< speak> hello< / speak>))发送回对话流代理。它与dialogflow代理和谷歌模拟器很好地工作。但是,当我对电话集成使用相同的响应时。它不会将其识别为 ssml,而是将其说成大于小于…….hello小于斜线..大于>。此外,我检查了SDK支持的平台,但看起来0.6.1版没有

I am using dialogflow-fulfillment nodejs library to send response(eg: agent.add("<speak>hello</speak>")) back to the dialogflow agent. It works fine with dialogflow agent and google simulator. However, when I use the same response with telephony integration. It does not recognize it as "ssml" and speak it as "greater than speak less than....hello less than slash ..greater than>. Also. I checked SDK supported platforms and it looks like version 0.6.1 does not support telephony Platform yet.

推荐答案

您是正确的,因为客户端API不包含电话网关的方法,所以您我需要自己制作JSON响应。这是您可以为 fulfillmentMessages放置的示例:

You are correct that the client API doesn't include methods for the telephony gateway, so you'll need to craft the JSON response yourself. This is an example of what you can put for "fulfillmentMessages":

fulfillmentMessages: [
    {
        platform: 'TELEPHONY',
        telephonySynthesizeSpeech: {
            ssml: `<speak>YOUR MESSAGE GOES HERE</speak>`
        }
    }
]

以下是相关API v2 beta 1文档的链接(向下滚动)到TelephonySynthesizeSpeech):

Here's the link to the relevant API v2 beta 1 documentation (scroll down to TelephonySynthesizeSpeech): https://cloud.google.com/dialogflow-enterprise/docs/reference/rpc/google.cloud.dialogflow.v2beta1#telephonysynthesizespeech

这篇关于DIalogflow Telephony集成将来自webhook的SSML响应解释为普通文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 11:45