Skip to content

Commit 05d3f85

Browse files
authored
Update amazon-bedrock.md
1 parent e1fa064 commit 05d3f85

1 file changed

Lines changed: 32 additions & 43 deletions

File tree

  • content/en/docs/appstore/use-content/platform-supported-content/modules/aws

content/en/docs/appstore/use-content/platform-supported-content/modules/aws/amazon-bedrock.md

Lines changed: 32 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The Amazon Bedrock connector requires Mendix Studio Pro version 9.24.2 or above.
2727

2828
To authenticate with Amazon Web Service (AWS), you must also install and configure the [AWS Authentication connector version 3.0.0 or higher](https://marketplace.mendix.com/link/component/120333). It is crucial for the Amazon Bedrock connector to function correctly. For more information about installing and configuring the AWS Authentication connector, see [AWS Authentication](/appstore/modules/aws/aws-authentication/).
2929

30-
You must also install the [GenAI Commons version 1.2.0 or higher](/appstore/modules/genai/commons/). To make integration of generative AI capabilities as easy as possible, the Amazon Bedrock connector depends on the generic domain model and operations provided by the GenAICommons module.
30+
You must also install the [GenAI Commons version 2.0.0 or higher](/appstore/modules/genai/commons/). To make integration of generative AI capabilities as easy as possible, the Amazon Bedrock connector depends on the generic domain model and operations provided by the GenAICommons module.
3131

3232
### Licensing and Cost
3333

@@ -77,6 +77,7 @@ After you configure the authentication profile for Amazon Bedrock, you can imple
7777
* EXAMPLE_Embeddings_SingleString
7878
* EXAMPLE_Retrieve
7979
* EXAMPLE_RetrieveAndGenerate
80+
* EXAMPLE_RetrieveAndGenerate_PromptTemplate
8081
* EXAMPLE_ImageGeneration_MultipleImages
8182

8283
You can also take a look at the [GenAI Showcase Application](https://marketplace.mendix.com/link/component/220475) to get some inspiration on what you can use these operations for.
@@ -113,20 +114,16 @@ To build a simple microflow that uses the ChatCompletions operation to send a si
113114
1. Create a new microflow and name it, for example, *AmazonBedrockChatCompletions*.
114115
2. In the **Toolbox**, search for the **Chat Completions (without history)** activity in the *Amazon Bedrock (Operations)* and drag it onto your microflow.
115116
3. Double click on the activity to see its parameters.
116-
1. The **Request** and **FileCollection** parameters are not needed for this example, so you can set them to **empty**.
117+
1. The **OptionalRequest** and **FileCollection** parameters are not needed for this example, so you can set them to **empty**.
117118
2. For the **UserPrompt** parameter, enter a string of your choice, for example *Hi, Claude!*.
118-
3. CLick **OK**. The input for the **Connection** parameter will be created in the next step.
119-
4. In the **Toolbox**, search for the **Create Amazon Bedrock Connection** operation and drag it to the beginning of your microflow.
119+
3. CLick **OK**. The input for the **DeployedModel** parameter will be created in the next step.
120+
4. Add a **Microflow call** from the **Toolbox** and choose microflow *AmazonBedrockConnector.BedrockDeployedModel_Get*
120121
5. Double-click it to configure its parameters.
121-
1. For the **ENUM_Region** parameter, enter a value of the `AWSAuthentication.ENUM_Region` enumeration. Choose the region where you have access to Amazon Bedrock. For example, *AWSAuthentication.ENUM_Region.us_east_1*.
122-
2. For the **ModelId** parameter, enter the model id of the LLM you want to send a message to. The model id of Claude 3.5 Sonnet is *anthropic.claude-3-5-sonnet-20240620-v1:0*.
123-
3. For the **UseStaticCredentials** parameter, enter *true* if you have configured static AWS Credentials, and *false* if you have configured temporary AWS Credentials.
124-
4. Click **OK**.
125-
6. Double-click the **ChatCompletion** operation and, for the **Connection** parameter, pass the newly created **AmazonBedrockConnection** object.
126-
7. In the **Toolbox**, search for the **Get Model Response Text** operation from the *GenAI Commons (Text & Files - Response)* category, and drag it to the end of your microflow.
127-
8. Double-click on it and pass the **Response** from the ChatCompletions operation as parameter. The **Get Model Response Text** will return the response from Claude as a string.
128-
9. Add a **Show Message** activity to the end of the microflow and configure it to show the returned response string.
129-
10. Add a button that calls this microflow, run your project, and verify the results.
122+
1. For the **ModelID** parameter, enter the model id of the LLM you want to send a message to. The model id of Claude 3.5 Sonnet is *anthropic.claude-3-5-sonnet-20240620-v1:0*.
123+
2. Click **OK**.
124+
6. Double-click the **ChatCompletion** operation and, for the **DeployedModel** parameter, pass the newly retrieved **BedrockDeployedModel** object.
125+
7. Add a **Show Message** activity to the end of the microflow and configure it to show *$Response/ResponseText*
126+
8. Add a button that calls this microflow, run your project, and verify the results.
130127

131128
{{< figure src="/attachments/appstore/platform-supported-content/modules/aws-bedrock/chat-completions-mf.png" class="no-border" >}}
132129

@@ -213,31 +210,31 @@ For additional information about available operations, refer to the sections bel
213210

214211
#### ChatCompletions (Without History) {#chat-completions-without-history}
215212

216-
The `ChatCompletions (without history)` activity can be used for any conversations with a variety of supported LLMs. There is no option to keep the conversation history in mind. This operation corresponds to the **ChatCompletions_WithoutHistory_AmazonBedrock** microflow.
213+
The `ChatCompletions (without history)` activity can be used for any conversations with a variety of supported LLMs. There is no option to keep the conversation history in mind.
217214

218215
This operation leverages the Amazon Bedrock Converse API. For a full overview of supported models and model capabilities, please refer to the [AWS Documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features).
219216

220217
The input and output for this service are shown in the table below:
221218

222219
| Input | Output |
223220
| --- | --- |
224-
| `Userprompt (string)`, `AmazonBedrockConnection`, `GenAICommons.Request`, `FileCollection`| `GenAICommons.Response`|
221+
| `UserPrompt (string)`, `GenAICommons.DeployedModel (object)`, `GenAICommons.Request (object)`, `FileCollection (object)`| `GenAICommons.Response (object)`|
225222

226223
`GenAICommons.Request` and `FileCollection` can be empty, in which case they are not sent to the Bedrock API.
227224

228225
#### ChatCompletions (With History) {#chat-completions-with-history}
229226

230-
The `ChatCompletions (with history)` activity can be used for any conversations with a variety of supported LLMs. It is possible for it to keep the conversation history in mind. This operation corresponds to the **ChatCompletions_WithHistory_AmazonBedrock** microflow.
227+
The `ChatCompletions (with history)` activity can be used for any conversations with a variety of supported LLMs. It is possible for it to keep the conversation history in mind.
231228

232229
This operation leverages the Amazon Bedrock Converse API. For a full overview of supported models and model capabilities, please refer to the [AWS Documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features).
233230

234231
The input and output for this service are shown in the table below:
235232

236233
| Input | Output |
237234
| --- | --- |
238-
| `GenAICommons.Request`, `AmazonBedrockConnection`| `GenAICommons.Response`|
235+
| `GenAICommons.Request (object)`, `GenAICommons.DeployedModel (object)`| `GenAICommons.Response (object)`|
239236

240-
In order to pass a conversation history to the flow, the list of previous messages must be associated to the input request. This operation can easily be replaced or combined with the ChatCompletions (with history) operation inside of the [OpenAI connector](https://marketplace.mendix.com/link/component/220472).
237+
In order to pass a conversation history to the flow, the list of previous messages must be associated to the input request.
241238

242239
Some capabilities of the chat completions operations are currently only available for specific models:
243240

@@ -259,7 +256,7 @@ The input and output for this service are shown in the table below:
259256

260257
| Input | Output |
261258
| --- | --- |
262-
| `GenAICommons.Request`, `AmazonBedrockConnection`| `GenAICommons.Response`|
259+
| `GenAICommons.Request (object)`, `GenAICommons.DeployedModel (object)`| `GenAICommons.Response (object)`|
263260

264261
The request object passed to this operation must include a KnowledgeBaseTool object, which can be added to the request using the [Request: Add Knowledge Base Tool to Collection](#add-knowledge-base-tool) operation.
265262

@@ -294,13 +291,13 @@ The history can be enabled using the `SessionId` parameter on the RetrieveAndGen
294291
This activity was introduced in Amazon Bedrock Connector version 3.1.0.
295292
{{% /alert %}}
296293

297-
The `Image Generation` operation can be used to generate one or more images. This operation corresponds to the *ImageGeneration_AmazonBedrock* microflow. Currently *Amazon Titan Image Generator G1* is the only supported model for image generation of the Amazon Bedrock Connector.
294+
The `Generate Image` operation can be used to generate one or more images. Currently *Amazon Titan Image Generator G1* is the only supported model for image generation of the Amazon Bedrock Connector.
298295

299296
The input and output for this service are shown in the table below:
300297

301298
| Input | Output |
302299
| --- | --- |
303-
| `UserPrompt (String)`, `AmazonBedrockConnection (object)`, `GenAICommons.ImageOptions (object)`| `GenAICommons.Response (object)`|
300+
| `UserPrompt (string)`, `GenAICommons.DeployedModel (object)`, `GenAICommons.ImageOptions (object)`| `GenAICommons.Response (object)`|
304301

305302
`GenAICommons.ImageOptions` can be an empty object. If provided, it allows you to set additional options for Image Generation.
306303

@@ -312,27 +309,27 @@ For Titan Image models, the `Image Generation: Add Titan Image Extension` operat
312309

313310
#### Embeddings (single string) {#embeddings-single-string}
314311

315-
The `Embeddings (single string)` activity can be used to generate an embedding vector for a given input string with one of the Cohere Embed models or Titan Embeddings v2. This operation corresponds to the **Embeddings_SingleString_AmazonBedrock** microflow.
312+
The `Generate Embeddings (String)` activity can be used to generate an embedding vector for a given input string with one of the Cohere Embed models or Titan Embeddings v2.
316313

317314
The input and output for this service are shown in the table below:
318315

319316
| Input | Output |
320317
| --- | --- |
321-
| `InputText`, `AmazonBedrockConnection`, `GenAICommons.EmbeddingsOptions (optional)` | `GenAICommons.EmbeddingsResponse`|
318+
| `InputText (string)`, `GenAICommons.DeployedModel (object)`, `GenAICommons.EmbeddingsOptions (object)` | `GenAICommons.EmbeddingsResponse (object)`|
322319

323320
For Cohere Embed and Titan Embeddings, the request can be associated to their respective EmbeddingsOptions extension object which can be created with the [Embeddings Options: Add Cohere Embed Extension](#add-cohere-embed-extension) or [Embeddings Options: Add Titan Embeddings Extension](#add-titan-embeddings-extension) operation. Through this extension, it is possible to tailor the operation to more specific needs. This operation can easily be replaced or combined with the Embeddings (single string) operation inside of the [OpenAI connector](https://marketplace.mendix.com/link/component/220472).
324321

325322
Currently, embeddings are available for the Cohere Embed family and or Titan Embeddings v2.
326323

327324
#### Embeddings (chunk collection) {#embeddings-chunk-collection}
328325

329-
The `Embeddings (chunk collection)` activity can be used to generate a collection of embedding vectors for a given collection of text chunks with one of the Cohere Embed models or Titan Embeddings v2. This operation corresponds to the **Embeddings_ChunkCollection_AmazonBedrock** microflow.
326+
The `Generate Embeddings (Chunk Collection)` activity can be used to generate a collection of embedding vectors for a given collection of text chunks with one of the Cohere Embed models or Titan Embeddings v2.
330327

331328
The input and output for this service are shown in the table below:
332329

333330
| Input | Output |
334331
| --- | --- |
335-
| `GenAICommons.ChunkCollection`, `AmazonBedrockConnection`, `GenAICommons.EmbeddingsOptions (optional)` | `GenAICommons.EmbeddingsResponse`|
332+
| `GenAICommons.ChunkCollection (object)`, `GenAICommons.DeployedModel (object)`, `GenAICommons.EmbeddingsOptions (object)` | `GenAICommons.EmbeddingsResponse (object)`|
336333

337334
For each model family, the request can be associated to an extension of the EmbeddingsOptions object which can be created with either the [Embeddings Options: Add Cohere Embed Extension](#add-cohere-embed-extension) or the [Embeddings Options: Add Titan Embeddings Extension](#add-titan-embeddings-extension) operation. Through this extension, it is possible to tailor the operation to more specific needs. This operation can easily be replaced or combined with the Embeddings (chunk collection) operation inside of the [OpenAI connector](https://marketplace.mendix.com/link/component/220472).
338335

@@ -346,39 +343,31 @@ The input and output for this service are shown in the table below:
346343

347344
| Input | Output |
348345
| --- | --- |
349-
| `GenAICommons.Request`, `AmazonBedrockConnection`| `GenAICommons.Response`|
346+
| `GenAICommons.Request (object)`| `GenAICommons.Response (object)`|
350347

351348
### GenAI Commons Helper Operations
352349

353-
#### Create Amazon Bedrock Connection {#create-amazon-bedrock-connection}
354-
355-
Use this microflow to create a new Amazon Bedrock Connection object.
356-
357-
This operation corresponds to the **AmazonBedrockConnection_Create** microflow.
358-
359-
| `ENUM_Region (enumeration)`, `UseStaticCredentials (Boolean)`, `ModelId (string)` | `AmazonBedrockConnection (object)`|
360-
361-
#### Request: Add Knowledge Base Tool to Collection {#add-knowledge-base-tool}
350+
#### Add Knowledge Base Tool {#add-knowledge-base-tool}
362351

363352
Use this microflow to add a new KnowledgeBaseTool object to your request. This is useful for adding additional parameters when using the [Retrieve And Generate](#retrieve-and-generate) operation.
364353

365-
This operation corresponds to the **RetrieveAndGenerateRequest_Extension_Create** microflow.
354+
This operation corresponds to the **Request_AddKnowledgeBaseTool** microflow.
366355

367356
| Input | Output |
368357
| --- | --- |
369358
| `GenAICommons.Request (object)`, `KnowledgeBaseId (string)` | *none* |
370359

371-
#### Request: Add Retrieve And Generate Request Extension {#add-rag-extension}
360+
#### Configure Bedrock Retrieve and Generate (add Knowledge Base) {#add-rag-extension}
372361

373362
Use this microflow to add a new RetrieveAndGenerateRequest_Extension object to your request. This is required in order to use the [Retrieve And Generate](#retrieve-and-generate) operation successfully.
374363

375-
This operation corresponds to the **Request_AddKnowledgeBaseTool** microflow.
364+
This operation corresponds to the **RetrieveAndGenerateRequest_Extension_Create** microflow.
376365

377366
| Input | Output |
378367
| --- | --- |
379-
| `GenAICommons.Request (object)`, `KmsKeyARN (string)`, `SessionId (string)`, `Enum_RetrieveAndGenerateType (enumeration)` | `RetrieveAndGenerateRequest_Extension (object)` |
368+
| `GenAICommons.Request (object)`, `KnowledgeBaseID (string)`, `KmsKeyARN (string)`, `SessionId (string)`, `Enum_RetrieveAndGenerateType (enumeration)`, `PromptTemplate (string)` | `RetrieveAndGenerateRequest_Extension (object)` |
380369

381-
`KmsKeyARN`, `SessionId`, and `Enum_RetrieveAndGenerateType` can be empty, in which case they are not sent to the Bedrock API.
370+
`KmsKeyARN`, `SessionId`, `PromptTemplate` and `Enum_RetrieveAndGenerateType` can be empty, in which case they are not sent to the Bedrock API.
382371

383372
#### Image Generation: Add Titan Image Extension {#add-titan-image-extension}
384373

@@ -446,17 +435,17 @@ This operation corresponds to the **TitanEmbeddingsOptions_Extension_Create** mi
446435
| --- | --- |
447436
| `GenAICommons.EmbeddingsOptions (object)`, `Normalize (boolean)`| `TitanEmbeddingsOptions_Extension (object)`|
448437

449-
#### Request: Add Retrieve Request Extension {#add-r-extension}
438+
#### Set Bedrock Retrieve Options {#add-r-extension}
450439

451-
Use this microflow to add a new RetrieveRequest_Extension object to your request. This is required in order to use the [Retrieve](#retrieve) activity. It requires `Connection`, and `RetrieveRequest` as input parameters.
440+
Use this microflow to add a new RetrieveRequest_Extension object to your request. This is required in order to use the [Retrieve](#retrieve) activity.
452441

453442
To use this activity, you must set up a knowledge base in your Amazon Bedrock Environment. For more information, see [Knowledge Base](#knowledge-base).
454443

455444
The input and output for this service are shown in the table below:
456445

457446
| Input | Output |
458447
| --- | --- |
459-
| `ENUM_Region (enumeration)`, `Credentials (object)`, `RetrieveRequest (object)` | `RetrieveResponse (object)` |
448+
| `Request (object)`, `KnowledgeBaseID (string)`, `NumberOfResults (integer)`, `NextToken (string)` | `RetrieveRequest_Extension (object)` |
460449

461450
#### Request: Add Additional Request Parameter {#add-request-parameter}
462451

0 commit comments

Comments
 (0)