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

Поделиться
HTML-код
  • Опубликовано: 11 окт 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...

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

  • @androidsoham
    @androidsoham Год назад

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

  • @hemanthkumarreddybapuram2346
    @hemanthkumarreddybapuram2346 2 года назад +2

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

  • @alexsoul247
    @alexsoul247 2 года назад

    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  2 года назад +1

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

    • @FaisalAkhtar
      @FaisalAkhtar  2 года назад +1

      ruclips.net/video/KGPdETbxbFw/видео.html

  • @senorviglione4925
    @senorviglione4925 2 года назад +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!

  • @andyjulialee
    @andyjulialee 2 года назад +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.

  • @evanl5299
    @evanl5299 2 года назад

    Excellent. Thank you Faisal - you rule.

  • @lexhewitt1644
    @lexhewitt1644 2 года назад

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

  • @gokulkrishnan.s6911
    @gokulkrishnan.s6911 2 года назад

    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?

  • @bhootpurvmanusya
    @bhootpurvmanusya 2 года назад

    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)

  • @gdemelo
    @gdemelo 2 года назад

    Dude... You rock!

  • @karimfayed3050
    @karimfayed3050 2 года назад

    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  2 года назад +1

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

  • @fransipin1
    @fransipin1 2 года назад

    Good one ...

  • @irynasorokovska4621
    @irynasorokovska4621 2 года назад

    Great video! Thanks a lot

  • @automatewithrezwan
    @automatewithrezwan 3 года назад

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

    • @FaisalAkhtar
      @FaisalAkhtar  3 года назад +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 3 года назад

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

  • @interactservicesllc20
    @interactservicesllc20 2 года назад

    how do I change intent using lambda?

  • @EzraSchroeder
    @EzraSchroeder 2 года назад

    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  2 года назад

      27:00

    • @EzraSchroeder
      @EzraSchroeder 2 года назад

      @@FaisalAkhtar okay i'll delete my comment

    • @EzraSchroeder
      @EzraSchroeder 2 года назад

      just frustrated at the moment, its me not you

    • @FaisalAkhtar
      @FaisalAkhtar  2 года назад

      @@EzraSchroeder don't worry about it 🙂

    • @EzraSchroeder
      @EzraSchroeder 2 года назад

      @@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 3 года назад

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

    • @saswatdas6137
      @saswatdas6137 3 года назад +2

      Ensure you are using v1.
      V2 response format is different

    • @FaisalAkhtar
      @FaisalAkhtar  3 года назад

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

    • @WarriorAjk
      @WarriorAjk 3 года назад

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

    • @FaisalAkhtar
      @FaisalAkhtar  3 года назад

      @@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 3 года назад

    How to contact you sir?

    • @FaisalAkhtar
      @FaisalAkhtar  3 года назад

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

    • @gausshaikh2525
      @gausshaikh2525 3 года назад

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

    • @FaisalAkhtar
      @FaisalAkhtar  3 года назад

      @@gausshaikh2525 find me on LinkedIn

  • @WarriorAjk
    @WarriorAjk 3 года назад

    27:00