我正在向用户展示艺术家并通过询问用户是否想听这位艺术家的歌曲来跟进。
端点
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。请指导。