如何从javascript响应中进行计算输入?所以只需从响应中选择一个声音???我不希望用户会选择一些 - 他会说播放声音 - 我通过api通话获得声音并且他们开始播放
例如我有javascript函数:
module.exports.function = function CommandContext(userInput, $vivContext){
return {
audioInfo: {
category: 'SINGLE',
displayName: res.audio.name,
repeatMode: 'ALL',
doNotWaitForTTS: true,
audioItem: [{...}]
}
};
}
行动模型:
action (CommandContext) {
description ('Context')
type(Search)
collect {
input (userInput) {
type (commandUser)
}
computed-input (sound) {
type (audioPlayer.Result)
compute {
intent {
goal: audioPlayer.PlayAudio
value: CommandResult.audioInfo
}
}
hidden
}
}
output (CommandResult)
}
很高兴听到你在API方面解决了它。
以下是一些可能有用的额外信息:
default-select
“为用户做出决定”,虽然它必须是select-first
或select-min
,你可以阅读更多here。followup
中尝试conversation-divers
或result-view
子键。查看我们的参考页面here。让我们知道它是否有帮助,并与Bixby玩得开心!
以下是评论中其他问题的答案:
example
命名空间。