diff --git a/src/collections/aggregate/integration.test.ts b/src/collections/aggregate/integration.test.ts index 284606b6..051ff4f7 100644 --- a/src/collections/aggregate/integration.test.ts +++ b/src/collections/aggregate/integration.test.ts @@ -89,7 +89,7 @@ describe('Testing of the collection.aggregate methods', () => { // dataType: [collectionName], // }, ], - vectorizers: weaviate.configure.vectorizer.text2VecContextionary({ + vectorizers: weaviate.configure.vectors.text2VecContextionary({ vectorizeCollectionName: false, vectorIndexConfig: weaviate.configure.vectorIndex.hnsw({ maxConnections: 64 }), }), @@ -318,7 +318,7 @@ describe('Testing of the collection.aggregate methods with named vectors', () => }, ], vectorizers: [ - weaviate.configure.vectorizer.text2VecContextionary({ + weaviate.configure.vectors.text2VecContextionary({ name: 'text', sourceProperties: ['text'], vectorIndexConfig: weaviate.configure.vectorIndex.hnsw(), @@ -417,7 +417,7 @@ describe('Testing of collection.aggregate search methods', () => { dataType: 'text', }, ], - vectorizers: weaviate.configure.vectorizer.text2VecContextionary(), + vectorizers: weaviate.configure.vectors.text2VecContextionary(), }) .then(() => { const data: Array = []; diff --git a/src/collections/config/integration.test.ts b/src/collections/config/integration.test.ts index 68163d5e..94f001cb 100644 --- a/src/collections/config/integration.test.ts +++ b/src/collections/config/integration.test.ts @@ -38,7 +38,7 @@ describe('Testing of the collection.config namespace', () => { dataType: 'text', }, ], - vectorizers: weaviate.configure.vectorizer.none(), + vectorizers: weaviate.configure.vectors.none(), }); const collection = client.collections.get(collectionName); const config = await collection.config.get(); @@ -93,7 +93,7 @@ describe('Testing of the collection.config namespace', () => { dataType: 'text', }, ], - vectorizers: weaviate.configure.vectorizer.none(), + vectorizers: weaviate.configure.vectors.none(), }); const collection = client.collections.get(collectionName); const config = await collection.config.get(); @@ -153,11 +153,11 @@ describe('Testing of the collection.config namespace', () => { }, ], vectorizers: [ - weaviate.configure.vectorizer.text2VecContextionary({ + weaviate.configure.vectors.text2VecContextionary({ name: 'title', sourceProperties: ['title'], }), - weaviate.configure.vectorizer.text2VecContextionary({ + weaviate.configure.vectors.text2VecContextionary({ name: 'age', sourceProperties: ['age'], }), @@ -190,7 +190,7 @@ describe('Testing of the collection.config namespace', () => { const collectionName = 'TestCollectionConfigGetHNSWPlusPQ'; const collection = await client.collections.create({ name: collectionName, - vectorizers: weaviate.configure.vectorizer.none({ + vectorizers: weaviate.configure.vectors.none({ vectorIndexConfig: weaviate.configure.vectorIndex.hnsw({ quantizer: weaviate.configure.vectorIndex.quantizer.pq(), }), @@ -215,7 +215,7 @@ describe('Testing of the collection.config namespace', () => { const query = () => client.collections.create({ name: collectionName, - vectorizers: weaviate.configure.vectorizer.none({ + vectorizers: weaviate.configure.vectors.none({ vectorIndexConfig: weaviate.configure.vectorIndex.hnsw({ quantizer: weaviate.configure.vectorIndex.quantizer.bq(), }), @@ -243,7 +243,7 @@ describe('Testing of the collection.config namespace', () => { const collectionName = 'TestCollectionConfigGetHNSWPlusSQ'; const collection = await client.collections.create({ name: collectionName, - vectorizers: weaviate.configure.vectorizer.none({ + vectorizers: weaviate.configure.vectors.none({ vectorIndexConfig: weaviate.configure.vectorIndex.hnsw({ quantizer: weaviate.configure.vectorIndex.quantizer.sq(), }), @@ -267,7 +267,7 @@ describe('Testing of the collection.config namespace', () => { const collectionName = 'TestCollectionConfigGetFlatPlusBQ'; const collection = await client.collections.create({ name: collectionName, - vectorizers: weaviate.configure.vectorizer.none({ + vectorizers: weaviate.configure.vectors.none({ vectorIndexConfig: weaviate.configure.vectorIndex.flat({ quantizer: weaviate.configure.vectorIndex.quantizer.bq(), }), @@ -294,7 +294,7 @@ describe('Testing of the collection.config namespace', () => { const query = () => asyncIndexing.collections.create({ name: collectionName, - vectorizers: weaviate.configure.vectorizer.none({ + vectorizers: weaviate.configure.vectors.none({ vectorIndexConfig: weaviate.configure.vectorIndex.dynamic({ hnsw: weaviate.configure.vectorIndex.hnsw({ quantizer: weaviate.configure.vectorIndex.quantizer.pq(), @@ -335,7 +335,7 @@ describe('Testing of the collection.config namespace', () => { const query = () => asyncIndexing.collections.create({ name: collectionName, - vectorizers: weaviate.configure.vectorizer.none({ + vectorizers: weaviate.configure.vectors.none({ vectorIndexConfig: weaviate.configure.vectorIndex.dynamic({ hnsw: weaviate.configure.vectorIndex.hnsw({ quantizer: weaviate.configure.vectorIndex.quantizer.pq(), @@ -373,7 +373,7 @@ describe('Testing of the collection.config namespace', () => { const collectionName = 'TestCollectionConfigAddProperty'; const collection = await client.collections.create({ name: collectionName, - vectorizers: weaviate.configure.vectorizer.none(), + vectorizers: weaviate.configure.vectors.none(), }); const config = await collection.config .addProperty({ @@ -401,7 +401,7 @@ describe('Testing of the collection.config namespace', () => { const collectionName = 'TestCollectionConfigAddReference' as const; const collection = await client.collections.create({ name: collectionName, - vectorizers: weaviate.configure.vectorizer.none(), + vectorizers: weaviate.configure.vectors.none(), }); const config = await collection.config .addReference({ @@ -423,20 +423,20 @@ describe('Testing of the collection.config namespace', () => { const collectionName = 'TestCollectionConfigAddVector' as const; const collection = await client.collections.create({ name: collectionName, - vectorizers: weaviate.configure.vectorizer.none(), + vectorizers: weaviate.configure.vectors.none(), }); // Add a single named vector - await collection.config.addVector(weaviate.configure.vectorizer.none({ name: 'vector-a' })); + await collection.config.addVector(weaviate.configure.vectors.none({ name: 'vector-a' })); // Add several named vectors await collection.config.addVector([ - weaviate.configure.vectorizer.none({ name: 'vector-b' }), - weaviate.configure.vectorizer.none({ name: 'vector-c' }), + weaviate.configure.vectors.none({ name: 'vector-b' }), + weaviate.configure.vectors.none({ name: 'vector-c' }), ]); // Trying to update 'default' vector -- should be omitted from request. await collection.config.addVector( - weaviate.configure.vectorizer.none({ + weaviate.configure.vectors.none({ name: 'default', vectorIndexConfig: weaviate.configure.vectorIndex.flat(), }) @@ -525,7 +525,7 @@ describe('Testing of the collection.config namespace', () => { dataType: 'text', }, ], - vectorizers: weaviate.configure.vectorizer.none(), + vectorizers: weaviate.configure.vectors.none(), }); const supportsUpdatingPropertyDescriptions = await client .getWeaviateVersion() @@ -537,7 +537,7 @@ describe('Testing of the collection.config namespace', () => { testProp: 'This is a test property', } : undefined, - vectorizers: weaviate.reconfigure.vectorizer.update({ + vectorizers: weaviate.reconfigure.vectors.update({ vectorIndexConfig: weaviate.reconfigure.vectorIndex.hnsw({ quantizer: weaviate.reconfigure.vectorIndex.quantizer.pq(), ef: 4, @@ -672,7 +672,7 @@ describe('Testing of the collection.config namespace', () => { const collection = client.collections.use(collectionName); const config = await collection.config .update({ - vectorizers: weaviate.reconfigure.vectorizer.update({ + vectorizers: weaviate.reconfigure.vectors.update({ vectorIndexConfig: weaviate.reconfigure.vectorIndex.hnsw({ quantizer: weaviate.reconfigure.vectorIndex.quantizer.pq(), ef: 4, @@ -723,7 +723,7 @@ describe('Testing of the collection.config namespace', () => { const collection = client.collections.use(collectionName); await client.collections.create({ name: collectionName, - vectorizers: weaviate.configure.vectorizer.none(), + vectorizers: weaviate.configure.vectors.none(), }); let config = await collection.config.get(); expect(config.generative).toBeUndefined(); diff --git a/src/collections/configure/index.ts b/src/collections/configure/index.ts index f80f7c50..9a508d4c 100644 --- a/src/collections/configure/index.ts +++ b/src/collections/configure/index.ts @@ -59,7 +59,11 @@ const vectorDistances = { const configure = { generative, reranker, + /** + * @deprecated Use `vectors` instead. + */ vectorizer, + vectors: vectorizer, vectorIndex: configureVectorIndex, dataType, tokenization, @@ -219,6 +223,9 @@ const reconfigure = { : undefined, }; }, + /** + * @deprecated Use `vectors` instead. + */ vectorizer: { /** * Create a `VectorConfigUpdate` object to be used when updating the named vector configuration of Weaviate. @@ -235,6 +242,22 @@ const reconfigure = { }; }, }, + vectors: { + /** + * Create a `VectorConfigUpdate` object to be used when updating the named vector configuration of Weaviate. + * + * @param {string} name The name of the vector. + * @param {VectorizerOptions} options The options for the named vector. + */ + update: ( + options: VectorizerUpdateOptions + ): VectorConfigUpdate => { + return { + name: options?.name as N, + vectorIndex: options.vectorIndexConfig, + }; + }, + }, /** * Create a `ReplicationConfigUpdate` object to be used when updating the replication configuration of Weaviate. * diff --git a/src/collections/configure/unit.test.ts b/src/collections/configure/unit.test.ts index 0eddb278..7179a434 100644 --- a/src/collections/configure/unit.test.ts +++ b/src/collections/configure/unit.test.ts @@ -252,7 +252,7 @@ describe('Unit testing of the configure & reconfigure factory classes', () => { describe('Unit testing of the vectorizer factory class', () => { it('should create the correct Img2VecNeuralConfig type with all values', () => { - const config = configure.vectorizer.img2VecNeural({ + const config = configure.vectors.img2VecNeural({ name: 'test', imageFields: ['field1', 'field2'], }); @@ -272,7 +272,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Multi2VecCohereConfig type with defaults', () => { - const config = configure.vectorizer.multi2VecCohere(); + const config = configure.vectors.multi2VecCohere(); expect(config).toEqual>({ name: undefined, vectorIndex: { @@ -287,7 +287,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Multi2VecCohereConfig type with all values', () => { - const config = configure.vectorizer.multi2VecCohere({ + const config = configure.vectors.multi2VecCohere({ name: 'test', model: 'model', vectorizeCollectionName: true, @@ -309,7 +309,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Multi2VecCohereConfig type with all values and weights', () => { - const config = configure.vectorizer.multi2VecCohere({ + const config = configure.vectors.multi2VecCohere({ name: 'test', model: 'model', imageFields: [ @@ -345,7 +345,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Multi2VecClipConfig type with defaults', () => { - const config = configure.vectorizer.multi2VecClip(); + const config = configure.vectors.multi2VecClip(); expect(config).toEqual>({ name: undefined, vectorIndex: { @@ -360,7 +360,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Multi2VecClipConfig type with all values', () => { - const config = configure.vectorizer.multi2VecClip({ + const config = configure.vectors.multi2VecClip({ name: 'test', imageFields: ['field1', 'field2'], textFields: ['field3', 'field4'], @@ -384,7 +384,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Multi2VecClipConfig type with all values and weights', () => { - const config = configure.vectorizer.multi2VecClip({ + const config = configure.vectors.multi2VecClip({ name: 'test', imageFields: [ { name: 'field1', weight: 0.1 }, @@ -418,7 +418,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Multi2VecBindConfig type with defaults', () => { - const config = configure.vectorizer.multi2VecBind(); + const config = configure.vectors.multi2VecBind(); expect(config).toEqual>({ name: undefined, vectorIndex: { @@ -433,7 +433,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Multi2VecBindConfig type with all values', () => { - const config = configure.vectorizer.multi2VecBind({ + const config = configure.vectors.multi2VecBind({ name: 'test', audioFields: ['field1', 'field2'], depthFields: ['field3', 'field4'], @@ -467,7 +467,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Multi2VecBindConfig type with all values and weights', () => { - const config = configure.vectorizer.multi2VecBind({ + const config = configure.vectors.multi2VecBind({ name: 'test', audioFields: [ { name: 'field1', weight: 0.1 }, @@ -531,7 +531,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Multi2VecGoogleConfig type with defaults', () => { - const config = configure.vectorizer.multi2VecGoogle({ + const config = configure.vectors.multi2VecGoogle({ projectId: 'project-id', location: 'location', }); @@ -552,7 +552,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Multi2VecGoogleonfig type with all values', () => { - const config = configure.vectorizer.multi2VecGoogle({ + const config = configure.vectors.multi2VecGoogle({ name: 'test', projectId: 'project-id', imageFields: ['field1', 'field2'], @@ -586,7 +586,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Multi2VecGoogleConfig type with all values and weights', () => { - const config = configure.vectorizer.multi2VecGoogle({ + const config = configure.vectors.multi2VecGoogle({ name: 'test', projectId: 'project-id', imageFields: [ @@ -634,7 +634,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Multi2VecJinaAIConfig type with defaults', () => { - const config = configure.vectorizer.multi2VecJinaAI(); + const config = configure.vectors.multi2VecJinaAI(); expect(config).toEqual>({ name: undefined, vectorIndex: { @@ -649,7 +649,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Multi2VecJinaAIConfig type with all values and weights', () => { - const config = configure.vectorizer.multi2VecJinaAI({ + const config = configure.vectors.multi2VecJinaAI({ name: 'test', imageFields: [ { name: 'field1', weight: 0.1 }, @@ -683,7 +683,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Multi2VecPalmConfig type using deprecated method with defaults', () => { - const config = configure.vectorizer.multi2VecPalm({ + const config = configure.vectors.multi2VecPalm({ projectId: 'project-id', location: 'location', }); @@ -704,7 +704,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Multi2VecPalmConfig type using deprecated method with all values', () => { - const config = configure.vectorizer.multi2VecPalm({ + const config = configure.vectors.multi2VecPalm({ name: 'test', projectId: 'project-id', imageFields: ['field1', 'field2'], @@ -738,7 +738,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Multi2VecPalmConfig type using deprecated method with all values and weights', () => { - const config = configure.vectorizer.multi2VecPalm({ + const config = configure.vectors.multi2VecPalm({ name: 'test', projectId: 'project-id', imageFields: [ @@ -786,7 +786,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Multi2VecVoyageAIConfig type with defaults', () => { - const config = configure.vectorizer.multi2VecVoyageAI(); + const config = configure.vectors.multi2VecVoyageAI(); expect(config).toEqual>({ name: undefined, vectorIndex: { @@ -801,7 +801,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Multi2VecVoyageAIConfig type with all values', () => { - const config = configure.vectorizer.multi2VecVoyageAI({ + const config = configure.vectors.multi2VecVoyageAI({ baseURL: 'base-url', model: 'model', name: 'test', @@ -831,7 +831,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecAWSConfig type with defaults', () => { - const config = configure.vectorizer.text2VecAWS({ + const config = configure.vectors.text2VecAWS({ region: 'region', service: 'service', }); @@ -852,7 +852,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecAWSConfig type with all values', () => { - const config = configure.vectorizer.text2VecAWS({ + const config = configure.vectors.text2VecAWS({ name: 'test', endpoint: 'endpoint', model: 'model', @@ -880,7 +880,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecAzureOpenAIConfig type with defaults', () => { - const config = configure.vectorizer.text2VecAzureOpenAI({ + const config = configure.vectors.text2VecAzureOpenAI({ deploymentId: 'deployment-id', resourceName: 'resource-name', }); @@ -901,7 +901,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecAzureOpenAIConfig type with all values', () => { - const config = configure.vectorizer.text2VecAzureOpenAI({ + const config = configure.vectors.text2VecAzureOpenAI({ name: 'test', baseURL: 'base-url', deploymentId: 'deployment-id', @@ -927,7 +927,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecCohereConfig type with defaults', () => { - const config = configure.vectorizer.text2VecCohere(); + const config = configure.vectors.text2VecCohere(); expect(config).toEqual>({ name: undefined, vectorIndex: { @@ -942,7 +942,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecCohereConfig type with all values', () => { - const config = configure.vectorizer.text2VecCohere({ + const config = configure.vectors.text2VecCohere({ name: 'test', baseURL: 'base-url', model: 'model', @@ -968,7 +968,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecContextionaryConfig type with defaults', () => { - const config = configure.vectorizer.text2VecContextionary(); + const config = configure.vectors.text2VecContextionary(); expect(config).toEqual>({ name: undefined, vectorIndex: { @@ -983,7 +983,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecContextionaryConfig type with all values', () => { - const config = configure.vectorizer.text2VecContextionary({ + const config = configure.vectors.text2VecContextionary({ name: 'test', vectorizeCollectionName: true, }); @@ -1003,7 +1003,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecDatabricksConfig type with required & defaults', () => { - const config = configure.vectorizer.text2VecDatabricks({ + const config = configure.vectors.text2VecDatabricks({ name: 'test', endpoint: 'endpoint', }); @@ -1023,7 +1023,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecDatabricksConfig type with all values', () => { - const config = configure.vectorizer.text2VecDatabricks({ + const config = configure.vectors.text2VecDatabricks({ name: 'test', endpoint: 'endpoint', instruction: 'instruction', @@ -1047,7 +1047,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecGPT4AllConfig type with defaults', () => { - const config = configure.vectorizer.text2VecGPT4All(); + const config = configure.vectors.text2VecGPT4All(); expect(config).toEqual>({ name: undefined, vectorIndex: { @@ -1062,7 +1062,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecGPT4AllConfig type with all values', () => { - const config = configure.vectorizer.text2VecGPT4All({ + const config = configure.vectors.text2VecGPT4All({ name: 'test', vectorizeCollectionName: true, }); @@ -1082,7 +1082,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecHuggingFaceConfig type with defaults', () => { - const config = configure.vectorizer.text2VecHuggingFace(); + const config = configure.vectors.text2VecHuggingFace(); expect(config).toEqual>({ name: undefined, vectorIndex: { @@ -1097,7 +1097,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecHuggingFaceConfig type with all values', () => { - const config = configure.vectorizer.text2VecHuggingFace({ + const config = configure.vectors.text2VecHuggingFace({ name: 'test', endpointURL: 'endpoint-url', model: 'model', @@ -1131,7 +1131,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecJinaAIConfig type with defaults', () => { - const config = configure.vectorizer.text2VecJinaAI(); + const config = configure.vectors.text2VecJinaAI(); expect(config).toEqual>({ name: undefined, vectorIndex: { @@ -1146,7 +1146,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecJinaAIConfig type with all values', () => { - const config = configure.vectorizer.text2VecJinaAI({ + const config = configure.vectors.text2VecJinaAI({ name: 'test', model: 'model', vectorizeCollectionName: true, @@ -1168,7 +1168,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecNvidiaConfig type with defaults', () => { - const config = configure.vectorizer.text2VecNvidia(); + const config = configure.vectors.text2VecNvidia(); expect(config).toEqual>({ name: undefined, vectorIndex: { @@ -1183,7 +1183,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecNvidiaConfig type with all values', () => { - const config = configure.vectorizer.text2VecNvidia({ + const config = configure.vectors.text2VecNvidia({ name: 'test', baseURL: 'base-url', model: 'model', @@ -1209,7 +1209,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecMistralConfig type with defaults', () => { - const config = configure.vectorizer.text2VecMistral(); + const config = configure.vectors.text2VecMistral(); expect(config).toEqual>({ name: undefined, vectorIndex: { @@ -1224,7 +1224,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecMistralConfig type with all values', () => { - const config = configure.vectorizer.text2VecMistral({ + const config = configure.vectors.text2VecMistral({ baseURL: 'base-url', name: 'test', model: 'model', @@ -1248,7 +1248,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecOllamaConfig type with defaults', () => { - const config = configure.vectorizer.text2VecOllama(); + const config = configure.vectors.text2VecOllama(); expect(config).toEqual>({ name: undefined, vectorIndex: { @@ -1263,7 +1263,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecOllamaConfig type with all values', () => { - const config = configure.vectorizer.text2VecOllama({ + const config = configure.vectors.text2VecOllama({ name: 'test', apiEndpoint: 'api-endpoint', model: 'model', @@ -1287,7 +1287,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecOpenAIConfig type with defaults', () => { - const config = configure.vectorizer.text2VecOpenAI(); + const config = configure.vectors.text2VecOpenAI(); expect(config).toEqual>({ name: undefined, vectorIndex: { @@ -1302,7 +1302,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecOpenAIConfig type with all values', () => { - const config = configure.vectorizer.text2VecOpenAI({ + const config = configure.vectors.text2VecOpenAI({ name: 'test', baseURL: 'base-url', dimensions: 256, @@ -1332,7 +1332,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecGoogleConfig type with defaults', () => { - const config = configure.vectorizer.text2VecGoogle(); + const config = configure.vectors.text2VecGoogle(); expect(config).toEqual>({ name: undefined, vectorIndex: { @@ -1347,7 +1347,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecGoogleConfig type with all values', () => { - const config = configure.vectorizer.text2VecGoogle({ + const config = configure.vectors.text2VecGoogle({ name: 'test', apiEndpoint: 'api-endpoint', modelId: 'model-id', @@ -1373,7 +1373,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecPalmConfig type using deprecated method with defaults', () => { - const config = configure.vectorizer.text2VecPalm(); + const config = configure.vectors.text2VecPalm(); expect(config).toEqual>({ name: undefined, vectorIndex: { @@ -1388,7 +1388,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecPalmConfig type using deprecated method with all values', () => { - const config = configure.vectorizer.text2VecPalm({ + const config = configure.vectors.text2VecPalm({ name: 'test', apiEndpoint: 'api-endpoint', modelId: 'model-id', @@ -1414,7 +1414,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecTransformersConfig type with defaults', () => { - const config = configure.vectorizer.text2VecTransformers(); + const config = configure.vectors.text2VecTransformers(); expect(config).toEqual>({ name: undefined, vectorIndex: { @@ -1429,7 +1429,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecTransformersConfig type with all values', () => { - const config = configure.vectorizer.text2VecTransformers({ + const config = configure.vectors.text2VecTransformers({ name: 'test', poolingStrategy: 'pooling-strategy', vectorizeCollectionName: true, @@ -1451,7 +1451,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecVoyageAIConfig type with defaults', () => { - const config = configure.vectorizer.text2VecVoyageAI(); + const config = configure.vectors.text2VecVoyageAI(); expect(config).toEqual>({ name: undefined, vectorIndex: { @@ -1466,7 +1466,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecVoyageConfig type with all values', () => { - const config = configure.vectorizer.text2VecVoyageAI({ + const config = configure.vectors.text2VecVoyageAI({ name: 'test', baseURL: 'base-url', model: 'model', @@ -1492,7 +1492,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecWeaviateConfig type with defaults', () => { - const config = configure.vectorizer.text2VecWeaviate(); + const config = configure.vectors.text2VecWeaviate(); expect(config).toEqual>({ name: undefined, vectorIndex: { @@ -1507,7 +1507,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecWeaviateConfig type with all values', () => { - const config = configure.vectorizer.text2VecWeaviate({ + const config = configure.vectors.text2VecWeaviate({ name: 'test', baseURL: 'base-url', dimensions: 256, diff --git a/src/collections/configure/vectorIndex.ts b/src/collections/configure/vectorIndex.ts index a9e8790e..6fd0c12b 100644 --- a/src/collections/configure/vectorIndex.ts +++ b/src/collections/configure/vectorIndex.ts @@ -29,7 +29,7 @@ const configure = { /** * Create a `ModuleConfig<'flat', VectorIndexConfigFlatCreate | undefined>` object when defining the configuration of the FLAT vector index. * - * Use this method when defining the `options.vectorIndexConfig` argument of the `configure.vectorizer` method. + * Use this method when defining the `options.vectorIndexConfig` argument of the `configure.vectors` method. * * @param {VectorIndexConfigFlatCreateOptions} [opts] The options available for configuring the flat vector index. * @returns {ModuleConfig<'flat', VectorIndexConfigFlatCreate | undefined>} The configuration object. @@ -50,7 +50,7 @@ const configure = { /** * Create a `ModuleConfig<'hnsw', VectorIndexConfigHNSWCreate | undefined>` object when defining the configuration of the HNSW vector index. * - * Use this method when defining the `options.vectorIndexConfig` argument of the `configure.vectorizer` method. + * Use this method when defining the `options.vectorIndexConfig` argument of the `configure.vectors` method. * * @param {VectorIndexConfigHNSWCreateOptions} [opts] The options available for configuring the HNSW vector index. * @returns {ModuleConfig<'hnsw', VectorIndexConfigHNSWCreate | undefined>} The configuration object. @@ -73,7 +73,7 @@ const configure = { /** * Create a `ModuleConfig<'dynamic', VectorIndexConfigDynamicCreate | undefined>` object when defining the configuration of the dynamic vector index. * - * Use this method when defining the `options.vectorIndexConfig` argument of the `configure.vectorizer` method. + * Use this method when defining the `options.vectorIndexConfig` argument of the `configure.vectors` method. * * @param {VectorIndexConfigDynamicCreateOptions} [opts] The options available for configuring the dynamic vector index. * @returns {ModuleConfig<'dynamic', VectorIndexConfigDynamicCreate | undefined>} The configuration object. @@ -167,7 +167,7 @@ const reconfigure = { /** * Create a `ModuleConfig<'flat', VectorIndexConfigFlatUpdate>` object to update the configuration of the FLAT vector index. * - * Use this method when defining the `options.vectorIndexConfig` argument of the `reconfigure.vectorizer` method. + * Use this method when defining the `options.vectorIndexConfig` argument of the `reconfigure.vectors` method. * * @param {VectorDistance} [options.distanceMetric] The distance metric to use. Default is 'cosine'. * @param {number} [options.vectorCacheMaxObjects] The maximum number of objects to cache in the vector cache. Default is 1000000000000. @@ -186,7 +186,7 @@ const reconfigure = { /** * Create a `ModuleConfig<'hnsw', VectorIndexConfigHNSWCreate>` object to update the configuration of the HNSW vector index. * - * Use this method when defining the `options.vectorIndexConfig` argument of the `reconfigure.vectorizer` method. + * Use this method when defining the `options.vectorIndexConfig` argument of the `reconfigure.vectors` method. * * @param {number} [options.dynamicEfFactor] The dynamic ef factor. Default is 8. * @param {number} [options.dynamicEfMax] The dynamic ef max. Default is 500. diff --git a/src/collections/data/integration.test.ts b/src/collections/data/integration.test.ts index 681609a2..8960bb46 100644 --- a/src/collections/data/integration.test.ts +++ b/src/collections/data/integration.test.ts @@ -798,8 +798,8 @@ describe('Testing of the collection.data methods with bring your own multi vecto }, ], vectorizers: [ - weaviate.configure.vectorizer.none({ name: 'one' }), - weaviate.configure.vectorizer.none({ name: 'two' }), + weaviate.configure.vectors.none({ name: 'one' }), + weaviate.configure.vectors.none({ name: 'two' }), ], }); if (await client.getWeaviateVersion().then((ver) => ver.isLowerThan(1, 24, 0))) { @@ -929,7 +929,7 @@ describe('Testing of the collection.data methods with a vector index', () => { dataType: 'text', }, ], - vectorizers: weaviate.configure.vectorizer.none(), + vectorizers: weaviate.configure.vectors.none(), }); }); diff --git a/src/collections/filters/integration.test.ts b/src/collections/filters/integration.test.ts index b634fc20..d9521fbe 100644 --- a/src/collections/filters/integration.test.ts +++ b/src/collections/filters/integration.test.ts @@ -57,7 +57,7 @@ describe('Testing of the filter class with a simple collection', () => { }, ], invertedIndex: weaviate.configure.invertedIndex({ indexTimestamps: true }), - vectorizers: weaviate.configure.vectorizer.text2VecContextionary({ + vectorizers: weaviate.configure.vectors.text2VecContextionary({ vectorizeCollectionName: false, }), }) @@ -320,7 +320,7 @@ describe('Testing of the filter class with complex data types', () => { dataType: 'uuid', }, ], - vectorizers: weaviate.configure.vectorizer.text2VecContextionary(), + vectorizers: weaviate.configure.vectors.text2VecContextionary(), }) .then(() => collection.data.insertMany([ diff --git a/src/collections/generate/integration.test.ts b/src/collections/generate/integration.test.ts index 39e8e351..3ceb8d99 100644 --- a/src/collections/generate/integration.test.ts +++ b/src/collections/generate/integration.test.ts @@ -54,7 +54,7 @@ maybe('Testing of the collection.generate methods with a simple collection', () }, ], generative: weaviate.configure.generative.openAI(), - vectorizers: weaviate.configure.vectorizer.text2VecOpenAI({ + vectorizers: weaviate.configure.vectors.text2VecOpenAI({ vectorizeCollectionName: false, }), }) @@ -215,7 +215,7 @@ maybe('Testing of the groupBy collection.generate methods with a simple collecti }, ], generative: weaviate.configure.generative.openAI(), - vectorizers: weaviate.configure.vectorizer.text2VecOpenAI({ + vectorizers: weaviate.configure.vectors.text2VecOpenAI({ vectorizeCollectionName: false, }), }) @@ -365,11 +365,11 @@ maybe('Testing of the collection.generate methods with a multi vector collection }, ], vectorizers: [ - weaviate.configure.vectorizer.text2VecOpenAI({ + weaviate.configure.vectors.text2VecOpenAI({ name: 'title', sourceProperties: ['title'], }), - weaviate.configure.vectorizer.text2VecOpenAI({ + weaviate.configure.vectors.text2VecOpenAI({ name: 'title2', sourceProperties: ['title'], }), diff --git a/src/collections/integration.test.ts b/src/collections/integration.test.ts index df424745..905f83ce 100644 --- a/src/collections/integration.test.ts +++ b/src/collections/integration.test.ts @@ -102,7 +102,7 @@ describe('Testing of the collections.create method', () => { vectorizePropertyName: true, }, ], - vectorizers: weaviate.configure.vectorizer.text2VecContextionary(), + vectorizers: weaviate.configure.vectors.text2VecContextionary(), }) .then((collection) => collection.config.get()) .then((config) => @@ -138,7 +138,7 @@ describe('Testing of the collections.create method', () => { vectorizePropertyName: true, }, ], - vectorizers: weaviate.configure.vectorizer.text2VecContextionary(), + vectorizers: weaviate.configure.vectors.text2VecContextionary(), }) .then((collection) => collection.config.get()) .then(async (config) => @@ -179,7 +179,7 @@ describe('Testing of the collections.create method', () => { const response = await contextionary.collections .create({ name: collectionName, - vectorizers: weaviate.configure.vectorizer.none({ name: 'custom' }), + vectorizers: weaviate.configure.vectors.none({ name: 'custom' }), }) .then(() => contextionary.collections.use(collectionName).config.get()); expect(response.name).toEqual(collectionName); @@ -507,7 +507,7 @@ describe('Testing of the collections.create method', () => { replication: { factor: 2, }, - vectorizers: weaviate.configure.vectorizer.text2VecContextionary({ + vectorizers: weaviate.configure.vectors.text2VecContextionary({ vectorIndexConfig: { name: 'hnsw' as const, config: { @@ -628,7 +628,7 @@ describe('Testing of the collections.create method', () => { expect(response.vectorizers.default.vectorizer.name).toEqual('text2vec-contextionary'); }); - it('should be able to create a collection with the contextionary vectorizer using configure.vectorizer', async () => { + it('should be able to create a collection with the contextionary vectorizer using configure.vectors', async () => { const collectionName = 'ThisOneIsATest'; // must include words in contextionary's vocabulary to pass since vectorizeCollectionName will be true const response = await contextionary.collections .create({ @@ -639,7 +639,7 @@ describe('Testing of the collections.create method', () => { dataType: 'text', }, ], - vectorizers: weaviate.configure.vectorizer.text2VecContextionary(), + vectorizers: weaviate.configure.vectors.text2VecContextionary(), }) .then(async (collection) => expect(await collection.exists()).toEqual(true)) .then(() => contextionary.collections.use(collectionName).config.get()); @@ -656,7 +656,7 @@ describe('Testing of the collections.create method', () => { ).toEqual(true); }); - it('should be able to create a collection with an openai vectorizer with configure.vectorizer', async () => { + it('should be able to create a collection with an openai vectorizer with configure.vectors', async () => { const collectionName = 'TestCollectionOpenAIVectorizerWithConfigureVectorizer'; const response = await openai.collections .create({ @@ -667,7 +667,7 @@ describe('Testing of the collections.create method', () => { dataType: 'text', }, ], - vectorizers: weaviate.configure.vectorizer.text2VecOpenAI(), + vectorizers: weaviate.configure.vectors.text2VecOpenAI(), }) .then(async (collection) => expect(await collection.exists()).toEqual(true)) .then(() => openai.collections.use(collectionName).config.get()); diff --git a/src/collections/iterator/integration.test.ts b/src/collections/iterator/integration.test.ts index c4757083..4e7a95dc 100644 --- a/src/collections/iterator/integration.test.ts +++ b/src/collections/iterator/integration.test.ts @@ -33,7 +33,7 @@ describe('Testing of the collection.iterator method with a simple collection', ( dataType: 'text', }, ], - vectorizers: weaviate.configure.vectorizer.text2VecContextionary({ + vectorizers: weaviate.configure.vectors.text2VecContextionary({ vectorizeCollectionName: false, }), }) diff --git a/src/collections/journey.test.ts b/src/collections/journey.test.ts index 85da3a8f..cdc32a22 100644 --- a/src/collections/journey.test.ts +++ b/src/collections/journey.test.ts @@ -46,7 +46,7 @@ describe('Journey testing of the client using a WCD cluster', () => { ], generative: weaviate.configure.generative.cohere(), reranker: weaviate.configure.reranker.cohere(), - vectorizers: weaviate.configure.vectorizer.text2VecCohere(), + vectorizers: weaviate.configure.vectors.text2VecCohere(), }); }); diff --git a/src/collections/query/integration.test.ts b/src/collections/query/integration.test.ts index 8e559c96..f6cb2ae7 100644 --- a/src/collections/query/integration.test.ts +++ b/src/collections/query/integration.test.ts @@ -45,7 +45,7 @@ describe('Testing of the collection.query methods with a simple collection', () vectorizePropertyName: false, }, ], - vectorizers: weaviate.configure.vectorizer.text2VecContextionary({ + vectorizers: weaviate.configure.vectors.text2VecContextionary({ vectorizeCollectionName: false, }), }) @@ -271,7 +271,7 @@ describe('Testing of the collection.query methods with a collection with a refer targetCollection: collectionName, }, ], - vectorizers: weaviate.configure.vectorizer.text2VecContextionary({ + vectorizers: weaviate.configure.vectors.text2VecContextionary({ vectorizeCollectionName: false, }), }) @@ -520,7 +520,7 @@ describe('Testing of the collection.query methods with a collection with a neste ], }, ], - vectorizers: weaviate.configure.vectorizer.text2VecContextionary(), + vectorizers: weaviate.configure.vectors.text2VecContextionary(), }) .then(async () => { id1 = await collection.data.insert({ @@ -612,11 +612,11 @@ describe('Testing of the collection.query methods with a collection with a multi }, ], vectorizers: [ - weaviate.configure.vectorizer.text2VecContextionary({ + weaviate.configure.vectors.text2VecContextionary({ name: 'title', sourceProperties: ['title'], }), - weaviate.configure.vectorizer.text2VecContextionary({ + weaviate.configure.vectors.text2VecContextionary({ name: 'title2', sourceProperties: ['title'], }), @@ -1119,7 +1119,7 @@ describe('Testing of the groupBy collection.query methods with a simple collecti dataType: 'text', }, ], - vectorizers: weaviate.configure.vectorizer.text2VecContextionary({ + vectorizers: weaviate.configure.vectors.text2VecContextionary({ vectorizeCollectionName: false, }), }) @@ -1281,7 +1281,7 @@ describe('Testing of the collection.query methods with a multi-tenancy collectio }, ], multiTenancy: weaviate.configure.multiTenancy({ enabled: true }), - vectorizers: weaviate.configure.vectorizer.text2VecContextionary({ + vectorizers: weaviate.configure.vectors.text2VecContextionary({ vectorizeCollectionName: false, }), }) @@ -1429,7 +1429,7 @@ describe('Testing of the collection.query methods with a multi-tenancy collectio // }, // ], // reranker: weaviate.configure.reranker.transformers(), -// vectorizers: weaviate.configure.vectorizer.text2VecOpenAI(), +// vectorizers: weaviate.configure.vectors.text2VecOpenAI(), // }) // .then(() => // Promise.all([