Custom Alexa Skill - Chat GPT Integration

Поделиться
HTML-код
  • Опубликовано: 30 ноя 2024

Комментарии • 67

  • @randyrafaelcg
    @randyrafaelcg 6 месяцев назад +11

    OMG! This video was a game-changer for me! After what felt like an eternity of fruitless research, this 20-minute gem came as a revelation. It’s incredible how it condensed what would’ve been days of research into a brief and engaging tutorial. A million thanks for sharing this knowledge with such clarity and impact! You’ve earned a devoted subscriber! 🚀❤

  • @danieljuno810
    @danieljuno810 18 часов назад

    I’m guessing error log area is based on Amazon HQ location. Great tutorial and tips!

  • @kitoseo4408
    @kitoseo4408 5 месяцев назад +3

    I can't believe it worked for real. Thank you so much for your amazing job!

  • @xpectz
    @xpectz 2 месяца назад +1

    As someone pointed out, querying with Open AI returns a "Hello world" response. Do you have to pay to use an API key now? I heard something in that sense with another OpenAI project for the raspberry pi. Confirmed: for those wondering why you get a hello world response it's been you need to pay for the API. I just put $10.

  • @brinohm
    @brinohm 6 месяцев назад +2

    I just wanted to say thank you for this, it worked great! I've been trying to find a tutorial like this for a bit and this was perfect. I've been able to itterate on what you've done and make some fun tweaks. It provided a perfect foundation and I'm very appreciative!

    • @techwithdavidolding
      @techwithdavidolding  6 месяцев назад +2

      Awesome.
      This video took me forever to research and actually create.
      I'm glad to hear that effort paid off and the video was super useful for you 😄

  • @jkye_314
    @jkye_314 13 дней назад

    Prompt id "" for slot "catchAll" is not present in prompts, but is referenced in the dialog model for intent "HelloWorldIntent". ... got this error in handleuser input 😥

  • @GabrielLabrecque
    @GabrielLabrecque 3 месяца назад

    Your video was a great help! Thank you so much! I'm so hyped with this! Can't wait to integrate it with all of my apps!

  • @RaffaelN
    @RaffaelN 2 месяца назад +1

    Thank you so much for the demo.
    I copied everything from your GitHub and put on my ChatGPT API key and also tried the newer version of "model":"gpt-4", "model":"gpt-4o", and "model":"gpt-4o-mini", when I test my Skill by asking the infamous question "What is the meaning of life?" I get a return of "Hello World!", what exactly is the issue? appreciate it if you could make new video or update your GitHub. Thank you

    • @xpectz
      @xpectz 2 месяца назад

      Figured it out. You have to have credit with OpenAI to use the API key.

  • @user-wm7ht6ln1t
    @user-wm7ht6ln1t 3 месяца назад +1

    When he asked the first question everything was fine, but if I asked him another question he asked me again to say hello. How can I stop him from asking me "hello" again and continue the conversation with the chat?

    • @techwithdavidolding
      @techwithdavidolding  3 месяца назад

      Unfortunately you can't.
      What you described is exactly what I wanted to do to have a back and forth conversation. I wasn't able to find a way to make it work, I don't think it's technically possible with how Amazon have set up custom skills.

  • @lurioussilveirous9409
    @lurioussilveirous9409 2 месяца назад

    got the issue with SessionEndedRequestHandler at the end of the code. When i run it says "
    "reason": "ERROR",
    "error": {
    "type": "INVALID_RESPONSE","
    Watch could be the issue? Thanks in advance

    • @techwithdavidolding
      @techwithdavidolding  2 месяца назад

      Hard to say without some more info.
      Take a look at the Logs & Troubleshooting section of this video.
      That shows you how to dive into cloudwatch to get more detailed logs.

  • @iRiccardoArpino
    @iRiccardoArpino 5 месяцев назад +1

    Amazing tutorial, I'm looking to build this skill to use as a "fridge tracker", where I have an LLM memorizing, tracking and reminding me of what expiry dates all my food have so that I can consume them in order of expiry (I'd feed all this data via text) but as I enabled custom GPT instructions, I would want to be able to interact with a specific conversation that's already started on GPT. Do you think that would be possible or every time I send an API request to OpenAI it just starts a new conversation? The main goal here is basing my use on persistent memory retention which has been improving a lot on GPT 4o (oh also, does 4o work with this method)? Thanks in advance if and when you have the chance to reply, and keep up the amazing work! Earned a sub from Rome, Italy

    • @techwithdavidolding
      @techwithdavidolding  5 месяцев назад

      That's an awesome idea 😀
      Right now, every API request to open ai is a new conversation.
      You can get around this by storing your chat history in a local database, then appending all previous chat messages within your new requests sent to open ai. This will allow it to have context of your previous chat history within your new requests. You may want to cap the amount of chat history you send through to your previous 10-20 messages as sending everything through will use more tokens than necessary.
      In their presentation last month, they did announce a new feature of being able to remember contextual chat history. I haven't seen this implemented in the api yet but its most likely coming very soon if not already.
      Have you thought about integrating vision as well?
      While you could speak each expiry date to the ai, you may be able to install a camera and have it automatically detect most of the expiry dates for you.
      Appreciate the sub :)

  • @jayjayasuriyainfo
    @jayjayasuriyainfo 6 дней назад

    This is so awesome. I'm getting a prompt on Alexa saying "There is a problem connecting to AI" Any ideas where I messed up???? lol

    • @techwithdavidolding
      @techwithdavidolding  4 дня назад

      I'm not sure, I've never come across that error message before.
      It doesn't even sound like a typical chat gpt response error.
      I'd recommend:
      - check your api key is correct
      - check you have credits in your openai account
      - take a look at the troubleshooting portion of this video and dive into your lambda function/cloudwatch logs to see if there are any more detailed errors
      - make the api call directly in a tool like postman to ensure your api key and account are working correctly

  • @andreatrono6600
    @andreatrono6600 9 дней назад

    Hi, thanks for the video. I follow all your instructions but i used mistrai ai service, so different link and one more header in the http post request. However after a while, apparently at random it broke and when i say hello to call the modified handler i see in the log the error "can't find skill bundle metadata for skillid error alexa skill error". Help me please

    • @techwithdavidolding
      @techwithdavidolding  4 дня назад

      Hmm that's going to be a hard one to debug, especially if you had it working and without any changes on your end it broke.
      I've noticed many weird quirks within the Alexa developer console, I wouldn't be too surprised if something on Amazon's side had a bug/broke your working skill.
      I'd suggest setting up a brand new skill from scratch, with new invocation names and skill names, copy + paste your code and try again.
      That will at least rule out and weird backend issues from Amazon's side.

  • @mkhotels8714
    @mkhotels8714 4 месяца назад

    Works great, but I have issues to set it up using an assistant - how would i need to change the Index ?

    • @techwithdavidolding
      @techwithdavidolding  3 месяца назад +1

      If by assistant you mean having an interactive back and forth real time conversation - unfortunately its not possible to do using Alexa with custom skills.
      This is something I actually want to explore in the future - but it will most likely have to be a custom made solution.

  • @tamboleo
    @tamboleo Месяц назад

    Hey I got it working however after making some changes and re-building it i get:
    There was a problem with the requested skill's response
    I even tried to create my own intent with very basic stuff inside and it goes to the intent however it just keeps saying There was a problem with the requested skill's response any idea?

    • @techwithdavidolding
      @techwithdavidolding  Месяц назад

      Hmm...I'd say start with looking at the logging section of this video.
      Take a look at your lambda/cloudwatch logs in the AWS console, that should tell you exactly why the skill is erroring out.
      More than likely something unexpected is happening in the lambda function's response that is getting sent back to your skill.

  • @LuisJavierStudio
    @LuisJavierStudio 3 месяца назад

    is does not work for me is saying "I can't find the song cuckoo repeater on Spotify." but not returning app helloworld

    • @techwithdavidolding
      @techwithdavidolding  3 месяца назад

      What was the skill invocation name you set... is it anything similar to cuckoo repeater?
      And have you deployed the skill to your region (from memory this was towards the end of the tutorial)?
      I found a few times when it wasn't picking up the skill name it was b/c I hadn't taken that extra step to deploy it to my region/language --> default was English(US) but I then had to update it to Australia to access it within my country.

  • @LaganYtPr
    @LaganYtPr 4 месяца назад +1

    Bro love you, subscribed❤

  • @thecoolkids6491
    @thecoolkids6491 3 дня назад

    Where do I find my api

  • @GabrielLabrecque
    @GabrielLabrecque 3 месяца назад +2

    Thanks

  • @micmey78
    @micmey78 7 месяцев назад +1

    Thanks for sharing your great approach.
    I rebuild exactly your coding, yesterday it works with 3.5-turbo / not with a 4.0 model, but today I am getting a "Task timed out after 8.01 seconds" error message in the alexa cloudwatch log with both models (3.5 turbo and also chatgpt 4.0) . You you have any idea why this happend, does your routine still works, is there a way to increase the timeout ? (Would be fine If you can do a video how to debug such a problem with the possiblilities of the alexa developer console. ;)
    In the protocol I also find following:
    "reason": "ERROR",
    "error": {
    "type": "INVALID_RESPONSE",
    "message": "An exception occurred while dispatching the request to the skill."

    • @techwithdavidolding
      @techwithdavidolding  7 месяцев назад

      Hey 👋
      Yep the code works with the 4.0 model as well.
      The issue is chat gpt 4.0 takes significantly longer to respond than the 3.5-turbo model and Alexa custom skills seem to have a default time out window of 8-10 seconds which can't be changed.
      Don't think I can do a video reply on RUclips - but here's a quick tiktok video explaining it in more depth and a potential solution you could try - www.tiktok.com/@techwithdavid/video/7359709140685491464?is_from_webapp=1&sender_device=pc&web_id=7281060721835001346

    • @micmey78
      @micmey78 7 месяцев назад

      ​@@techwithdavidolding Thanks, for your answer and the link to the video. ;)
      What do you think Is there a chance to keep alexa busy in a loop (maybe with some response like "please wait..") for the time a chat-gpt response need so that this 8 seconds timeout will not be triggered.

  • @lucatore6168
    @lucatore6168 5 месяцев назад

    I'm stuck, in the index.js 12:52 in the
    speakOutput = JSON.parse(response.getBody('utf8'));
    speakOutput = speakOutput.choices[0].message.content;
    I get a meesage that says 'speakOutput' is constant.
    Can you help me out please!

    • @JoeyCatoPlus
      @JoeyCatoPlus 5 месяцев назад

      Change "const speakOutput" to "var speakOutput"

  • @TheDnnfilms
    @TheDnnfilms 5 месяцев назад

    Hello, I'm so new to this like a child building a rocket. First I'm in Germany, so I don't know where to change the language of the skill when I hit test into English. Next: I saw this error message in the code : Generic error handling to capture any syntax or routing errors. If you receive an error
    * stating the request handler chain is not found, you have not implemented a handler for
    * the intent being invoked or included it in the skill builder below

    • @techwithdavidolding
      @techwithdavidolding  5 месяцев назад +1

      Hey 👋
      Welcome, it's a lot to get your head around... and it's also poorly documented by Amazon which doesn't help.
      You can keep the language as the default -- I only mentioned changing of the language as you will have to deploy it to your local region/language in order to test it on a physical echo device that you have.
      Sounds like it can't find the correct handler within your codebase to execute against.
      Step 1 - Go to build --> Intents --> Verify your hello world intent is setup correctly.
      Step 2 - Check your codebase has these sections which is most likely what its looking for. github.com/storyofdavid/tutorials-and-demos/blob/main/youtube/022-custom-alexa-skill-ai/index.js#L15-L81
      If all else fails .. create another hello world skill from scratch using their examples and copy + paste the sections of code you want in which make the api request, then go and update your invocations/utterances.

  • @Senshi56
    @Senshi56 7 месяцев назад

    I got some trouble when trying to follow your tutorial, I have api key, same index.js but when i ask something it respond 'Hello World!' exactly like the line 37 in index.js, any idea please ? Does we need to pay to not have the usage token limitation ?

    • @techwithdavidolding
      @techwithdavidolding  7 месяцев назад +1

      If it's responding with 'hello world' it sounds to me like the api call is failing.
      As we set 'speakOutput' to = hello world and then replace it with the value from within the api call block.
      Make sure the api key is in your config.js file and that you've hit save + deploy to pick up the latest changes.
      Yes Chat GPT is a paid service, you will need to add credits to your account (I think they offer 3 months free via the billing page for new accounts).
      If you don't have credits in your openai account the api call will fail.
      If you take a look at the logs & troubleshooting section of this video that will show you where you can view the execution logs.
      That will have details in it of why your api call is failing.

    • @ShadowreignGaming
      @ShadowreignGaming 3 месяца назад

      I had the same issue. When comparing the differences, I noticed SpeakOutput was a const instead of a var, so try changing that.

  • @jatinchawla1680
    @jatinchawla1680 5 месяцев назад

    So im using gemini api as it is free, when i add const= require(sync-request), the code saves but when i test it out, it says there was a problem with requested skill response

    • @techwithdavidolding
      @techwithdavidolding  5 месяцев назад +1

      I used const request = require('sync-request');
      Make sure to add the sync-requests library in your package.json file like this --> github.com/storyofdavid/tutorials-and-demos/blob/main/youtube/022-custom-alexa-skill-ai/package.json
      If you take a look towards the end of this tutorial I show you how to debug and troubleshoot the application.
      Add a few debug lines in and check the messages/errors getting sent to AWS cloudwatch -- that will give you more info on what exactly is going wrong and how to fix it.

  • @AlperAYKUT
    @AlperAYKUT 2 месяца назад

    What kind of change do I need to make in the skill to make Alexa speak Turkish?

    • @techwithdavidolding
      @techwithdavidolding  2 месяца назад

      It doesn't look like Turkish is supported.
      To change the language you can go into your skill --> from the build tab click on Language --> change language

  • @TheTubebreaker
    @TheTubebreaker 5 месяцев назад

    Hey can you explain how to start the skill and ask a question directly afterwards without saying hello (or smth else) in between? I wont get it to work...

    • @techwithdavidolding
      @techwithdavidolding  5 месяцев назад

      I couldn't figure out how to do that either, it's something I would have liked to do.
      I don't think it's possible. It seems you need to say "alexa start skill" ... but once it's started the skill you can't just start talking.. you need to say "start invocation name" then start talking.

  • @_RY9
    @_RY9 Месяц назад

    After alexa says “what do you want?” If i type anything she will respond answering my question, And when i try to type anything after that, she responds with “Sorry, I don’t know about that. Please try again.” and she keep saying that until i type "hello" and she say “what do you want?” then i can ask, tim stuck with hello everytime i need to ask something, And i can confirm that the api is saved and deployed correctly in config.js
    And I rebuild also.
    I even checked the api usage from openai and there are some requests happen + i charged my account with 10$.

    • @techwithdavidolding
      @techwithdavidolding  Месяц назад +1

      It's the way the Alexa system is designed.
      It was built well before ai took off and doesn't really cater for follow up questions or back and forth conversations.
      You say the invocation command -start my app followed by "hello" to get into the correct route/section of code -> alexa asks what you want --> you get a chance to ask the question --> alexa responds.
      There is no mechanism to ask follow up questions or keep the conversation going.
      You may be able to look into "re-prompts" or possibly having a counter in your code which keeps the connection open.
      But I wasn't able to find a nice way to to get it to work.
      Amazon made an announcement earlier this year stating they're going to release a new version which has ai/claude integrated so hopefully this will become a possibility in the future.

    • @_RY9
      @_RY9 Месяц назад

      @@techwithdavidolding wow thank you so much brother for that information, btw i created an alternative solution where alexa store every response in one string and pass it to GPT with “history of conversation, to act like a live chat.

  • @ggowz
    @ggowz 8 месяцев назад +3

    I'm watching 6 hours later with 11 views hahahaha

  • @nelassma
    @nelassma 3 месяца назад

    Mine is not connecting to the api key idk why

    • @techwithdavidolding
      @techwithdavidolding  3 месяца назад

      Make sure you've hit save + deploy after adding in your api key to the codebase - otherwise it may not be picking it up correctly.
      You could also try regenerating the api key.
      As well as making an api call directly from postman using your api key -- this may return an error message of some kind which might help you troubleshoot further

  • @lagansardana
    @lagansardana 4 месяца назад

    Will that be unlimited access to chatgpt??

    • @techwithdavidolding
      @techwithdavidolding  4 месяца назад

      Not quite - chat gpt is a paid service.
      When you sign up for an account they'll give you a bunch of credit, after that you have to pay.
      For reference I've used their api within my personal mobile apps, and this project.
      I've made hundreds and hundreds of api calls and have spent about 20cent USD.

  • @rajata2819
    @rajata2819 6 месяцев назад

    how to get chatgpt api didn't mention ?

    • @neotasticgamerfun4271
      @neotasticgamerfun4271 5 месяцев назад

      Chat Gpt: "As of my last update in June 2023, OpenAI has not provided free API keys for general access to GPT-4 or GPT-3.5. Access to these models via the OpenAI API typically requires a paid subscription or usage-based billing."

    • @neotasticgamerfun4271
      @neotasticgamerfun4271 5 месяцев назад +1

      bummer

    • @techwithdavidolding
      @techwithdavidolding  5 месяцев назад

      Hey 👋
      you can login to their console --> click api access keys and get your key.
      Like others have said it is a paid service -- however they give you free credits when you first sign up (or at least they did when I did this a while back)
      If you want a full in depth step by step guide I walk you through it in this previous video: ruclips.net/video/VediAuy9qRk/видео.htmlsi=p3aatiD6osC3DmAJ&t=41

  • @falconwing9081
    @falconwing9081 7 месяцев назад

    When ever I put the input from "what do you want" she just says there was an error and she is sorry

    • @techwithdavidolding
      @techwithdavidolding  7 месяцев назад

      What is the exact message returned?
      If it's "Sorry, I don't know about that. Please try again." that means your code is routing to the fallbackIntent.
      It can't understand what to do with the user input. You'll have to go to Build --> Interaction Model and confirm your HelloWorld intent is setup correctly.
      If it's Sorry, I had trouble doing what you asked. Please try again" that means it's exiting via the ErrorHandler and isn't able to do what's requested for some reason.
      If that's the case I would say make sure you've added in your api key in the config.js file and also check out the troubleshooting portion of this video -- that shows you how to access the aws cloudwatch logs which will show the cause of the error you're seeing.

  • @micmey78
    @micmey78 7 месяцев назад

    @revolutvoice: I don't know what this comment helps me... I want to learn how to implement my own "non-commercial" skill. If you can contribute to the timeout problem do it please... ;)

  • @faiz8830
    @faiz8830 5 месяцев назад +6

    I hate coding