我正在向用户展示艺术家,并通过询问用户是否要听这位艺术家的歌曲来跟进。
端点
action-endpoint (PlayArtist) {
accepted-inputs (artist_id) // here too yellow line (Missing required input `artistToPlay`)
local-endpoint (PlayArtist.js)
}
action-endpoint (BuildArtistAudioInfo) {
accepted-inputs (artist_id)
local-endpoint (BuildArtistAudioInfo.js)
}
BuildArtistAudioInfo.model.bxb
action (BuildArtistAudioInfo) {
type (Search)
description (Makes a meow info to play.)
collect{
input (artist_id){
type (ArtistID)
min (Optional)
max (One)
}
}
output (audioPlayer.AudioInfo)
}
跟进
followup {
prompt {
dialog (Would you like to play music for this artist)
on-confirm {
if (false) {
message (I see...)
} else {
intent {
goal: PlayArtist
value: $expr(singleArtistEvent.artistId)
}
}
}
on-deny {
message (OK friend.)
}
}
}
现在,我需要将此值传递给PlayArtist动作文件,但是在看到您的样品囊之后,我很困惑将输入传递到哪里。
PlayArtist动作文件
action (PlayArtist) {
type (Search)
collect {
input (artist_id){
type (ArtistID)
min (Optional)
max (One)
}
computed-input (artistToPlay) {
description (Create the playlist to play)
type (audioPlayer.AudioInfo)
min (Required) max (One)
compute {
intent {
goal: BuildArtistAudioInfo
value:ArtistID(artist_id) // i am confused over here, it's giving error ()
}
}
//hidden
}
computed-input (play) {
description (By passing in the AudioInfo object to the PlayAudio action, we ask the client to play our sound.)
type (audioPlayer.Result)
compute {
intent {
goal: audioPlayer.PlayAudio
value: $expr(artistToPlay)
}
}
//hidden
}
}
output (Result)
}
我需要多加accept-input
吗?此外,BuildArtistAudioInfo.js
文件还具有歌曲信息,因此我需要在此处获取歌手ID,然后将其转到api,我将在其中获取歌曲信息。请指导。
答案 0 :(得分:1)
computed-input (artistToPlay)
中,意图块应具有一个值字段value
代替value-set
,因为它是单个值而不是集合