在Bixby中,要使语音助手能够解释用户的意图并执行相应的操作,需要使用派发短语。派发短语告诉Bixby用户所请求的内容,并将其转发给正确的操作或场景。一种常见的错误是,没有使用派发短语或使用的派发短语不够明确。如果没有使用派发短语,Bixby将无法理解用户的意图。如果使用的派发短语不够明确,则Bixby可能会误解用户的请求。
因此,为了确保Bixby正确地解释用户的意图并执行相应的操作,应当使用明确的命名派发短语。以下是使用命名派发短语的示例代码:
action (SomeAction) {
type (Search)
collect {
input (query) {
type (viv.core.Text)
min (Required)
prompt ("What would you like to search for?")
}
}
output (SomeResult)
description ("Search for something")
}
dispatch {
intent {
goal: SomeAction
value: Viv.core.NaturalLanguage
}
//使用命名派发短语"search"来触发搜索操作
routing (SomeAction)
{
with-accepted-option {
name (search)
}
}
}