0

I have the concept of a "Pack" in my product which is a collection or bundle of content that a user can purchase. I would like to make Bixby treat the terms "pack", "collection", and "bundle" as equivalent while within my capsule, so that saying "show me available bundles" is equivalent to "show me available packs".

I tried creating a file called resources/target/pack.vocab.bxb with these contents:

vocab (altbrains.quotations.Pack) {
  "pack" {"Pack", "bundle", "collection"}
}

my Pack concept file is Pack.model.bxb:

structure (Pack) 
  { property (title) {
    type (Title)
    min (Required)
  }
  property (price) {
    type (Price)
    min (Required)
  }
  property (brand) {
    type (Brand)
    min (Required)
  }
  property (description) {
    type (Description)
    min (Required)
  }
  property (images) {
    type (Image)
    min (Required) max (Many)
  }
  property (language){
    type (Language)
    min (Optional) max (Many)
}
}

My Content.model.bxb is:

structure (Content) {
  description (Output)
  property (text) {
    type (core.Text)
    min (Optional) max (One)
    visibility (Private)
  }
  property (image) {
    type (image.Image)
    min (Optional) max (One)
    visibility (Private)
  }
}

The vocab file above produces a bunch of error messages (10) in the compiler saying "invalid vocab term, structured value may not have a symbol"

I want the vocab file to compile and I want a test story using "list my available bundles" to work the same as a test story saying "list my available packages"

S.S. Anne
  • 15,171
  • 8
  • 38
  • 76
Fred Zimmerman
  • 1,178
  • 3
  • 13
  • 29

1 Answers1

2

Try it like this....

Utterance of: show me my packs

Create enum for: "packEnum".

Create a vocab of: packEnum, "pack","bundle","collection"

Create a structure of Pack: You already have that

Create a showPacks.js: It should return a Pack object.

Create an action: of ShowPack. ShowPack takes an input of packEnum and returns Pack structure.

Map the ShowPack action to showPack.js in your endpoints

Create a view and dialog for of PackView and PackDialog that matches on a Pack.

Create an utterance of [g:ShowPack] show (pack)[v:packEnum].

Then when you say "show collection", it would map to the ShowPack action, which executes the showPacks.js and loads up all packs, which gets displayed by PackView/Dialog.

In your case it seems like you're trying to treat the Pack structure as an input, but it's really a response from an action to be displayed. And you need something that is the input into the action.

Cory
  • 196
  • 2
  • 8