Skip to content

Commit 9d8962a

Browse files
committed
Introducing VoyageAI's new multimodal embedding model
1 parent f3e6ddf commit 9d8962a

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

src/collections/config/types/vectorizer.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export type Vectorizer =
2424
| 'multi2vec-bind'
2525
| Multi2VecPalmVectorizer
2626
| 'multi2vec-google'
27+
| 'multi2vec-voyageai'
2728
| 'ref2vec-centroid'
2829
| 'text2vec-aws'
2930
| 'text2vec-azure-openai'
@@ -184,6 +185,13 @@ export type Multi2VecGoogleConfig = {
184185
};
185186
};
186187

188+
/** The configuration for multi-media vectorization using the VoyageAI module.
189+
*
190+
* See the [documentation](https://weaviate.io/developers/weaviate/model-providers/transformers/embeddings-multimodal) for detailed usage.
191+
*/
192+
export type Multi2VecVoyageAIConfig = {
193+
};
194+
187195
/** The configuration for reference-based vectorization using the centroid method.
188196
*
189197
* See the [documentation](https://weaviate.io/developers/weaviate/modules/ref2vec-centroid) for detailed usage.
@@ -431,6 +439,7 @@ export type VectorizerConfig =
431439
| Multi2VecBindConfig
432440
| Multi2VecGoogleConfig
433441
| Multi2VecPalmConfig
442+
| Multi2VecVoyageAIConfig
434443
| Ref2VecCentroidConfig
435444
| Text2VecAWSConfig
436445
| Text2VecAzureOpenAIConfig
@@ -460,6 +469,8 @@ export type VectorizerConfigType<V> = V extends 'img2vec-neural'
460469
? Multi2VecGoogleConfig
461470
: V extends Multi2VecPalmVectorizer
462471
? Multi2VecPalmConfig
472+
: V extends 'multi2vec-voyageai'
473+
? Multi2VecVoyageAIConfig | undefined
463474
: V extends 'ref2vec-centroid'
464475
? Ref2VecCentroidConfig
465476
: V extends 'text2vec-aws'

src/collections/configure/types/vectorizer.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ export type Multi2VecGoogleConfigCreate = {
150150
vectorizeCollectionName?: boolean;
151151
};
152152

153+
export type Multi2VecVoyageAIConfigCreate = {
154+
};
155+
153156
export type Ref2VecCentroidConfigCreate = Ref2VecCentroidConfig;
154157

155158
export type Text2VecAWSConfigCreate = Text2VecAWSConfig;
@@ -197,6 +200,8 @@ export type VectorizerConfigCreateType<V> = V extends 'img2vec-neural'
197200
? Multi2VecPalmConfigCreate
198201
: V extends 'multi2vec-google'
199202
? Multi2VecGoogleConfigCreate
203+
: V extends 'multi2vec-voyageai'
204+
? Multi2VecVoyageAIConfigCreate | undefined
200205
: V extends 'ref2vec-centroid'
201206
? Ref2VecCentroidConfigCreate
202207
: V extends 'text2vec-aws'

src/collections/configure/vectorizer.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
Multi2VecClipConfig,
44
Multi2VecField,
55
Multi2VecPalmConfig,
6+
Multi2VecVoyageAIConfig,
67
VectorIndexType,
78
Vectorizer,
89
VectorizerConfigType,
@@ -263,6 +264,28 @@ export const vectorizer = {
263264
},
264265
});
265266
},
267+
/**
268+
* Create a `VectorConfigCreate` object with the vectorizer set to `'multi2vec-clip'`.
269+
*
270+
* See the [documentation](https://weaviate.io/developers/weaviate/model-providers/transformers/embeddings-multimodal) for detailed usage.
271+
*
272+
* @param {ConfigureNonTextVectorizerOptions<N, I, 'multi2vec-voyageai'>} [opts] The configuration options for the `multi2vec-voyageai` vectorizer.
273+
* @returns {VectorConfigCreate<PrimitiveKeys<T>[], N, I, 'multi2vec-voyageai'>} The configuration object.
274+
*/
275+
multi2VecVoyageAI: <N extends string | undefined = undefined, I extends VectorIndexType = 'hnsw'>(
276+
opts?: ConfigureNonTextVectorizerOptions<N, I, 'multi2vec-voyageai'>
277+
): VectorConfigCreate<never, N, I, 'multi2vec-voyageai'> => {
278+
const { name, vectorIndexConfig, ...config } = opts || {};
279+
return makeVectorizer(name, {
280+
vectorIndexConfig,
281+
vectorizerConfig: {
282+
name: 'multi2vec-voyageai',
283+
config: {
284+
...config,
285+
},
286+
},
287+
});
288+
},
266289
/**
267290
* Create a `VectorConfigCreate` object with the vectorizer set to `'ref2vec-centroid'`.
268291
*

0 commit comments

Comments
 (0)