Bixby 中的交互式对话实现

Interactive conversation implementation in Bixby

我是 Bixby 的新手,在实现交互式对话方面遇到了麻烦。 如下所示:

用户:"Hi Bixby, book me a table at Flemings Steakhouse."

好的,哪一天?

用户:"Tomorrow."

好的,什么时间?

用户:“6:00pm。”

好的,有多少人?

用户:"Four."

好的,明天 6:00pm 在 Flemings Steakhouse 预订 4 人 table。

如果有什么建议,请帮忙。

这对于 Bixby 来说并不难。您要做的是创建一个操作来收集用户的所有输入。它可能看起来类似于此

你的行动

action (BookReservaton) {
  type(Search)
  description (Book a reservation)
  collect {

    // Ask for the user's reservation date
    input (reservationDate) {
      type (time.DateTimeExpression)
      min (Required) max (One)
    }

    // Prompt for number of guests, but also allow them to confirm 2
    input (numberOfGuests) {
      type (NumberOfGuests)
      min (Required) max (One)
      default-init {
        intent {
          goal: NumberOfGuests
          value: NumberOfGuest(2)
        }
      }
      prompt-behavior (AlwaysSelection)
    } 
  }
  output (Reservation)
}

在您的情况下,当用户没有从他们的话语中提供您所需的输入时,您将需要收集用户的输入。 This 是收集日期等的一个很好的例子。您还可以支持某人说 'Book a table for 4 this Tuesday at 7PM' 而无需提示他们输入。 Bixby 只会在没有必要的输入时提示用户。