Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

APIs Build an Alexa Skill Building an Alexa Skill Creating Slots and Sample Utterances

Alexander Gaesser
Alexander Gaesser
4,653 Points

What if you wanted to use two+ slots in one intent?

Let's say you had an object with multiple attributes - I'll stay with the dictionary example. I want to either get a list of synonyms, antonyms, or the definition for a given word. So, a few sample utterances would be:

What are some synonyms of dangerous? What are some antonyms of dangerous? What is the definition of dangerous?

Which translate to: What are some {attribute} of {word}? What are some {attribute} of {word}? What is the {attribute} of {word}?

While I realize I could break this up into three separate intents, there are cases where this doesn't make sense. I haven't been able to get a second custom slot to work, and I'm not finding a lot of documentation or discussion about this.


1 Answer

Andrew Chalkley
Andrew Chalkley
Treehouse Guest Teacher

That should be doable. You'll need to modify the skill service code to respond to two slots.