From 895abf6eabaf85c5bdadb674e9d3f63e57284cfb Mon Sep 17 00:00:00 2001 From: Roo Code Date: Wed, 19 Nov 2025 20:36:13 +0000 Subject: [PATCH] feat: add Amazon Bedrock embedding models support for OpenAI-compatible API - Add Amazon Titan Embed v1, v2, and Image models - Add Cohere embed-english-v3 and embed-multilingual-v3 models - Support custom models via manual dimension configuration - Tests pass with no regression Fixes #9404 --- src/shared/embeddingModels.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/shared/embeddingModels.ts b/src/shared/embeddingModels.ts index 9f83e6ae59..6f1b62516e 100644 --- a/src/shared/embeddingModels.ts +++ b/src/shared/embeddingModels.ts @@ -44,14 +44,24 @@ export const EMBEDDING_MODEL_PROFILES: EmbeddingModelProfiles = { // 'default': { dimension: 768 } // Assuming a default dimension }, "openai-compatible": { + // OpenAI models "text-embedding-3-small": { dimension: 1536, scoreThreshold: 0.4 }, "text-embedding-3-large": { dimension: 3072, scoreThreshold: 0.4 }, "text-embedding-ada-002": { dimension: 1536, scoreThreshold: 0.4 }, + // Nomic models "nomic-embed-code": { dimension: 3584, scoreThreshold: 0.15, queryPrefix: "Represent this query for searching relevant code: ", }, + // Amazon Bedrock models + "amazon.titan-embed-text-v1": { dimension: 1536, scoreThreshold: 0.4 }, + "amazon.titan-embed-text-v2:0": { dimension: 1024, scoreThreshold: 0.4 }, + "amazon.titan-embed-image-v1": { dimension: 1024, scoreThreshold: 0.4 }, + "cohere.embed-english-v3": { dimension: 1024, scoreThreshold: 0.4 }, + "cohere.embed-multilingual-v3": { dimension: 1024, scoreThreshold: 0.4 }, + // Custom model placeholder - users can use any model with manual dimension + // When model is not in this list, the system will use manual modelDimension if provided }, gemini: { "text-embedding-004": { dimension: 768 },