alexa / ask-toolkit-for-vscode

ASK Toolkit is an extension for Visual Studio Code (VSC) that that makes it easier for developers to develop and deploy Alexa Skills.
https://developer.amazon.com/en-US/docs/alexa/ask-toolkit/get-started-with-the-ask-toolkit-for-visual-studio-code.html
Apache License 2.0
108 stars 52 forks source link

Not everything works #62

Closed lborensky closed 3 years ago

lborensky commented 3 years ago

Desktop (please complete the following information):

Question What works (hosted-skills):

What does not work:

Does the architecture of the extension with Alexa services match the schema provided (similar to the bespoken extension)? Screenshot 2020-11-16 at 22 08 56

view of VSC Screenshot 2020-11-16 at 22 29 07

Where can I find detailed information on the extension and its integration with VSC?

nikhilym commented 3 years ago

Hey @lborensky , thanks for raising the issue. Let me try and answer your questions :

What does not work:

  • download in VSC of APL documents from Console Developer,

There is a current bug in the APL service, that unless a skill build occcurs, new APL documents are not available for download. I am guessing this is what could have happened in your skills' case. To test this out, can you trigger a build on the console after adding new APL templates for the skill, and once the skill build finishes, try to check it in the APL Download web view?


  • undefined response when opening (open change me) in the simulator under VSC,

I tried the same for a recently created hosted skill and could reproduce the issue. However, the error message from the skill service is 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.. Can you try changing the invocation name, rebuild the skill and try again?


  • where are the files commited via git (CodeCommit?)

Alexa-hosted skills store the skill code and metadata on the AWS CodeCommit repository. More information about Alexa hosted skills can be found here.


Does the architecture of the extension with Alexa services match the schema provided (similar to the bespoken extension)?

It is almost correct @lborensky . The only change would be, there is no proxy involved for the simulator in the toolkit. We use the SMAPI simulate API to invoke the skill requests and retrieve the skill responses.


Where can I find detailed information on the extension and its integration with VSC?

The source code for the extension is completely open source and all the functionality is built on SMAPI SDK. Please let us know if you have any further questions.

lborensky commented 3 years ago

Hi Nikhill,

Thank you for yours responses. So I started the simulation with SMAPI and it works. Why is this not the case under the simulator of VSC with the same context? See the code below.

Sorry, but I have other questions or issues.

  1. Is the usage with Alexa Skill ASK Toolkit identical to that of the Bespoken extension?
  2. How to find in CodeCommit after a push in VSC?

Thanks for your help.

$ ask smapi simulate-skill \ --profile Roudourou \ --input-content "open change me" \ --device-locale "en-US" \ --session-mode "FORCE_NEW_SESSION" \ --full-response \ --skill-id "amzn1.ask.skill.cc818647-bf6d-4e94-ae20-59ac9d150284" { "body": { "id": "8522c08c-cfb0-4c67-b180-72435c7b9690", "status": "IN_PROGRESS" }, "headers": [ { "key": "content-type", "value": "application/json" }, { "key": "content-length", "value": "68" }, { "key": "connection", "value": "close" }, { "key": "server", "value": "Server" }, { "key": "date", "value": "Tue, 17 Nov 2020 08:33:36 GMT" }, { "key": "x-amz-rid", "value": "V9J2RY37P566Z7HN931D" }, { "key": "x-amzn-requestid", "value": "42785f0f-c89c-4366-92b2-263932e39d63" }, { "key": "x-amz-date", "value": "Tue, 17 Nov 2020 08:33:36 GMT" }, { "key": "vary", "value": "Content-Type,Accept-Encoding,X-Amzn-CDN-Cache,X-Amzn-AX-Treatment,User-Agent" }, { "key": "x-cache", "value": "Miss from cloudfront" }, { "key": "via", "value": "1.1 ae1b2f64d909bc787f8b2cb1e91446cd.cloudfront.net (CloudFront)" }, { "key": "x-amz-cf-pop", "value": "CDG53-C1" }, { "key": "x-amz-cf-id", "value": "NG3xCM0l9EiAkkvdkvYmYI9D5VUuvVKcYoWc3XM2GZpzkycNEucrEQ==" } ], "statusCode": 200 } $

nikhilym commented 3 years ago

Hey @lborensky , thanks for the update.

So I started the simulation with SMAPI and it works. Why is this not the case under the simulator of VSC with the same context?

As you can see from the skill simulate API response, the skill simulation is in progress, and you will need to get the skill simulation results using this API and the id in the previous API's response. This is what our skill simulator does in the background, and provides the simulation response.

Is the usage with Alexa Skill ASK Toolkit identical to that of the Bespoken extension?

I am not exactly sure on the question here @lborensky . Can you please provide me the documentation for the bespoken extension that you were mentioning? Are you talking about the bespoken proxy tool? If so, that is somewhat similar to our local-debugging functionality, where instead of making the skill invocation calls to your lambda, you are invoking the local skill code. You would need to install the ask-sdk-local-debug library for making these calls, but other than that, it should be a seamless experience through the toolkit plugin. Please check the local-debugging docs for more information.

How to find in CodeCommit after a push in VSC?

For Alexa-hosted skills, the skill code and skill metadata is stored in an AWS CodeCommit repo that is owned by the Alexa-Hosted skills service. You can check the repo information using this API and can get the CodeCommit repo credentials, using this API. However, remember that the credentials are short lived and needs refreshing. The toolkit does this refreshing in the backend, by adding the needed scripts in the git credential helper.

Hope this helps. Please let us know if you have any other questions.

lborensky commented 3 years ago

Hello Nikhill,

Thank you for your responses. I'm progressing in learning the Alexa Skills Kit (ASK) Toolkit extension. Now, I can use the simulator under VSC, but I have a problem with setting breakpoints. When I run the code with the simulator or from the command line ($ ask dialog ...), the code hangs fine on the breakpoint, but the step by step process has this problem "Unable to load source. ../lambda/node_modules/ask-sdk-runtime/lib/dispatcher/request/handler/GenericHandlerAdapter.ts': Unable to retrieve source content ".

For the other extension mentioned (Bespoken), here is the link which details its functions (here)

In addition, tests in API mode (REST http) or CLI to access (eg: $ git clone https: //git-codecommit.us-east-1.amazonaws.com/v1/repos / ....). Is it possible or not to see under the Web interface of the CodeCommit service its repository?

Thank you very much in advance for your help.

nikhilym commented 3 years ago

Hey @lborensky , sorry for responding late.

When I run the code with the simulator or from the command line ($ ask dialog ...), the code hangs fine on the breakpoint, but the step by step process has this problem "Unable to load source. ../lambda/node_modules/ask-sdk-runtime/lib/dispatcher/request/handler/GenericHandlerAdapter.ts': Unable to retrieve source content ".

Ok, just to be clear, you are trying to use local debugging + simulator features of the extension right? As for the error message, that is weird. Can you please check if you have all your dependencies installed and also provide a list of steps you went through, before setting the local debugging up? Also, details about your skill would help :


For the other extension mentioned (Bespoken), here is the link which details its functions (here)

Thanks for the link. I went through that and do not see anything specific to the extension. As I mentioned earlier, you might be referring to the bespoken proxy tool, to route the skill requests to your local machine. The ask-sdk-local-debug package sets that up for you without any additional tools and without changing any endpoints in your skill manifest. Additionally, multiple skill developers can use local debugging on the skill code at the same time, without affecting other sessions or the actual lambda endpoint. Please let us know if you have any questions around that feature. Our vscode developer documentation provides step by step instructions on how you can set one up, for your skill : https://developer.amazon.com/en-US/docs/alexa/ask-toolkit/vs-code-testing-simulator.html#prepare


In addition, tests in API mode (REST http) or CLI to access (eg: $ git clone https: //git-codecommit.us-east-1.amazonaws.com/v1/repos / ....). Is it possible or not to see under the Web interface of the CodeCommit service its repository?

Since Alexa-hosted skills create a code commit repository on behalf of the users, whenever the skill developer creates an Alexa-hosted skill, the service technically owns that repository. You can view the repository from the code tab on the web console and can interact with that directly. There are also links to CloudWatch logs and other resources related to the repository , on that tab, for your convenience. I don't think there is any way for skill developers, to view their Alexa-hosted skills code commit repositories, in their own consoles. Hope this helps.

sattpat commented 3 years ago

Hey @lborensky , I think it would really help if you could walk us through your usecase?

lborensky commented 3 years ago

Hello @nikhilym and @sattpat,

Thanks for your feedback. I came to understand my mistakes. They related to the operating mode under VSC. Now the debug mode in VSC is working perfectly. The skill used is in Alexa-hosted mode and I created it in CLI mode. It conforms to the CLI-v2 file structure. To manage my own repository (under Github) of my skill, I duplicate its tree and reset the context of git. Now everything is clear and working.

Thanks again.

nikhilym commented 3 years ago

Great @lborensky . Glad you got it working. By CLI mode, I guess you were mentioning about hosting skills in lambda? Anyways, we developed the extension and the workflows to be inter-operable with ASK CLI V2. So you should be able to create skills in either tools and use it with the other. If you are facing issues with the compatibility or have other issues, feature requests around the toolkit please let us know by raising an issue.

I am closing this issue as resolved.