Debug an Alexa Conversations Skill Model
• GA:
en-US
, en-AU
, en-CA
, en-IN
, en-GB
, de-DE
, ja-JP
, es-ES
, es-US
• Beta:
it-IT
, fr-CA
, fr-FR
, pt-BR
, es-MX
, ar-SA
, hi-IN
To test user utterances and improve your Alexa Conversations skill model, you can use the debugging capability of the Alexa Simulator in the developer console.
Overview
In the developer console, you can interact with your skill by using the Alexa Simulator. In the Alexa Simulator, you can see how your Alexa Conversations skill model resolves to the Alexa Conversations model prediction (slots and actions).
The Alexa Simulator displays the resolved slots and actions in the Device Log section of the Alexa Simulator as a SkillDebugger.CaptureDebuggingInfo
directive. When an utterance doesn't resolve to the correct slots or actions, you can update your Alexa Conversation model, build the model, and try again.
Debug your Alexa Conversations skill model
You can debug your Alexa Conversations skill model by using the Alexa Simulator in the developer console.
To debug your Alexa Conversations skill model
- Log in to the developer console, and then navigate to your Alexa Conversations skill.
- If you haven't built the skill model yet, do so. For details, see Build the Skill Model for Your Alexa Conversations Skill.
You can't test your skill until the "light" Alexa Conversations model builds successfully. - At the top, click the Test tab.
- On the left, at the top, for Test is disabled for this skill, select Development.
- Select the Device Log check box.
- In the Alexa Simulator, click Type or click and hold the mic, and then type
open <invocation name>
.
If you don't remember the invocation name of your skill, you can view it on the Build tab. - Interact with your skill by speaking or typing.
- In the Device Log section of the Alexa Simulator, click a
SkillDebugger.CaptureDebuggingInfo
directive to view the Alexa Conversations model prediction (resolved slots and actions).Note: One turn can trigger multipleSkillDebugger.CaptureDebuggingInfo
entries.For the structure and fields of the
SkillDebugger.CaptureDebuggingInfo
directive, see Directive structure. - (Optional) Refresh the page periodically so that you aren't sifting through accumulated data from previous turns.
Example output
The following screenshot shows an example model prediction for an Alexa Conversations weather skill.
Directive structure
The SkillDebugger.CaptureDebuggingInfo
directive of type ConversationsModelPrediction
has the following format.
{
"header": { ... },
"payload": {
...
"type": "ConversationsModelPrediction",
"content": {
"phrasesToSlots": [
{
"phrase": string,
"slotType": string,
"index": {
"start": integer,
"end": integer
}
}
],
"actions": [
{
"type": string enum ["API", "RESPONSE"],
"name": string,
"input": object,
"output": object
}
]
}
}
}
Parameters
The following table shows the parameters of a SkillDebugger.CaptureDebuggingInfo
directive of type ConversationsModelPrediction
.
Field | Description |
---|---|
|
Type of the payload in the |
|
Recognized phrase to slot mapping for user utterance. |
|
Recognized phrase mapped to the slot in the user utterance. |
|
Slot mapped to the phrase in the user utterance. |
|
Index of the mapping. |
|
Index start. |
|
Index end. |
|
Action sequence that Alexa runs for the user utterance. |
|
Action type. |
|
Action name. |
|
Action input JSON. |
|
Action output JSON. |
Example model prediction
The following example shows a SkillDebugger.CaptureDebuggingInfo
directive of type ConversationsModelPrediction
(that is, the model prediction) for the user utterance, "I want to know the weather for Seattle today."
{
"header": {
"namespace": "SkillDebugger",
"name": "CaptureDebuggingInfo",
"messageId": "d78069b1-df34-4624-b9c1-EXAMPLE"
},
"payload": {
"skillId": null,
"timestamp": "2020-07-06T21:42:46.869Z",
"dialogRequestId": "2705e572-7506-4f51-9bc9-EXAMPLE",
"skillRequestId": "amzn1.echo-api.request.EXAMPLE",
"type": "ConversationsModelPrediction",
"content": {
"phrasesToSlots": [
{
"phrase": "seattle",
"slotType": "cityName",
"index": {
"start": 7,
"end": 8
}
},
{
"phrase": "today",
"slotType": "AMAZON.DATE",
"index": {
"start": 8,
"end": 9
}
}
],
"actions": [
{
"type": "API",
"name": "GetWeather",
"input": {
"date": "today",
"city": "seattle"
},
"output": {
"lowTemp": 56.5,
"highTemp": 70.1,
"cityName": "seattle"
}
},
{
"type": "RESPONSE",
"name": "notify_api_response_GetWeather",
"input": {
"returnedWeatherResult": {
"lowTemp": 56.5,
"highTemp": 70.1,
"cityName": "seattle"
}
},
"output": {
"speech": {
"text": "In seattle, it's a high of 70.1 degrees and a low of 56.5 degrees.",
"phrasesToInputParameters": [
{
"phrase": "70.1",
"inputParameter": "returnedWeatherResult.highTemp",
"index": {
"start": 6,
"end": 7
}
},
{
"phrase": "56.5",
"inputParameter": "returnedWeatherResult.lowTemp",
"index": {
"start": 12,
"end": 13
}
},
{
"phrase": "seattle",
"inputParameter": "returnedWeatherResult.cityName",
"index": {
"start": 1,
"end": 2
}
}
]
}
}
}
]
}
}
}
Related topics
- Get Started With Alexa Conversations
- Build the Skill Model for Your Alexa Conversations Skill
- Steps to Create a Skill with Alexa Conversations
Last updated: Nov 27, 2023