Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing VoyageAI's new multimodal embedding model #239

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/collections/config/types/vectorizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type Vectorizer =
| 'multi2vec-bind'
| Multi2VecPalmVectorizer
| 'multi2vec-google'
| 'multi2vec-voyageai'
| 'ref2vec-centroid'
| 'text2vec-aws'
| 'text2vec-azure-openai'
Expand Down Expand Up @@ -184,6 +185,13 @@ export type Multi2VecGoogleConfig = {
};
};

/** The configuration for multi-media vectorization using the VoyageAI module.
*
* See the [documentation](https://weaviate.io/developers/weaviate/model-providers/transformers/embeddings-multimodal) for detailed usage.
*/
export type Multi2VecVoyageAIConfig = {
};

/** The configuration for reference-based vectorization using the centroid method.
*
* See the [documentation](https://weaviate.io/developers/weaviate/modules/ref2vec-centroid) for detailed usage.
Expand Down Expand Up @@ -431,6 +439,7 @@ export type VectorizerConfig =
| Multi2VecBindConfig
| Multi2VecGoogleConfig
| Multi2VecPalmConfig
| Multi2VecVoyageAIConfig
| Ref2VecCentroidConfig
| Text2VecAWSConfig
| Text2VecAzureOpenAIConfig
Expand Down Expand Up @@ -460,6 +469,8 @@ export type VectorizerConfigType<V> = V extends 'img2vec-neural'
? Multi2VecGoogleConfig
: V extends Multi2VecPalmVectorizer
? Multi2VecPalmConfig
: V extends 'multi2vec-voyageai'
? Multi2VecVoyageAIConfig | undefined
: V extends 'ref2vec-centroid'
? Ref2VecCentroidConfig
: V extends 'text2vec-aws'
Expand Down
5 changes: 5 additions & 0 deletions src/collections/configure/types/vectorizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ export type Multi2VecGoogleConfigCreate = {
vectorizeCollectionName?: boolean;
};

export type Multi2VecVoyageAIConfigCreate = {
};

export type Ref2VecCentroidConfigCreate = Ref2VecCentroidConfig;

export type Text2VecAWSConfigCreate = Text2VecAWSConfig;
Expand Down Expand Up @@ -197,6 +200,8 @@ export type VectorizerConfigCreateType<V> = V extends 'img2vec-neural'
? Multi2VecPalmConfigCreate
: V extends 'multi2vec-google'
? Multi2VecGoogleConfigCreate
: V extends 'multi2vec-voyageai'
? Multi2VecVoyageAIConfigCreate | undefined
: V extends 'ref2vec-centroid'
? Ref2VecCentroidConfigCreate
: V extends 'text2vec-aws'
Expand Down
22 changes: 22 additions & 0 deletions src/collections/configure/vectorizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,28 @@ export const vectorizer = {
},
});
},
/**
* Create a `VectorConfigCreate` object with the vectorizer set to `'multi2vec-clip'`.
*
* See the [documentation](https://weaviate.io/developers/weaviate/model-providers/transformers/embeddings-multimodal) for detailed usage.
*
* @param {ConfigureNonTextVectorizerOptions<N, I, 'multi2vec-voyageai'>} [opts] The configuration options for the `multi2vec-voyageai` vectorizer.
* @returns {VectorConfigCreate<PrimitiveKeys<T>[], N, I, 'multi2vec-voyageai'>} The configuration object.
*/
multi2VecVoyageAI: <N extends string | undefined = undefined, I extends VectorIndexType = 'hnsw'>(
opts?: ConfigureNonTextVectorizerOptions<N, I, 'multi2vec-voyageai'>
): VectorConfigCreate<never, N, I, 'multi2vec-voyageai'> => {
const { name, vectorIndexConfig, ...config } = opts || {};
return makeVectorizer(name, {
vectorIndexConfig,
vectorizerConfig: {
name: 'multi2vec-voyageai',
config: {
...config,
},
},
});
},
/**
* Create a `VectorConfigCreate` object with the vectorizer set to `'ref2vec-centroid'`.
*
Expand Down