Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.