Skip to content

Commit

Permalink
chore(bedrock): support Amazon Rerank 1.0 and Cohere Rerank 3.5 models (
Browse files Browse the repository at this point in the history
aws#32348)

Ref: [Amazon Bedrock now supports Rerank API to improve accuracy of RAG
applications](https://aws.amazon.com/about-aws/whats-new/2024/12/amazon-bedrock-rerank-api-accuracy-rag-applications/)

```sh
% aws bedrock get-foundation-model --model-identifier amazon.rerank-v1:0 --region us-west-2

{
    "modelDetails": {
        "modelArn": "arn:aws:bedrock:us-west-2::foundation-model/amazon.rerank-v1:0",
        "modelId": "amazon.rerank-v1:0",
        "modelName": "Rerank 1.0",
        "providerName": "Amazon",
        "inputModalities": [
            "TEXT"
        ],
        "outputModalities": [


% aws bedrock get-foundation-model --model-identifier cohere.rerank-v3-5:0 --region us-west-2

{
    "modelDetails": {
        "modelArn": "arn:aws:bedrock:us-west-2::foundation-model/cohere.rerank-v3-5:0",
        "modelId": "cohere.rerank-v3-5:0",
        "modelName": "Rerank 3.5",
        "providerName": "Cohere",
        "inputModalities": [
            "TEXT"
```

### Checklist
- [x] My code adheres to the [CONTRIBUTING
GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and
[DESIGN
GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache-2.0 license*

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
mazyu36 and mergify[bot] authored Dec 6, 2024
1 parent 496bc78 commit 69163ac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/aws-cdk-lib/aws-bedrock/lib/foundation-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ export class FoundationModelIdentifier {
/** Base model "amazon.titan-embed-image-v1". */
public static readonly AMAZON_TITAN_MULTIMODAL_EMBEDDINGS_G1_V1 = new FoundationModelIdentifier('amazon.titan-embed-image-v1');

/** Base model "amazon.rerank-v1:0". */
public static readonly AMAZON_RERANK_V1 = new FoundationModelIdentifier('amazon.rerank-v1:0');

/** Base model "amazon.nova-canvas-v1:0". */
public static readonly AMAZON_NOVA_CANVAS_V1_0 = new FoundationModelIdentifier('amazon.nova-canvas-v1:0');

Expand Down Expand Up @@ -191,6 +194,9 @@ export class FoundationModelIdentifier {
/** Base model "cohere.command-r-v1:0". */
public static readonly COHERE_COMMAND_R_PLUS_V1 = new FoundationModelIdentifier('cohere.command-r-plus-v1:0');

/** Base model "cohere.rerank-v3-5:0". */
public static readonly COHERE_RERANK_V3_5 = new FoundationModelIdentifier('cohere.rerank-v3-5:0');

/** Base model "cohere.embed-english-v3". */
public static readonly COHERE_EMBED_ENGLISH_V3 = new FoundationModelIdentifier('cohere.embed-english-v3');

Expand Down

0 comments on commit 69163ac

Please sign in to comment.