pirixtech / techie-buddy

Techie buddy helps software developers and all desk workers to exercise in a busy day to maintain good posture and health
1 stars 0 forks source link

Debug Build model inconsistency #29

Open PXMYH opened 4 years ago

PXMYH commented 4 years ago

With this APL-A template:

  "type": "APLA",
  "version": "0.8",
  "mainTemplate": {
    "parameters": [
      "payload"
    ],
    "item": {
      "type": "Selector",
      "strategy": "randomItem",
      "items": [
        {
          "type": "Speech",
          "contentType": "text",
          "content": "Are you ready? I found this exercise hopefully can help you. ${payload.getPhysicalExerciseResult.exercise}."
        },
        {
          "type": "Speech",
          "contentType": "text",
          "content": "A ${payload.getPhysicalExerciseResult.bodyArea} exercise will be helpful. Here's one for you, ${payload.getPhysicalExerciseResult.exercise}"
        },
        {
          "type": "Speech",
          "contentType": "text",
          "content": "I have a ${payload.getPhysicalExerciseResult.bodyArea} exercise for you. ${payload.getPhysicalExerciseResult.exercise}"
        },
        {
          "type": "Speech",
          "contentType": "text",
          "content": "Found an exercise for you ${payload.getPhysicalExerciseResult.exercise}"
        }
      ]
    }
  }
}```
The test response from Alexa
![Screen Shot 2020-08-26 at 12 13 23 PM](https://user-images.githubusercontent.com/4936719/91328934-8e31e780-e795-11ea-8ca9-a4792e1d1a38.png)

However, there're response returned back from Alexa but still renders `Something went wrong`

{ "header": { "namespace": "SkillDebugger", "name": "CaptureDebuggingInfo", "messageId": "e51a9ed1-c683-4bf2-b0ce-67b22846de7a" }, "payload": { "skillId": "amzn1.ask.skill.c3772f7a-4aa5-407b-8623-6a9dd104f3e8", "timestamp": "2020-08-26T22:49:16.166Z", "dialogRequestId": "fbcc3422-51ff-4aaf-b009-c73da9205f03", "skillRequestId": "amzn1.echo-api.request.3daed7bc-dcff-40a3-a971-2a8f8ea2b17b", "type": "SkillExecutionInfo", "content": { "invocationRequest": { "endpoint": "arn:aws:lambda:us-east-1:683778474338:function:getExerciseRoutine", "body": { "version": "1.0", "session": { "new": false, "sessionId": "amzn1.echo-api.session.38ceab85-12aa-4dc7-a86a-a375bcb3ce62", "application": { "applicationId": "amzn1.ask.skill.c3772f7a-4aa5-407b-8623-6a9dd104f3e8" }, "user": { "userId": "amzn1.ask.account.AGBUSYXGJ54EGUUOFKONBE575WDW7BSX4GQR377DBQRXTHQHYK6HAXCTLSFNNO65EXCFSROCKJGXSXQYDVMHJE4DP6TVKFZTWAZMUS4HCJEKKJCURWXUBE76NQOVHHTOMQFJDHXTIKGTK6PEXWDU6XC6UQPYIYW64H2XC7B3BYCM3HO3W3RXAN6ZIXDX2OTBFJDIVERQ645FCEQ" } }, "context": { "Viewports": [ { "type": "APL", "id": "main", "shape": "RECTANGLE", "dpi": 160, "presentationType": "STANDARD", "canRotate": false, "configuration": { "current": { "mode": "HUB", "video": { "codecs": [ "H_264_42", "H_264_41" ] }, "size": { "type": "DISCRETE", "pixelWidth": 1024, "pixelHeight": 600 } } } } ], "Viewport": { "experiences": [ { "arcMinuteWidth": 246, "arcMinuteHeight": 144, "canRotate": false, "canResize": false } ], "mode": "HUB", "shape": "RECTANGLE", "pixelWidth": 1024, "pixelHeight": 600, "dpi": 160, "currentPixelWidth": 1024, "currentPixelHeight": 600, "touch": [ "SINGLE" ], "video": { "codecs": [ "H_264_42", "H_264_41" ] } }, "System": { "application": { "applicationId": "amzn1.ask.skill.c3772f7a-4aa5-407b-8623-6a9dd104f3e8" }, "user": { "userId": "amzn1.ask.account.AGBUSYXGJ54EGUUOFKONBE575WDW7BSX4GQR377DBQRXTHQHYK6HAXCTLSFNNO65EXCFSROCKJGXSXQYDVMHJE4DP6TVKFZTWAZMUS4HCJEKKJCURWXUBE76NQOVHHTOMQFJDHXTIKGTK6PEXWDU6XC6UQPYIYW64H2XC7B3BYCM3HO3W3RXAN6ZIXDX2OTBFJDIVERQ645FCEQ" }, "device": { "deviceId": "amzn1.ask.device.AF7GGCT65FI5TFLY7PLBUF3IMLYRIYMVFU7K4DINYKMRABKMUSCBYFI2E4FGK57GUYANNUC5ZMLMNSMNQ6UFIGJZKA2S5NTMMEUIR23IFYIPYRMZTY35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": "en-US", "timestamp": "2020-08-26T22:49:14Z", "intent": { "name": "DummyIntent", "confirmationStatus": "NONE" } } } }, "invocationResponse": { "body": { "version": "1.0", "response": { "outputSpeech": { "type": "SSML", "ssml": "Something went wrong" }, "reprompt": { "outputSpeech": { "type": "SSML", "ssml": "Something went wrong" } }, "shouldEndSession": false, "type": "_DEFAULT_RESPONSE" } } }, "metrics": { "skillExecutionTimeInMilliseconds": 1908 } } } }

then
```{
    "header": {
        "namespace": "SkillDebugger",
        "name": "CaptureDebuggingInfo",
        "messageId": "903e2b1f-9285-40d6-a407-050ebb11e1c2"
    },
    "payload": {
        "skillId": null,
        "timestamp": "2020-08-26T22:49:16.161Z",
        "dialogRequestId": "fbcc3422-51ff-4aaf-b009-c73da9205f03",
        "skillRequestId": "amzn1.echo-api.request.3daed7bc-dcff-40a3-a971-2a8f8ea2b17b",
        "type": "ConversationsModelPrediction",
        "content": {
            "phrasesToSlots": [],
            "actions": [
                {
                    "type": "API",
                    "output": {
                        "id": "49cd9f67-8262-4c0c-94ee-26147a4890ff",
                        "name": "Lateral Neck Flexion",
                        "bodyArea": "neck",
                        "duration": 120,
                        "exercise": [
                            "Stand with your feet hip-width apart, toes pointing forward or turned slightly outwards, with arms by your sides. Stiffen your abdominal muscles to stabilize your spine, then depress and pull shoulders down and back without arching your low back.",
                            "Slowly draw your right ear toward your right shoulder stopping when you feel the stretch. Be sure to maintain body alignment keeping your shoulders down and back. Hold the stretch for 5-10 seconds.  Slowly return to starting position. Repeat on the left side.  Perform a total of 2-4 repetitions.",
                            "Increase the stretch by brining your hand to the top of your head and gently applying a light pressure with your fingertips.",
                            "To stretch the sternocleidomastoid, after laterally flexing the neck, slowly lift you chin upwards."
                        ],
                        "steps": 4
                    },
                    "name": "getPhysicalExercise",
                    "input": {
                        "bodyArea": "neck"
                    }
                },
                {
                    "type": "RESPONSE",
                    "output": {
                        "speech": {
                            "text": "Are you ready? I found this exercise hopefully can help your neck. Stand with your feet hip-width apart, toes pointing forward or turned slightly outwards, with arms by your sides. Stiffen your abdominal muscles to stabilize your spine, then depress and pull shoulders down and back without arching your low back. Test silenceSlowly draw your right ear toward your right shoulder stopping when you feel the stretch. Be sure to maintain body alignment keeping your shoulders down and back. Hold the stretch for 5-10 seconds. Slowly return to starting position. Repeat on the left side. Perform a total of 2-4 repetitions. Test silenceIncrease the stretch by brining your hand to the top of your head and gently applying a light pressure with your fingertips. Test silenceTo stretch the sternocleidomastoid, after laterally flexing the neck, slowly lift you chin upwards. Test silence",
                            "phrasesToInputParameters": [
                                {
                                    "phrase": "Stand with your feet hip-width apart, toes pointing forward or turned slightly outwards, with arms by your sides. Stiffen your abdominal muscles to stabilize your spine, then depress and pull shoulders down and back without arching your low back.",
                                    "inputParameter": "getPhysicalExerciseResult.exercise[1]",
                                    "index": {
                                        "start": 12,
                                        "end": 51
                                    }
                                },
                                {
                                    "phrase": "Slowly draw your right ear toward your right shoulder stopping when you feel the stretch. Be sure to maintain body alignment keeping your shoulders down and back. Hold the stretch for 5-10 seconds.  Slowly return to starting position. Repeat on the left side.  Perform a total of 2-4 repetitions.",
                                    "inputParameter": "getPhysicalExerciseResult.exercise[1]",
                                    "index": {
                                        "start": 53,
                                        "end": 102
                                    }
                                },
                                {
                                    "phrase": "Increase the stretch by brining your hand to the top of your head and gently applying a light pressure with your fingertips.",
                                    "inputParameter": "getPhysicalExerciseResult.exercise[1]",
                                    "index": {
                                        "start": 104,
                                        "end": 126
                                    }
                                },
                                {
                                    "phrase": "To stretch the sternocleidomastoid, after laterally flexing the neck, slowly lift you chin upwards.",
                                    "inputParameter": "getPhysicalExerciseResult.exercise[1]",
                                    "index": {
                                        "start": 128,
                                        "end": 142
                                    }
                                },
                                {
                                    "phrase": "neck",
                                    "inputParameter": "getPhysicalExerciseResult.bodyArea",
                                    "index": {
                                        "start": 11,
                                        "end": 12
                                    }
                                }
                            ]
                        }
                    },
                    "name": "tb_notifySuccess_getPhysicalExerciseResponse",
                    "input": {
                        "getPhysicalExerciseResult": {
                            "id": "49cd9f67-8262-4c0c-94ee-26147a4890ff",
                            "name": "Lateral Neck Flexion",
                            "bodyArea": "neck",
                            "duration": 120,
                            "exercise": [
                                "Stand with your feet hip-width apart, toes pointing forward or turned slightly outwards, with arms by your sides. Stiffen your abdominal muscles to stabilize your spine, then depress and pull shoulders down and back without arching your low back.",
                                "Slowly draw your right ear toward your right shoulder stopping when you feel the stretch. Be sure to maintain body alignment keeping your shoulders down and back. Hold the stretch for 5-10 seconds.  Slowly return to starting position. Repeat on the left side.  Perform a total of 2-4 repetitions.",
                                "Increase the stretch by brining your hand to the top of your head and gently applying a light pressure with your fingertips.",
                                "To stretch the sternocleidomastoid, after laterally flexing the neck, slowly lift you chin upwards."
                            ],
                            "steps": 4
                        }
                    }
                }
            ]
        }
    }
}```
then 

{ "header": { "namespace": "SkillDebugger", "name": "CaptureDebuggingInfo", "messageId": "a782a4b7-6361-419f-af4a-f77850094dcf" }, "payload": { "skillId": null, "timestamp": "2020-08-26T22:49:16.328Z", "dialogRequestId": "fbcc3422-51ff-4aaf-b009-c73da9205f03", "skillRequestId": null, "type": "ConsideredIntents", "content": { "intents": [ { "name": "DummyIntent", "confirmationStatus": "NONE", "slots": {} } ] } } }```