Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Get Started with OutSystems and Amazon Bedrock

Sign upSign InSign upSign InStefan WeberFollowITNEXT--ListenShareIn this guide, we will explore the essential steps it takes to build your first or next Generative AI application with Amazon Bedrock in OutSystems. Specifically, you will learn how to set up Amazon Bedrock and your OutSystems application to utilize one or more Foundational Models for Text-to-Text and Text-to-Image generation.Amazon Bedrock is a fully AWS managed service that gives you unified access to a selection of foundation models (FMs) from leading AI companies. By the time of writing Bedrock features models from AI21 Labs, Anthropic, Cohere, Stability AI, and Amazon and you can expect more models to be added over time.aws.amazon.comAmazon Bedrock provides lots of additional and easy to use features. The possibility of privately customizing (fine-tune) any foundation model with your own data without writing a single line of code is just one example. Find out more about Amazon Bedrock features, foundation models and use-cases by clicking on the link above.Note that at the time of writing not all additional features are yet available.Before we delve into the technical aspects, there are some preliminary tasks that need to be addressed.Download and install my AWS Bedrock Runtime Integration component from OutSystems Forge.www.outsystems.comMake sure that you also download the attached Demo application, which we will use to walk through the technical implementation of the Integration component.To interact with an Amazon Bedrock Foundation Model we need an IAM user account with permission to invoke model APIs.This grants permission to invoke any Foundation Model in any region. In a production environment you may want to further restrict this to only specific models and regions.Before you can use a Foundation Model of Amazon Bedrock you need to explicitly request access to a model.By the time of writing Amazon Bedrock is only available in the following regions: US West Oregan (us-west-2), Asia Pacific Singapore (ap-southeast-1), US East N. Virginia (us-east-1), US East Ohio (us-east-2). Select the region that is closest to your OutSystems environment.To try out all examples from the demo application you need to request access to the following modelsNote that it can take up to 24 hours until access to a specific model is granted.Make sure that you have downloaded the Demo application that is attached to the AWS Bedrock Runtime Forge component.Make sure to use the system name of the region where you provisioned the foundation models (e.g. us-east-1 for US East N. Virginia).With all preparational steps completed you should now be able to try out the demo application.For now, the demo application allows you to try out Text-To-Text generation with Anthropics Claude Version 2 model, Text-to-Image generation with Stability.AIs Stable Diffusion XL model and Text-to-Embeddings with Amazons Titan Embeddings G1 model.Start with asking Anthropic Claude Version 2 something. For example, “Human: Why is OutSystems the leading Low-Code application platform on the market.Assistant:”.Make sure to read the Prompt Design Section of Anthropic Claude documentation on how to construct prompts.docs.anthropic.comNext generate an image from text with the Stability.AI Stable Diffusion XL model. I used “Debris floating in space”.Lastly turn text into vector embeddings of 1536 dimension with Amazons Titan Embeddings G1 model. I used the following text:The demo outputs only the first ten dimensions. Titan Embeddings G1 generate vector embeddings with a fixed length of 1536 dimension.Vector embeddings are essential for adding semantic search and Retrieval Augmented Generation. You can read more about the two topics in my articlesitnext.ioanditnext.ioOne of the major advantages of Amazon Bedrock is that it unifies accessing multiple foundation models. If you know how to interact with one model, you know how to interact with all models — besides some model specific parameters.The AWS Bedrock Runtime Forge component abstracts the unified model invocation API of Bedrock making it extremely simple to use a foundation model.The AnthropicClaudePrompt server action wraps the Anthropic_Claude_Prompt server action from the AWS Bedrock Runtime component (AWS_BedrockRuntime_IS module).We use this one as an example as all other server actions from the AWS_BedrockRuntime_IS follow the same approach.The wrapper server action takes a single input parameter Prompt which is the text you entered in the default screen of the demo application and outputs a Result which is the generated text displayed next to the textarea.All model operations from the AWS Bedrock Runtime Forge component need your AWS credentials to authorize your request. You can choose betweenSTS credentials are a more advanced topic, but strongly recommended. My Forge Component AWS Security Token Service can be used to assume a role and retrieve temporary credentials.www.outsystems.comIn addition, you must specify the Region where you provisioned Foundation Models. The AWS Bedrock Runtime Forge component contains a static entity to select the region.All model specific parameters can be found in the Request structure. Parameters differ from model to model, and you will find information about the various parameters in the AWS Bedrock documentation.docs.aws.amazon.comThe rest of the wrapping server action should be self-explaining.Next open the PromptOnClick client action of the Demo screen that calls the wrapper.The form value of the text area is passed as an input parameter and the result of the server action is then assigned to the Result attribute of the form structure.Amazon Bedrock together with the AWS Bedrock Runtime Forge component provides easy access to multiple foundation modules. With only a few preparational steps you are up and running in minutes to build your own Generative AI application.You can expect that both the Integration Forge component and the Demo application evolve over time.Thank you for reading. I hope you liked it and that i have explained the important parts well. Let me know if not 😊If you have difficulties in getting up and running, please use the OutSystems Forum to get help. Suggestions on how to improve this article are very welcome. Send me a message via my OutSystems Profile or respond directly here on medium.If you like my articles, please leave some claps. Follow me and subscribe to receive a notification whenever I publish a new article. Happy Low Coding!Some rights reserved----ITNEXTDigital Craftsman, OutSytems MVP, AWS Community Builder and Senior Director at Telelink Business ServicesStefan WeberinITNEXT--Juntao QiuinITNEXT--13Futari Boy - developer & indie hackerinITNEXT--8Stefan WeberinITNEXT--Jason Marchalonis--Muthu Kumaran--Murali Manoharan--Simran Modi--Dinis CarvalhoinITNEXT--Sandeep Sai Kumar Kancharla--HelpStatusWritersBlogCareersPrivacyTermsAboutText to speechTeams



This post first appeared on VedVyas Articles, please read the originial post: here

Share the post

Get Started with OutSystems and Amazon Bedrock

×

Subscribe to Vedvyas Articles

Get updates delivered right to your inbox!

Thank you for your subscription

×