How to Build a Chatbot Using Amazon Lex, Lambda and the Python Requests Library

Sdílet
Vložit
  • čas přidán 5. 09. 2024
  • In this video, I show you you how to create a serverless chatbot using Lex Lambda and the Python requests libraru.
    We will build a conversational experience.
    Just like Siri, Google and Alexa can tell you joke or tell you a random fact, our bot will be able to do the same
    What is Lex
    Amazon Lex is a service for building conversational interfaces into any application using voice and text. Amazon Lex provides the advanced deep learning functionalities of automatic speech recognition (ASR) for converting speech to text, and natural language understanding (NLU) to recognize the intent of the text, to enable you to build applications with highly engaging user experiences and lifelike conversational interactions.
    Documentation Link
    docs.aws.amazo...
    What is Lambda
    AWS Lambda is a serverless compute service that lets you run code without provisioning or managing servers. (FaaS)
    Documentation Link
    docs.aws.amazo...
    What is Python
    Python is an interpreted high-level general-purpose programming language. Python's design philosophy emphasizes code readability with its notable use of significant indentation.
    en.wikipedia.o...)
    Lex is regional service. For details about regions supported, API endpoints etc. see the
    Lex Reference Guide
    docs.aws.amazo...
    How to Give Lambda function access to the internet
    aws.amazon.com...
    How to create Lambda Layers
    docs.aws.amazo...
    Do you think it is a good idea to store URLs inside your Lambda functions? Consider using
    Environment Variable
    Secrets Manager
    Systems Manager Parameter Store
    Do you think it is a good idea to use a single Lambda function for everything? Split the jokes and factoid functions into separate Lambda functions.
    Why would I now want to import the entire requests library? Only use the get function instead of doing a blanket import to save on cost.
    Can you integrate a LOB system API call into your Lambda function? For example, design a bot that can give the user a status of their case. The bot asks the user for a case number (slot) and sends the information to Lambda and Lambda makes an API call to CRM system (Dynamics or Salesforce) and gets the case status
    Git Repo for code
    github.com/fak...
    Creating and using Lambda Layers
    docs.aws.amazo...

Komentáře • 39

  • @androidsoham
    @androidsoham Před rokem

    Terrific explanation on the Lex response and how to parse it and send a response back. Wow!

  • @hemanthkumarreddybapuram2346

    Thanks a lot sir. I have learnt many things. Hoping for some more like these in python. Thanks

  • @evanl5299
    @evanl5299 Před 2 lety

    Excellent. Thank you Faisal - you rule.

  • @alexsoul247
    @alexsoul247 Před 2 lety

    This is absolutely awesome. I am going to do it right now. Would be great to see followup video on how to actually deploy this in production, for example on website or integrate with existing system, etc. - just to get a feel about real user experience

    • @FaisalAkhtar
      @FaisalAkhtar  Před 2 lety +1

      Try these 4 video part series. I go into a little more details

    • @FaisalAkhtar
      @FaisalAkhtar  Před 2 lety +1

      czcams.com/video/KGPdETbxbFw/video.html

  • @lexhewitt1644
    @lexhewitt1644 Před 2 lety

    Great!!! Tutorial, has given me some insight, Thanks

  • @senorviglione4925
    @senorviglione4925 Před rokem +1

    This video is great! I am building a bot with Lex V2 and am trying to refactor the Lambda code from V1 (this video). I've checked the documentation and can't seem find out how to make it work. Would anyone perhaps have a copy of the updated Lambda code for Lex V2? Thanks!

  • @gdemelo
    @gdemelo Před 2 lety

    Dude... You rock!

  • @fransipin1
    @fransipin1 Před 2 lety

    Good one ...

  • @andyjulialee
    @andyjulialee Před 2 lety +1

    Hi Faisal, your video is great, but it is in v1. Now I can't use v1 at all, so the tutorial is not working for me. I don't know why AWS made it harder in new version. I even can't find how to easily add Lambda function to bot.

  • @irynasorokovska4621
    @irynasorokovska4621 Před 2 lety

    Great video! Thanks a lot

  • @gokulkrishnan.s6911
    @gokulkrishnan.s6911 Před 2 lety

    If I am using this inside an Amazon Connect Contact flow, How can I call and set the response Content inside the Set Contact Attribute block?

  • @karimfayed3050
    @karimfayed3050 Před 2 lety

    Great Video! Can you help me understand what is the difference between the intent fulfillment states(Fulfilled, InProgress and ReadyForFulfillment) ? and in which case each is used?

    • @FaisalAkhtar
      @FaisalAkhtar  Před 2 lety +1

      docs.aws.amazon.com/lex/latest/dg/API_runtime_DialogAction.html

  • @bhootpurvmanusya
    @bhootpurvmanusya Před 2 lety

    hey can we use bot in amazon chime for private message or is it we have to use bot in room (in case of amazon chime)

  • @automatewithrezwan
    @automatewithrezwan Před 2 lety

    I want to call external api and provide the value as response, can you provide any documentation on that topic?

    • @FaisalAkhtar
      @FaisalAkhtar  Před 2 lety +1

      If you look at the code in the Git Repo, I am using the get method from the requests library to make a call to an external API. The API endpoint and response are handled in the Lambda.

    • @automatewithrezwan
      @automatewithrezwan Před 2 lety

      @@FaisalAkhtar ohh sorry I hadn;t checked the rep yet. Thanks for the quick response

  • @interactservicesllc20
    @interactservicesllc20 Před 2 lety

    how do I change intent using lambda?

  • @EzraSchroeder
    @EzraSchroeder Před 2 lety

    skipped the first 8 minutes of fluff... watched to 13:21 when he said we aren't going to do lambda functions... what is the point & how could you spend an hour on this?

    • @FaisalAkhtar
      @FaisalAkhtar  Před 2 lety

      27:00

    • @EzraSchroeder
      @EzraSchroeder Před 2 lety

      @@FaisalAkhtar okay i'll delete my comment

    • @EzraSchroeder
      @EzraSchroeder Před 2 lety

      just frustrated at the moment, its me not you

    • @FaisalAkhtar
      @FaisalAkhtar  Před 2 lety

      @@EzraSchroeder don't worry about it 🙂

    • @EzraSchroeder
      @EzraSchroeder Před 2 lety

      @@FaisalAkhtar i wound up referring to this while completing a programming assignment for a masters degree... thanks for your understanding & sorry for being mister poopy pants

  • @meetdabhi6949
    @meetdabhi6949 Před 3 lety

    Facing an error
    Invalid Lambda Response: Received error response from Lambda: Unhandled
    Please help

    • @saswatdas6137
      @saswatdas6137 Před 3 lety +2

      Ensure you are using v1.
      V2 response format is different

    • @FaisalAkhtar
      @FaisalAkhtar  Před 3 lety

      Check out my code and see if matches yours Feel free to use it to troubleshoot
      github.com/fakhtar/JokesandFactsLexVideo

    • @WarriorAjk
      @WarriorAjk Před 3 lety

      @@FaisalAkhtar AoA sir, I tried to troubleshoot, but I am receiving the same problem.

    • @FaisalAkhtar
      @FaisalAkhtar  Před 3 lety

      @@WarriorAjk Are you using Lex V1 or V2? My vide is in V1. Also, you can simply copy and paste my code into your Lambda. Have you tried doing that? If you still have the problem, post your Lambda code into a git repo and I will see what's wrong with it.

  • @gausshaikh2525
    @gausshaikh2525 Před 3 lety

    How to contact you sir?

    • @FaisalAkhtar
      @FaisalAkhtar  Před 3 lety

      I have added a business inquiries email in the about tab in my channel.

    • @gausshaikh2525
      @gausshaikh2525 Před 3 lety

      @@FaisalAkhtar sorry sir I didn't find it. Please give me your whats app number or email id.

    • @FaisalAkhtar
      @FaisalAkhtar  Před 3 lety

      @@gausshaikh2525 find me on LinkedIn

  • @WarriorAjk
    @WarriorAjk Před 3 lety

    27:00