When I dispatch an action, like getQuiz, Bixby will show "Searching for Quizs" before it finds the quiz. How do I customize this text?
Use a progress dialog e.g. do something like this:
dialog (Progress) {
match: viv.weather.SolarNoon {
from-output: viv.weather.GetSolarNoon (this)
}
choose (Random) {
template (Performing solar calculations...)
template (Consulting my analemma...)
}
}
If you don't want to have any progress dialogs, you can use the type (Calculation) for the action.
Related
I have used hands-free list-of navigation in my capsule where I select a single item from multiple items to get the detailed information using voice command ("select one, choose second, etc").
But If I have a single item only, I am unable to give a voice command to go to another page. (hands-free list-of navigation not working when we have a single item).
So, how can I go to another page when I have a single item only, using voice command. (hands-free navigation)
Please help me with this.
For a single item case, should be checked first and probably not enter list-navigation at all. The logic for render in view is recommended as following:
if (size(this)==1) {
// render content (maybe different between HEF and non-HEF, but no navigation needed)
}
else {
if ($handsFree) {
// do list navigation here
}
else {
// render non-HEF content
}
}
Please consider the following code as a sample, this view works for multiple item list and single item. For HEF with multiple items, the flow is "do you want one of these" --> "yes" --> "which person would you like" --> "first/second one" --> Bixby renders the content in detail-stuctA macro. For HEF with single item, it directly renders detail-stuctA macro and skip all the navigation part.
It is true that if skip the (size(this)==1) check would result stuck in list-navigation forever, but that is understandable, because each time Bixby try to render, it fits the condition of list-navigation and take the list-navigation route.
result-view {
match: StructA(this)
message: template ("In result view")
render {
if (size(this)==1) {
layout-macro (detail-structA) {
param (person) {expression (this)}
}
}
else {
if ($handsFree) {
list-of (this) {
navigation-mode {
read-many {
page-size (6)
list-summary("In hands free")
page-content {
underflow-statement (This is the first page.)
page-selection-question (Do you want one of these?)
item-selection-question (Which person would you like?)
overflow-statement (Those are all the persons that meet your search.)
overflow-question (What would you like to do?)
}
}
}
where-each (item) {
layout-macro (summary-structA) {
param (person) {expression (item)}
}
}
}
}
else {
list-of (this) {
where-each (item) {
layout-macro (summary-structA) {
param (person) {expression (item)}
}
}
}
}
}
}
}
If the above does not answer your question, please submit a ticket using Bixby IDE --> Help --> Contact Support with a copy of sample capsule to demo the issue.
In a dialog file like
dialog (Result) {
match: Content (this)
template("Welcome!")
}
where Content is an an answer set and the user proceeds from browsing the answer set to each detail page, how do I customize so that the dialog is different for each mode -- list, summary, detail?
I am looking to do something along the lines of if mode = Detail then template = Content.text
You can add this setting to your capsule.bxb file.
runtime-version (2) {
overrides {
allow-dialogs-on-detail-pages (true)
}
}
In your result-view, you can define your details dialog in the message section. For example:
message {
// A single result?
if (size(this) == 1) {
template (Details Dialog!!!)
}
}
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?
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)
}
}
}
}
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 UI
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
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.
I am trying to render a result-view where there is 1) spoken output; 2) a different text summary of that output; and 3) A spoken followup prompt.
I would like the followup prompt (obviously) to be spoken after the spoken output. But I don't want it, or the spoken output, to be rendered to the screen.
I've tried the following result-view:
result-view {
match: myStructure (this)
message ("#{value (this.spokenResponse)}")
render {
layout-match (this.spokenResponseSummary) {
mode (Details)
}
}
followup {
prompt {
dialog (Would you like to hear more?)
on-confirm {
message ("#{value (this.details)}")
}
on-deny {
message (Okay.)
}
}
}
conversation-drivers {
conversation-driver {
template ("More Details")
}
}
}
This renders the spokenResponseSummary - that's good!
But it also displays the spokenResponse + followup prompt at the top of the screen, and the spokenResponseSummary below.
How to I not display the spokenResponse + followup prompt. (Ideally, how to do I display some arbitrary text at the top of the screen, in its place?)
You can use the speech key to have Bixby read our different dialog than what is shown.
result-view {
match: MyModel(this)
message {
template ("I am shown.") {
speech ("I am read out loud.")
}
}
... your content here ...
}
https://bixbydevelopers.com/dev/docs/reference/type/template.speech
More details here:
How to control speech output on Bixby
My app is basically providing three option for selection to the user.
1: I am using result-view and cell-card. when i was using for each, i was able to click on the card and trigger an intent which is showing user the further details in the form of compound-card. Now, for user to select the option by saying first, second OR third, i need to use navigation-support and for that I need to use list-of in the result-view. After using list-of, I am unable to trigger the intent on-click. How to achieve that?
2: How to trigger that intent, if user is saying first, second or third. Right now, if user is choosing by saying first, second and third, it is popping out the said cell-card excluding other two. How to achieve that?
My result-view is:
result-view {
match: ArtistChoiceResult (artistchoice) {
from-output: ArtistChoice
}
message {template("Here is the upcoming event")}
list-of (artistchoice) {
navigation-mode {
read-many {
page-size(3)
underflow-statement (This is the first set)
item-selection-question (Which one would you like?)
overflow-statement (That's all I have)
}
}
where-each (one) {
layout-match (one) {
mode (Summary)
}
}
}
layout-match is like this
layout {
match: ArtistChoiceResult (singleArtist)
mode(Summary)
content{
section{
content{
cell-card {
slot1 {
image {
url ("#{value(singleArtist.multiple_image)}")
shape (Square)
}
}
slot2 {
content {
order (PrimarySecondary)
primary ("#{value(singleArtist.multiple_name)}")
secondary ("#{value(singleArtist.multiple_cat)}")
}
}
on-click {
intent {
goal: ArtistChoice
value-set:MultipleID{$expr(singleArtist.multiple_id)}
}
}
}
}
}
}
}
Navigation support file is
navigation-support {
match: ArtistChoiceResult (this)
ordinal-selection-patterns {
pattern ("(first)[v:viv.core.OrdinalSelector]")
pattern ("(first)[v:viv.core.OrdinalSelector] one")
pattern ("that (first)[v:viv.core.OrdinalSelector] one")
pattern ("yes (first)[v:viv.core.OrdinalSelector]")
pattern ("yes (first)[v:viv.core.OrdinalSelector] one")
pattern ("yes that (first)[v:viv.core.OrdinalSelector] one")
pattern ("result number (one)[v:viv.core.CardinalSelector:1]")
pattern ("the (first)[v:viv.core.CardinalSelector:1]")
pattern ("select (first)[v:viv.core.OrdinalSelector] one")
pattern ("select (first)[v:viv.core.OrdinalSelector]")
}
}
A couple of issues with your code
you have created an intent in a Summary layout. The documentation says,
https://bixbydevelopers.com/dev/docs/reference/type/layout-macro-def.content.cell-card
If you have this card to list results with list-of, then clicking the
card opens the selected item in Details mode and the defined intent is not passed
If you try to use layout-match inside where-each the IDE will show a WARN_DEPRECATED error. While this might not throw compile errors now, it is advisable to use layout-macro
Suggestions to try:
Use layout-macro to define your Layouts (both Summary and Details)
Add the intent in the Details layout