AWS Lambda + Bedrock Tutorial

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

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

  • @lmcgnlztable
    @lmcgnlztable 6 месяцев назад +23

    Thanks for this! Please do make a video about the one using websocket for the streaming data. It could be more practical for real use case.

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

    Here's the code for those who need it:
    import boto3
    import json
    def lambda_handler(event, context):
    bedrock = boto3.client(
    service_name='bedrock-runtime',
    region_name = 'us-east-1'
    )
    input = {
    'modelId':'cohere.command-text-v14',
    'contentType':'application/json',
    'accept':'*/*',
    'body': "{\"prompt\":\"What is AWS? \",\"max_tokens\":400,\"temperature\":0.75,\"p\":0.01,\"k\":0,\"stop_sequences\":[],\"return_likelihoods\":\"NONE\"}"
    }
    response = bedrock.invoke_model(body=input['body'],
    modelId=input["modelId"],
    accept=input["accept"],
    contentType=input["contentType"])
    response_body = json.loads(response['body'].read())
    print(response_body)

  • @channel_panel193
    @channel_panel193 6 месяцев назад +8

    +1 for websockets video !!

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

    Fascinating. Would love to see a websocket demo as well

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

    Yes please make a video with websocket and berock!

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

    Can you use AWS credits for a Claude AI subscription and then use Claude AI with this setup. I recall seeing Anthropic listed which seems to be behind ClaudeAI

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

    Amazing!! 🎉 I believe streaming works with JavaScript

  • @nitinkansal
    @nitinkansal 6 месяцев назад +1

    +1 for websockets video

  • @ssss-u7w
    @ssss-u7w 2 месяца назад

    where is the git code for lambda ?

  • @giacomogaravaglia6742
    @giacomogaravaglia6742 6 месяцев назад +1

    +1 for websocket, eventually plain websocket with lambda, not strictly scoped to bedrock

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

      Thanks for the feedback! Here's a plan websocket one I made a while ago using Lambda + API Gateway

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

      @@BeABetterDev yeah, sorry, I figured out after the comment. Thanks anyway

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

    you are badass

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

    love it! So juicy!

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

    hey where is the code :)

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

    Nice

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

    is it only me or code is not in video description?

  • @AhumadaMauricio
    @AhumadaMauricio 6 месяцев назад +3

    I also would love to the the websocket implementation

  • @nocomments_s
    @nocomments_s 16 дней назад

    Amazing video!
    I would like to see the video about web sockets

  • @channel_panel193
    @channel_panel193 6 месяцев назад +1

    great video! Thanks for doing this. After watching and experimenting on my own, what really worries me is the fact that such a simple setup is so slow. 10 - 20 seconds for an answer is a dealbreaker on so many applications. Imagine a chatbot where the user needs to wait a half a minute to get a response if they type "hi". Why is Bedroc so painfully slow? How can anyone sanefully envision building an app with Bedrock given this latency?

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

    How this work if you have your lambda private subnets?

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

    thanks for posting this. Could you add the python code in the description notes?

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

    How can I give it context, with information from a text that I previously extracted with texttract? pls.

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

    yes go ahead and make the video on websockets, you dont need our permission to do so. Permission-less mentality.

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

    Please make a websocket + bedrock, that would be awesome!

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

    how can we speed up the response time? has anyone tried using different models to see what is fastest? i guess prompt engineering can also reduce latency.

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

      Try moving the connection string outside the handler