Skip to content

Commit f3e6ddf

Browse files
authored
add dimensions param to text2vec-weaviate vectorizer (#238)
* add dimensions param to text2vec-weaviate vectorizer * adjust unit test
1 parent 799d409 commit f3e6ddf

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/collections/config/types/vectorizer.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,11 +410,13 @@ export type Text2VecVoyageAIConfig = {
410410
/**
411411
* The configuration for text vectorization using Weaviate's self-hosted text-based embedding models.
412412
*
413-
* TODO: add documentation reference once available.
413+
* See the [documentation](https://weaviate.io/developers/weaviate/model-providers/weaviate/embeddings) for detailed usage.
414414
*/
415415
export type Text2VecWeaviateConfig = {
416416
/** The base URL to use where API requests should go. */
417417
baseURL?: string;
418+
/** The dimensions to use. */
419+
dimensions?: number;
418420
/** The model to use. */
419421
model?: 'Snowflake/snowflake-arctic-embed-m-v1.5' | string;
420422
/** Whether to vectorize the collection name. */

src/collections/configure/unit.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,6 +1362,7 @@ describe('Unit testing of the vectorizer factory class', () => {
13621362
const config = configure.vectorizer.text2VecWeaviate({
13631363
name: 'test',
13641364
baseURL: 'base-url',
1365+
dimensions: 256,
13651366
model: 'model',
13661367
vectorizeCollectionName: true,
13671368
});
@@ -1375,6 +1376,7 @@ describe('Unit testing of the vectorizer factory class', () => {
13751376
name: 'text2vec-weaviate',
13761377
config: {
13771378
baseURL: 'base-url',
1379+
dimensions: 256,
13781380
model: 'model',
13791381
vectorizeCollectionName: true,
13801382
},

src/collections/configure/vectorizer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ export const vectorizer = {
604604
/**
605605
* Create a `VectorConfigCreate` object with the vectorizer set to `'text2vec-weaviate'`.
606606
*
607-
* TODO: add documentation reference once available.
607+
* See the [documentation](https://weaviate.io/developers/weaviate/model-providers/weaviate/embeddings) for detailed usage.
608608
*
609609
* @param {ConfigureTextVectorizerOptions<T, N, I, 'text2vec-weaviate'>} [opts] The configuration for the `text2vec-weaviate` vectorizer.
610610
* @returns {VectorConfigCreate<PrimitiveKeys<T>, N, I, 'text2vec-weaviate'>} The configuration object.

0 commit comments

Comments
 (0)