You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/appstore/use-content/platform-supported-content/modules/aws/amazon-bedrock.md
+32-43Lines changed: 32 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ The Amazon Bedrock connector requires Mendix Studio Pro version 9.24.2 or above.
27
27
28
28
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/).
29
29
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.
31
31
32
32
### Licensing and Cost
33
33
@@ -77,6 +77,7 @@ After you configure the authentication profile for Amazon Bedrock, you can imple
77
77
* EXAMPLE_Embeddings_SingleString
78
78
* EXAMPLE_Retrieve
79
79
* EXAMPLE_RetrieveAndGenerate
80
+
* EXAMPLE_RetrieveAndGenerate_PromptTemplate
80
81
* EXAMPLE_ImageGeneration_MultipleImages
81
82
82
83
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
113
114
1. Create a new microflow and name it, for example, *AmazonBedrockChatCompletions*.
114
115
2. In the **Toolbox**, search for the **Chat Completions (without history)** activity in the *Amazon Bedrock (Operations)* and drag it onto your microflow.
115
116
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**.
117
118
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*
120
121
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.
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.
217
214
218
215
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).
219
216
220
217
The input and output for this service are shown in the table below:
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.
231
228
232
229
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).
233
230
234
231
The input and output for this service are shown in the table below:
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.
241
238
242
239
Some capabilities of the chat completions operations are currently only available for specific models:
243
240
@@ -259,7 +256,7 @@ The input and output for this service are shown in the table below:
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.
265
262
@@ -294,13 +291,13 @@ The history can be enabled using the `SessionId` parameter on the RetrieveAndGen
294
291
This activity was introduced in Amazon Bedrock Connector version 3.1.0.
295
292
{{% /alert %}}
296
293
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.
298
295
299
296
The input and output for this service are shown in the table below:
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.
316
313
317
314
The input and output for this service are shown in the table below:
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).
324
321
325
322
Currently, embeddings are available for the Cohere Embed family and or Titan Embeddings v2.
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.
330
327
331
328
The input and output for this service are shown in the table below:
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).
338
335
@@ -346,39 +343,31 @@ The input and output for this service are shown in the table below:
#### Request: Add Knowledge Base Tool to Collection {#add-knowledge-base-tool}
350
+
#### Add Knowledge Base Tool {#add-knowledge-base-tool}
362
351
363
352
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.
364
353
365
-
This operation corresponds to the **RetrieveAndGenerateRequest_Extension_Create** microflow.
354
+
This operation corresponds to the **Request_AddKnowledgeBaseTool** microflow.
#### Request: Add Retrieve And Generate Request Extension {#add-rag-extension}
360
+
#### Configure Bedrock Retrieve and Generate (add Knowledge Base) {#add-rag-extension}
372
361
373
362
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.
374
363
375
-
This operation corresponds to the **Request_AddKnowledgeBaseTool** microflow.
364
+
This operation corresponds to the **RetrieveAndGenerateRequest_Extension_Create** microflow.
#### Set Bedrock Retrieve Options {#add-r-extension}
450
439
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.
452
441
453
442
To use this activity, you must set up a knowledge base in your Amazon Bedrock Environment. For more information, see [Knowledge Base](#knowledge-base).
454
443
455
444
The input and output for this service are shown in the table below:
0 commit comments