From 69163acdaa40fd2d280306320a4f53b4ffc4cddd Mon Sep 17 00:00:00 2001 From: Matsuda Date: Sat, 7 Dec 2024 05:28:57 +0900 Subject: [PATCH] chore(bedrock): support Amazon Rerank 1.0 and Cohere Rerank 3.5 models (#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> --- packages/aws-cdk-lib/aws-bedrock/lib/foundation-model.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/aws-cdk-lib/aws-bedrock/lib/foundation-model.ts b/packages/aws-cdk-lib/aws-bedrock/lib/foundation-model.ts index 6986cffe1a2d2..39985388fabaa 100644 --- a/packages/aws-cdk-lib/aws-bedrock/lib/foundation-model.ts +++ b/packages/aws-cdk-lib/aws-bedrock/lib/foundation-model.ts @@ -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'); @@ -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');