gpt4 book ai didi

javascript - 为什么我的 Alexa 技能测试显示正确的 lambda 输出,但在开发人员控制台中测试时却给出错误消息?

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:48:38 25 4
gpt4 key购买 nike

我正在尝试使用一些 SSML 来增强我的 Alexa 技能(基于示例 Alexa 技能代码)。当我在 lambda 函数中运行测试时,我得到了成功的输出,但是当我在 Amazon 开发人员门户中测试它时,我得到:

The remote endpoint could not be called, or the response it returned was invalid.

这是我为将 SSML 添加到我的 Alexa 技能而修改的唯一代码:

// Create speech output
var speechOutput = {
speech: "<speak> Reflect upon <break time=\"10ms\"/> this. <break time=\"1s\"/>"
+ "<audio src='https://s3.amazonaws.com/findyourzen/audio/bell.mp3'/>"
+ fact
+ "<audio src='https://s3.amazonaws.com/findyourzen/audio/bell.mp3'/>"
+ "</speak>",
type: AlexaSkill.speechOutputType.SSML
};
response.tellWithCard(speechOutput, "FindYourZen", speechOutput);
};

我已经完全按照 Amazon directions 添加了音频文件所以我知道这不是错误消息的原因。

最佳答案

如果您使用的是 ASK sdk v2。您不需要添加说话标签,它会自动添加。试试这个..

         var speechOutput = "Reflect upon <break time=\"10ms\"/> this. <break time=\"1s\"/>"
+ "<audio src='https://s3.amazonaws.com/findyourzen/audio/bell.mp3'/>"
+ fact
+ "<audio src='https://s3.amazonaws.com/findyourzen/audio/bell.mp3'/>"

return handlerInput.responseBuilder
.speak(speechOutput)
.getResponse();

关于javascript - 为什么我的 Alexa 技能测试显示正确的 lambda 输出,但在开发人员控制台中测试时却给出错误消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36959973/

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