We are excited to announce that starting today, you can build a custom slot type once and re-use it across your skills or interaction models. To do that, you create your custom slot type outside the context of a skill and it will be available in all skills in your account. Re-using slot types across skills ensures that you have a consistent experience across all of your skills when covering similar topics. It can also have positive effects on your productivity by preventing you from having to create the same slots and slot values multiple times and keep them consistent. Below, we will cover several ways to manage slots in your skill.
First, some context. When developing a custom skill, you start by creating a set of intents that represent actions that users can do with your skill. An intent represents an action that fulfills a user's spoken request. Intents can optionally have arguments called slots. Amazon provides built-in support for a large library of slot types. This includes:
Many skills, however, create their own slot types to cover unique use cases, called custom slots. For example, a skill for grocery shopping might define an intent named GetGroceryItemAvailability, with a custom slot type of AvailableGroceryItems, with slot values representing each grocery item at a particular store. Creating custom slot types can have its challenges. Some challenges are:
There are many ways to manage slots in your skill. We will cover a few ways below, including the new capability to share custom slot types between your skills.
With the Reference-Based Catalog Management API, you can reference an external data source to get the slot values for a custom slot type. This is especially useful when your slot values change frequently.
Let’s say that you are a skill builder for a grocery store. Your store has a lengthy grocery list that is common to all the store branches, but these grocery items get updated very frequently. Let’s say that you have a skill that can check the availability of grocery items by each individual store branch. As a developer, it would be tedious to add, delete, and update these grocery items (slots) in a “ListOfGroceryItemsSlot” (custom slot type). However, with catalog management, you can provide “ListOfGroceryItemsSlot” in your grocery skill with a link to an existing catalog of grocery items in an Amazon S3 bucket or any location with a https:// link. When you update the catalog stored in your Amazon S3 bucket or other online resource and rebuild your skill, the "ListOfGroceryItemSlot" type will be automatically updated with the latest catalog values (in this case, available groceries). This list of grocery items (slots) can be maintained independent of any skill and used by many skills.
Starting today, you can share custom slots types between multiple skills. Creating a slot type now can be done independent of skills and can work in conjunction with catalog management.
Back to the grocery example - let’s say you have a second Alexa skill which helps shoppers find items from within a branch. You’ve already created the “ListOfGroceyItems” custom slot type and linked it to your external catalog with catalog management. In your shopping skill, you do not need to re-create the slot type from scratch. Instead, you can re-use the same slot type in both of your skills.
Changes to one slot type will reflect in all of your skills that are using it when the skills are re-built. Further, skills can now be re-built almost instantly with Live Skill Updates. This will let you reduce your development effort, reduce human error, and ensure a consistent experience across your skills using the same custom slot types.
Shared slots are like built-in slots that you create yourself since they become available to all of your custom skills. They are also not dependent on a catalog system. To share your slot type in multiple skills you need to create a new slot type and it will available in all your skills. Find out how to share slots in our documentation.
Both catalog management and shared slots are slot management techniques that occur at build time, meaning they require a re-build of your skill to be exposed to your customers. With the use of Dynamic Entities, you can augment your skill's predefined slot type from your skill logic (lambda) and dynamically create and use new slot values at skill runtime. For instance, as the grocery skill developer, you can offer personal experiences to your customers by using Dynamic Entities to update product preferences at every turn. For example if a user says “add milk to my shopping list” I can use their customer ID, location, preferred brand of milk and their shopping history and resolve the slot value of “milk” into “organic 2% milk” and ask them if that’s what they’re looking for. Dynamic Entities is a great tool to provide different service to different customer based on their personal preference or location.
Related content for Dynamic Entities:
All three slot techniques discussed in this blog will accelerate our development cycle and provide a better customer experience. To recap, catalog management helps you sync slots to custom slot types from a linked source. You can now also share custom slot types between skills. Finally, with dynamic entities you can dynamically create slot values at run time to customize your customers’ experience. Visit the tech docs to learn how to use catalog management, share slots, and implement dynamic entities today.