I m trying to connect Alexa to openAI s API using my APIkey for chat completions and not sure where to write the code for the function in the Alexa Skills Kit. In the Lambda file there are: index.js, local-debugger, package.JSON and utils.js files. Do I create a new .js file in the lambda folder of do I edit the utils or index file? The package.JSON has been edited and tested in the console and it seems to be working internally but i still need to parse the slot and send it in JSON format to Open AI for completion. The function must also "await" and speak out a response. I ve been trying to accomplish this with just a lambda function and have attempted to host the function both by Alexa and Lambda but im starting to wonder if an API POST request would be the proper tool. The main error I m encountering is Async / Await errors
I ve created the Alexa skill and established a wake word and slot named "{query}" under the prebuilt slot type search.query. I ve successfully tested that my wake word is functional within the Alexa framework. I ve installed the Alexa Skills Kit in vs code and created the skill in the VS code terminal via the Alexa Developer Extension. I switched to the AWS GUI to edite the wake word, sample utterances and Slot.I have an open AI API key and was able to get that imported in vs code but not clear on where the API key and chat comnpletion call code for the API call goes.