Lydia
Lydia

Reputation: 81

How to make Bixby ask input without user

I want to make Bixby ask for input values when the user just states what he/she wants to do(without any valuable input given.)

For example,

user: I want to search something
Bixby: What do you want to search?
user: *possible-input-value*

Is this possible? If so, how can I implement this?

Upvotes: 3

Views: 131

Answers (3)

rogerkibbe
rogerkibbe

Reputation: 358

In addition to Pete's response, you need to enable this for voice input (UI only input will not pass capsule review for submission to the marketplace). To do so, you need to create natural language training for Search

Since you are asking for input at a prompt, you need to create a training that will be used when prompting for Search

Training source for this would look like:

[g:Search:prompt] (sample search text)[v:Search]

Or in the UIenter image description here

Definitely check out the sample code at https://github.com/bixbydevelopers for more examples. A simple example of input would be in https://github.com/bixbydevelopers/capsule-sample-fact - note the training that uses tags

Upvotes: 1

Ameya
Ameya

Reputation: 888

In addition to Pete's response, I would recommend taking a look the design principles for Bixby development. These principles will guide you in making a targeted capsule that solves the use case you would like to address.

Upvotes: 0

Pete Haas
Pete Haas

Reputation: 1800

That's easy in Bixby. If you make an input to your action required...it will prompt the user for input. Let's say you have an action like this:

action (FindSomething) {
  type(Search)
  description (Search for something)

  collect {
    input (search) {
      type (Search)
      min (Required) max (One) // Force Bixby to prompt for an input.
    }
  }
  output (viv.core.Text) // some result
}

And you have a search concept defined like this:

name (Search)  {
  description (Search term)
}

You can provide an input view for the user to enter the term (via screen).

input-view {
  match: Search(search)

  message {
    template ("What do you want to search?")
  }

  render {
    form {
      elements {
        text-input {
          id (search)
          label (Search Term)
          type (Search)
          max-length (50)
          value ("#{raw(search)}")
        }
      }
      on-submit {
        goal: Search
        value: viv.core.FormElement(search)
      }
    }
  }

}

enter image description here

Upvotes: 2

Related Questions