What is the best way to get user voice input from invocation?

Hello guys,

I want to invoke the skill like this (or even shorter if possible) : Ask skill_name to command_name
And then have the command_name directly into a variable on start so that I can process it.
The command starts with log and the rest can be anything, like log 2 bananas or log 30min walking… that is why it’s hard to predict all the utterances.
I am sure this is possible but I cannot find the right way with intents or capture.
Thanks for your help!

Unfortunately, this is not possible with Capture/Intents as this is a system-level Alexa issue and not something you configure from your assistant. You can try leveraging these configurations in the Alexa Developer Console!

Hello!

To achieve the desired functionality of invoking a skill with a specific command and capturing the command into a variable for further processing, you can make use of intents and slots in your conversational agent.

First, you need to define an intent that captures the command. In this case, let’s call it “LogCommandIntent.” The training data for this intent should include various examples of commands that start with “log” followed by any text. For example:

  • “Log 2 bananas”
  • “Log 30min walking”
  • “Log my expenses”
  • “Log a new entry”

Next, you can define a slot to capture the variable part of the command (e.g., “2 bananas,” “30min walking,” etc.). Let’s call this slot “LogEntrySlot.” The slot type can be a custom slot type or a built-in type like AMAZON.SearchQuery.

Now, when a user says, “Ask skill_name to command_name,” you can use the LogCommandIntent and the LogEntrySlot to capture the command. Here’s an example of how the conversation flow might look:

User: Ask skill_name to log 2 bananas Agent: (Recognizes intent and slot)

  • Intent: LogCommandIntent
  • Slot: LogEntrySlot = “2 bananas”

Once you have captured the command in the LogEntrySlot, you can process it further in your code as needed.

Keep in mind that the specific implementation details may vary depending on the platform or framework you are using to build your conversational agent. However, the general concept of using intents and slots to capture user commands remains the same.

I hope this helps! Let me know if you have any further questions or visit here.