[{"data":1,"prerenderedAt":73},["ShallowReactive",2],{"pattern-appsync-ws-lambda-bedrock-sam":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":33,"level":34,"meta":35,"patternArch":36,"resources":56,"s3URL":6,"services":6,"stem":68,"testing":69,"videoId":6,"__hash__":72},"patterns\u002Fpatterns\u002Fappsync-ws-lambda-bedrock-sam.json","AI Chat with AWS AppSync (WebSockets), AWS Lambda, and Amazon Bedrock",null,{"text":8},[9],"\u003Ccode>sam delete\u003C\u002Fcode>",[11],"content\u002Fcontributors\u002Fmike-hume.json",{"text":13},[14],"sam deploy","WebSocket-Enabled AI Chat Using AWS Services.","json","AWS SAM",{"template":19},{"repoURL":20,"templateURL":21,"projectFolder":22,"templateFile":23},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fappsync-ws-lambda-bedrock-sam","serverless-patterns\u002Fappsync-ws-lambda-bedrock-sam","appsync-ws-lambda-bedrock-sam","template.yml",{"headline":25,"text":26},"How it works",[27,28,29,30,31,32],"This AI chat application works through a simple request-response flow.","A client sends a GraphQL mutation to the AWS AppSync API endpoint.","AWS AppSync then routes the request to a AWS Lambda function via the configured data source and resolver.","The AWS Lambda function receives the user's input message, constructs a properly formatted request for Amazon Bedrock's Claude model (including the Anthropic API version, token limit, and user message).","Then sends it to Amazon Bedrock using the AWS SDK, waits for the AI response, and returns the generated text back to AWS AppSync. ","AWS AppSync then delivers this response to the client, while the subscription feature enables real-time notifications to connected clients when new responses are available, creating an interactive chat experience where users can send messages and receive AI-generated replies in real-time.","Node.js","200",{},{"icon1":37,"icon2":42,"icon3":45,"line1":49,"line2":53},{"x":38,"y":39,"service":40,"label":41},20,50,"appsync","AWS AppSync GraphQL API",{"x":39,"y":39,"service":43,"label":44},"lambda","AWS Lambda",{"x":46,"y":39,"service":47,"label":48},85,"bedrock","Amazon Bedrock",{"from":50,"to":51,"label":52},"icon1","icon2","",{"from":51,"to":54,"label":55},"icon3","Invoke Model",{"bullets":57},[58,61,64,66],{"text":59,"link":60},"AWS AppSync","https:\u002F\u002Faws.amazon.com\u002Fappsync\u002F",{"text":62,"link":63},"AWS AppSync WebSocket","https:\u002F\u002Fdocs.aws.amazon.com\u002Fappsync\u002Flatest\u002Fdevguide\u002Faws-appsync-real-time-data.html",{"text":44,"link":65},"https:\u002F\u002Faws.amazon.com\u002Flambda\u002F",{"text":48,"link":67},"https:\u002F\u002Faws.amazon.com\u002Fbedrock\u002F","patterns\u002Fappsync-ws-lambda-bedrock-sam",{"text":70},[71],"See the GitHub repo for detailed testing instructions.","7BTxcW9zP4_JZIF7-YO4yQ9PuF1jl-maNJI6eVO4DSs",1780655738323]