如何从 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)
}