Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add output option to dialog command #252

Merged
merged 5 commits into from
Jul 15, 2020
Merged

feat: add output option to dialog command #252

merged 5 commits into from
Jul 15, 2020

Conversation

kakhaUrigashvili
Copy link
Contributor

@kakhaUrigashvili kakhaUrigashvili commented Jul 10, 2020

example
ask dialog --save-skill-io output.json
ask dialog -r recordfile.json --save-skill-io output.json

example output file

{
  "invocations": [
    {
      "request": {
        "utterance": "open my app",
        "newSession": true
      },
      "response": {
        "body": {
          "id": "c4d76836-b689-4604-86a7-c0cf975fa3cc",
          "status": "SUCCESSFUL",
          "result": {
            "alexaExecutionInfo": {
              "alexaResponses": [
                {
                  "type": "Speech",
                  "content": {
                    "caption": "Welcome, you can say Hello or Help. Which would you like to try?"
                  }
                }
              ],
              "consideredIntents": [
                {
                  "name": "<LaunchRequest>"
                }
              ]
            },
            "skillExecutionInfo": {
              "invocations": [
                {
                  "invocationRequest": {
                    "endpoint": "arn:aws:lambda:<lambda>",
                    "body": {
                      "version": "1.0",
                      "session": {
                        "new": true,
                        "sessionId": "amzn1.echo-api.session.58c7a368-5be0-4497-82f2-9e2341e522e2",
                        "application": {
                          "applicationId": "<skill id>"
                        },
                        "user": {
                          "userId": "<user id>"
                        }
                      },
                      "context": {
                        "System": {
                          "application": {
                            "applicationId": "<skill id>"
                          },
                          "user": {
                            "userId": "<user id>"
                          },
                          "device": {
                            "deviceId": "<device id>",
                            "supportedInterfaces": {}
                          },
                          "apiEndpoint": "https://api.amazonalexa.com",
                          "apiAccessToken": "<token>"
                        }
                      },
                      "request": {
                        "type": "LaunchRequest",
                        "requestId": "<request id>",
                        "timestamp": "2020-07-10T17:28:01Z",
                        "locale": "en-US",
                        "shouldLinkResultBeReturned": false
                      }
                    }
                  },
                  "invocationResponse": {
                    "body": {
                      "version": "1.0",
                      "response": {
                        "outputSpeech": {
                          "type": "SSML",
                          "ssml": "<speak>Welcome, you can say Hello or Help. Which would you like to try?</speak>"
                        },
                        "reprompt": {
                          "outputSpeech": {
                            "type": "SSML",
                            "ssml": "<speak>Welcome, you can say Hello or Help. Which would you like to try?</speak>"
                          }
                        },
                        "shouldEndSession": false
                      },
                      "userAgent": "ask-node/2.7.0 Node/v10.20.0",
                      "sessionAttributes": {}
                    }
                  },
                  "metrics": {
                    "skillExecutionTimeInMilliseconds": 458
                  }
                }
              ]
            }
          }
        }
      }
    },
    {
      "request": {
        "utterance": "Hello",
        "newSession": false
      },
      "response": {
        "body": {
          "id": "48b1c720-39eb-45ca-a82e-2fb0f9344c17",
          "status": "SUCCESSFUL",
          "result": {
            "alexaExecutionInfo": {
              "alexaResponses": [
                {
                  "type": "Speech",
                  "content": {
                    "caption": "Hello World!"
                  }
                }
              ],
              "consideredIntents": [
                {
                  "name": "HelloWorldIntent",
                  "confirmationStatus": "NONE",
                  "slots": {}
                }
              ]
            },
            "skillExecutionInfo": {
              "invocations": [
                {
                  "invocationRequest": {
                    "endpoint": "arn:aws:lambda:<endpoint>",
                    "body": {
                      "version": "1.0",
                      "session": {
                        "new": false,
                        "sessionId": "<session id>",
                        "application": {
                          "applicationId": "<skill id>"
                        },
                        "user": {
                          "userId": "<user id>"
                        }
                      },
                      "context": {
                        "System": {
                          "application": {
                            "applicationId": "<skill id>"
                          },
                          "user": {
                            "userId": "<user id>"
                          },
                          "device": {
                            "deviceId": "<device id>",
                            "supportedInterfaces": {}
                          },
                          "apiEndpoint": "https://api.amazonalexa.com",
                          "apiAccessToken": "<token>"
                        }
                      },
                      "request": {
                        "type": "IntentRequest",
                        "requestId": "<request id>",
                        "locale": "en-US",
                        "timestamp": "2020-07-10T17:28:07Z",
                        "intent": {
                          "name": "HelloWorldIntent",
                          "confirmationStatus": "NONE"
                        }
                      }
                    }
                  },
                  "invocationResponse": {
                    "body": {
                      "version": "1.0",
                      "response": {
                        "outputSpeech": {
                          "type": "SSML",
                          "ssml": "<speak>Hello World!</speak>"
                        },
                        "type": "_DEFAULT_RESPONSE"
                      },
                      "sessionAttributes": {},
                      "userAgent": "ask-node/2.7.0 Node/v10.20.0"
                    }
                  },
                  "metrics": {
                    "skillExecutionTimeInMilliseconds": 207
                  }
                }
              ]
            }
          }
        }
      }
    },
    {
      "request": {
        "utterance": "bye",
        "newSession": false
      },
      "response": {
        "body": {
          "id": "3824b9d0-bb98-4e70-baa7-1562bed6aa9e",
          "status": "FAILED",
          "result": {
            "alexaExecutionInfo": {
              "consideredIntents": [
                {
                  "name": "<IntentForDifferentSkill>"
                },
                {
                  "name": "<IntentForDifferentSkill>"
                },
                {
                  "name": "<IntentForDifferentSkill>"
                },
                {
                  "name": "<IntentForDifferentSkill>"
                }
              ]
            },
            "error": {
              "message": "This utterance did not resolve to any intent in your skill. Please invoke your skill and try again with a different utterance or update your interaction model to include this utterance before testing again."
            }
          }
        }
      }
    }
  ]
}

@kakhaUrigashvili kakhaUrigashvili marked this pull request as draft July 10, 2020 17:35
@kakhaUrigashvili kakhaUrigashvili marked this pull request as ready for review July 13, 2020 21:11
@RonWang RonWang merged commit 4ce263e into develop Jul 15, 2020
@RonWang RonWang deleted the dialog-output branch July 15, 2020 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants