Skip to content

Commit

Permalink
add dimensions param to text2vec-weaviate vectorizer (#238)
Browse files Browse the repository at this point in the history
* add dimensions param to text2vec-weaviate vectorizer

* adjust unit test
  • Loading branch information
augustas1 authored Dec 4, 2024
1 parent 799d409 commit f3e6ddf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/collections/config/types/vectorizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,13 @@ export type Text2VecVoyageAIConfig = {
/**
* The configuration for text vectorization using Weaviate's self-hosted text-based embedding models.
*
* TODO: add documentation reference once available.
* See the [documentation](https://weaviate.io/developers/weaviate/model-providers/weaviate/embeddings) for detailed usage.
*/
export type Text2VecWeaviateConfig = {
/** The base URL to use where API requests should go. */
baseURL?: string;
/** The dimensions to use. */
dimensions?: number;
/** The model to use. */
model?: 'Snowflake/snowflake-arctic-embed-m-v1.5' | string;
/** Whether to vectorize the collection name. */
Expand Down
2 changes: 2 additions & 0 deletions src/collections/configure/unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,7 @@ describe('Unit testing of the vectorizer factory class', () => {
const config = configure.vectorizer.text2VecWeaviate({
name: 'test',
baseURL: 'base-url',
dimensions: 256,
model: 'model',
vectorizeCollectionName: true,
});
Expand All @@ -1375,6 +1376,7 @@ describe('Unit testing of the vectorizer factory class', () => {
name: 'text2vec-weaviate',
config: {
baseURL: 'base-url',
dimensions: 256,
model: 'model',
vectorizeCollectionName: true,
},
Expand Down
2 changes: 1 addition & 1 deletion src/collections/configure/vectorizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ export const vectorizer = {
/**
* Create a `VectorConfigCreate` object with the vectorizer set to `'text2vec-weaviate'`.
*
* TODO: add documentation reference once available.
* See the [documentation](https://weaviate.io/developers/weaviate/model-providers/weaviate/embeddings) for detailed usage.
*
* @param {ConfigureTextVectorizerOptions<T, N, I, 'text2vec-weaviate'>} [opts] The configuration for the `text2vec-weaviate` vectorizer.
* @returns {VectorConfigCreate<PrimitiveKeys<T>, N, I, 'text2vec-weaviate'>} The configuration object.
Expand Down

0 comments on commit f3e6ddf

Please sign in to comment.