[{"data":1,"prerenderedAt":64},["ShallowReactive",2],{"pattern-apigw-websocket-api-bedrock-streaming":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":10,"deploy":12,"description":15,"extension":16,"framework":17,"gitHub":18,"highlight":6,"introBox":24,"language":30,"level":31,"meta":32,"patternArch":33,"resources":52,"s3URL":6,"services":6,"stem":59,"testing":60,"videoId":6,"__hash__":63},"patterns\u002Fpatterns\u002Fapigw-websocket-api-bedrock-streaming.json","WebSocket API to AWS Lambda to Amazon Bedrock with streaming response",null,{"text":8},[9],"Delete the stack: \u003Ccode>sam delete --stack-name STACK_NAME\u003C\u002Fcode>.",[11],"content\u002Fcontributors\u002Fwindrich.json",{"text":13},[14],"sam deploy","Creates an API Gateway WebSocketand Lambda functions that provides a streaming response from the LLMs in Amazon Bedrock.","json","AWS SAM",{"template":19},{"repoURL":20,"templateURL":21,"projectFolder":22,"templateFile":23},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fapigw-websocket-api-bedrock-streaming","serverless-patterns\u002Fapigw-websocket-api-bedrock-streaming","apigw-websocket-api-bedrock-streaming","template.yaml",{"headline":25,"text":26},"How it works",[27,28,29],"This sample project demonstrates how to use WebSocket API as a front door to Lambda functions that perform inference on Amazon Bedrock LLMs using the [InvokeModelWithResponseStream API, where the LLM responses are returned in a stream.","With WebSocket API, developers of interactive LLM chatbot interfaces can provide a better user experience by displaying the LLM responses as they are generated (which at times can be long, rather than relying on the synchronous InvokeModel API request.","This pattern deploys one API Gateway WebSocket API, four Lambda functions, and one DynamoDB table.","Python","200",{},{"icon1":34,"icon2":39,"icon3":43,"line1":47,"line2":50},{"x":35,"y":36,"service":37,"label":38},20,40,"apigw","API Gateway WebSocket API",{"x":40,"y":36,"service":41,"label":42},50,"lambda","AWS Lambda",{"x":44,"y":36,"service":45,"label":46},80,"bedrock","Amazon Bedrock",{"from":48,"to":49},"icon2","icon3",{"from":51,"to":48},"icon1",{"bullets":53},[54,57],{"text":55,"link":56},"Working with WebSocket APIs","https:\u002F\u002Fdocs.aws.amazon.com\u002Fapigateway\u002Flatest\u002Fdeveloperguide\u002Fapigateway-websocket-api.html",{"text":46,"link":58},"https:\u002F\u002Faws.amazon.com\u002Fbedrock\u002F","patterns\u002Fapigw-websocket-api-bedrock-streaming",{"text":61},[62],"See the GitHub repo for detailed testing instructions.","xbik0ULXdHCsaisDC97s4Gbgjc-aAd0TQN8WdaZ6Lc0",1780655737958]