diff --git a/js/plugins/vertexai/src/embedder.ts b/js/plugins/vertexai/src/embedder.ts index 5de795b06..072464409 100644 --- a/js/plugins/vertexai/src/embedder.ts +++ b/js/plugins/vertexai/src/embedder.ts @@ -81,23 +81,41 @@ export const textEmbeddingGecko001 = embedderRef({ }, }); -/* -// @TODO(huangjeff): Fix multilingual text embedding gecko -// For some reason this model returns 404 but it exists in the reference docs: -// https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings +export const textEmbedding004 = embedderRef({ + name: 'vertexai/text-embedding-004', + configSchema: TextEmbeddingGeckoConfigSchema, + info: { + dimensions: 768, + label: 'Vertex AI - Text Embedding 004', + supports: { + input: ['text'], + }, + }, +}); + +export const textMultilingualEmbedding002 = embedderRef({ + name: 'vertexai/text-multilingual-embedding-002', + configSchema: TextEmbeddingGeckoConfigSchema, + info: { + dimensions: 768, + label: 'Vertex AI - Text Multilingual Embedding 002', + supports: { + input: ['text'], + }, + }, +}); export const textEmbeddingGeckoMultilingual001 = embedderRef({ name: 'vertexai/textembedding-gecko-multilingual@001', configSchema: TextEmbeddingGeckoConfigSchema, info: { dimensions: 768, - label: 'Vertex AI - Multilingual Text Embedding Gecko', + label: 'Vertex AI - Multilingual Text Embedding Gecko 001', supports: { input: ['text'], }, }, }); -*/ export const textEmbeddingGecko = textEmbeddingGecko003; @@ -105,7 +123,9 @@ export const SUPPORTED_EMBEDDER_MODELS: Record = { 'textembedding-gecko@003': textEmbeddingGecko003, 'textembedding-gecko@002': textEmbeddingGecko002, 'textembedding-gecko@001': textEmbeddingGecko001, - //'textembeddding-gecko-multilingual@001': textEmbeddingGeckoMultilingual001, + 'text-embedding-004': textEmbedding004, + 'textembedding-gecko-multilingual@001': textEmbeddingGeckoMultilingual001, + 'text-multilingual-embedding-002': textMultilingualEmbedding002, }; interface EmbeddingInstance { diff --git a/js/plugins/vertexai/src/index.ts b/js/plugins/vertexai/src/index.ts index 8bf134e43..acba0bce6 100644 --- a/js/plugins/vertexai/src/index.ts +++ b/js/plugins/vertexai/src/index.ts @@ -27,8 +27,14 @@ import { } from './anthropic.js'; import { SUPPORTED_EMBEDDER_MODELS, + textEmbedding004, textEmbeddingGecko, + textEmbeddingGecko001, + textEmbeddingGecko002, + textEmbeddingGecko003, textEmbeddingGeckoEmbedder, + textEmbeddingGeckoMultilingual001, + textMultilingualEmbedding002, } from './embedder.js'; import { VertexAIEvaluationMetric, @@ -54,7 +60,13 @@ export { geminiPro, geminiProVision, imagen2, + textEmbedding004, textEmbeddingGecko, + textEmbeddingGecko001, + textEmbeddingGecko002, + textEmbeddingGecko003, + textEmbeddingGeckoMultilingual001, + textMultilingualEmbedding002, VertexAIEvaluationMetricType as VertexAIEvaluationMetricType, };