Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for including utterances/ samples in slots #358

Open
abdulkaderjeelani opened this issue Jul 18, 2018 · 2 comments
Open

Support for including utterances/ samples in slots #358

abdulkaderjeelani opened this issue Jul 18, 2018 · 2 comments
Labels

Comments

@abdulkaderjeelani
Copy link

Now the schema's slot is an object that takes a map. Doc says "The slots object is a simple name: type mapping. The type must be one of Amazon's built-in slot types, such as AMAZON.DATE or AMAZON.NUMBER."
If we require to specify a list of samples, for a slot it is not possible. This is especially useful when modeling a dialog flow. see https://raw.githubusercontent.com/alexa/alexa-cookbook/master/feature-demos/skill-demo-plan-my-trip/models/en-IN.json

In code it is explicitly passed as empty array. Changing the value of the map from string to object should do.


if (intent.slots && Object.keys(intent.slots).length > 0) {
        intentSchema["slots"] = [];
        for (key in intent.slots) {
          //  It's unclear whether `samples` is actually used for slots,
          // but the interaction model will not build without an (empty) array
          intentSchema.slots.push({
            "name": key,
            "type": intent.slots[key],
            "samples": []
          });
        }
      }
      schema.intents.push(intentSchema);
    }
@dblock dblock added the bug? label Jul 19, 2018
@dblock
Copy link
Collaborator

dblock commented Jul 19, 2018

Care to pull request a fix for this?

@matt-kruse
Copy link
Collaborator

Comment added on the PR. Merge and release soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants