Interactive conversation implementation in Bixby

2019-08-18 19:26发布

问题:

I am new to Bixby, facing trouble in Interactive conversation implementation. Something like below :

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

Okay, for what day?

User: "Tomorrow."

Okay, for what time?

User: "6:00pm."

Okay, for how many people?

User: "Four."

Okay, booking a table for 4 people at Flemings Steakhouse tomorrow at 6:00pm.

If any suggestion , please help.

回答1:

This isn't too hard with Bixby. What you'll want to do is create an action that will collect all the input from the user. It could look similar to this

Your action

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)
}

In your case, you're going to need to collect input from the user when they don't provide your required input from their utterance. This is a good example of collecting dates, etc. You can also support someone saying 'Book a table for 4 this Tuesday at 7PM' without needing to prompt them for input. Bixby will only prompt the user when it doesn't have a required input.



标签: bixby