Skip to content

Commit c654df2

Browse files
committed
Merge branch 'main' of https://github.com/weaviate/typescript-client into 1.29/colbert-multivector-support
2 parents 77cc99e + 60c76dc commit c654df2

File tree

12 files changed

+133
-110
lines changed

12 files changed

+133
-110
lines changed

src/collections/aggregate/integration.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ describe('Testing of the collection.aggregate methods', () => {
8989
// dataType: [collectionName],
9090
// },
9191
],
92-
vectorizers: weaviate.configure.vectorizer.text2VecContextionary({
92+
vectorizers: weaviate.configure.vectors.text2VecContextionary({
9393
vectorizeCollectionName: false,
9494
vectorIndexConfig: weaviate.configure.vectorIndex.hnsw({ maxConnections: 64 }),
9595
}),
@@ -318,7 +318,7 @@ describe('Testing of the collection.aggregate methods with named vectors', () =>
318318
},
319319
],
320320
vectorizers: [
321-
weaviate.configure.vectorizer.text2VecContextionary({
321+
weaviate.configure.vectors.text2VecContextionary({
322322
name: 'text',
323323
sourceProperties: ['text'],
324324
vectorIndexConfig: weaviate.configure.vectorIndex.hnsw(),
@@ -417,7 +417,7 @@ describe('Testing of collection.aggregate search methods', () => {
417417
dataType: 'text',
418418
},
419419
],
420-
vectorizers: weaviate.configure.vectorizer.text2VecContextionary(),
420+
vectorizers: weaviate.configure.vectors.text2VecContextionary(),
421421
})
422422
.then(() => {
423423
const data: Array<any> = [];

src/collections/config/integration.test.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('Testing of the collection.config namespace', () => {
3434
dataType: 'text',
3535
},
3636
],
37-
vectorizers: weaviate.configure.vectorizer.none(),
37+
vectorizers: weaviate.configure.vectors.none(),
3838
});
3939
const collection = client.collections.get<TestCollectionConfigGet>(collectionName);
4040
const config = await collection.config.get();
@@ -90,7 +90,7 @@ describe('Testing of the collection.config namespace', () => {
9090
dataType: 'text',
9191
},
9292
],
93-
vectorizers: weaviate.configure.vectorizer.none(),
93+
vectorizers: weaviate.configure.vectors.none(),
9494
});
9595
const collection = client.collections.get<TestCollectionConfigGet>(collectionName);
9696
const config = await collection.config.get();
@@ -151,11 +151,11 @@ describe('Testing of the collection.config namespace', () => {
151151
},
152152
],
153153
vectorizers: [
154-
weaviate.configure.vectorizer.text2VecContextionary({
154+
weaviate.configure.vectors.text2VecContextionary({
155155
name: 'title',
156156
sourceProperties: ['title'],
157157
}),
158-
weaviate.configure.vectorizer.text2VecContextionary({
158+
weaviate.configure.vectors.text2VecContextionary({
159159
name: 'age',
160160
sourceProperties: ['age'],
161161
}),
@@ -188,7 +188,7 @@ describe('Testing of the collection.config namespace', () => {
188188
const collectionName = 'TestCollectionConfigGetHNSWPlusPQ';
189189
const collection = await client.collections.create({
190190
name: collectionName,
191-
vectorizers: weaviate.configure.vectorizer.none({
191+
vectorizers: weaviate.configure.vectors.none({
192192
vectorIndexConfig: weaviate.configure.vectorIndex.hnsw({
193193
quantizer: weaviate.configure.vectorIndex.quantizer.pq(),
194194
}),
@@ -237,7 +237,7 @@ describe('Testing of the collection.config namespace', () => {
237237
const query = () =>
238238
client.collections.create({
239239
name: collectionName,
240-
vectorizers: weaviate.configure.vectorizer.none({
240+
vectorizers: weaviate.configure.vectors.none({
241241
vectorIndexConfig: weaviate.configure.vectorIndex.hnsw({
242242
quantizer: weaviate.configure.vectorIndex.quantizer.bq(),
243243
}),
@@ -265,7 +265,7 @@ describe('Testing of the collection.config namespace', () => {
265265
const collectionName = 'TestCollectionConfigGetHNSWPlusSQ';
266266
const collection = await client.collections.create({
267267
name: collectionName,
268-
vectorizers: weaviate.configure.vectorizer.none({
268+
vectorizers: weaviate.configure.vectors.none({
269269
vectorIndexConfig: weaviate.configure.vectorIndex.hnsw({
270270
quantizer: weaviate.configure.vectorIndex.quantizer.sq(),
271271
}),
@@ -289,7 +289,7 @@ describe('Testing of the collection.config namespace', () => {
289289
const collectionName = 'TestCollectionConfigGetFlatPlusBQ';
290290
const collection = await client.collections.create({
291291
name: collectionName,
292-
vectorizers: weaviate.configure.vectorizer.none({
292+
vectorizers: weaviate.configure.vectors.none({
293293
vectorIndexConfig: weaviate.configure.vectorIndex.flat({
294294
quantizer: weaviate.configure.vectorIndex.quantizer.bq(),
295295
}),
@@ -316,7 +316,7 @@ describe('Testing of the collection.config namespace', () => {
316316
const query = () =>
317317
asyncIndexing.collections.create({
318318
name: collectionName,
319-
vectorizers: weaviate.configure.vectorizer.none({
319+
vectorizers: weaviate.configure.vectors.none({
320320
vectorIndexConfig: weaviate.configure.vectorIndex.dynamic({
321321
hnsw: weaviate.configure.vectorIndex.hnsw({
322322
quantizer: weaviate.configure.vectorIndex.quantizer.pq(),
@@ -357,7 +357,7 @@ describe('Testing of the collection.config namespace', () => {
357357
const query = () =>
358358
asyncIndexing.collections.create({
359359
name: collectionName,
360-
vectorizers: weaviate.configure.vectorizer.none({
360+
vectorizers: weaviate.configure.vectors.none({
361361
vectorIndexConfig: weaviate.configure.vectorIndex.dynamic({
362362
hnsw: weaviate.configure.vectorIndex.hnsw({
363363
quantizer: weaviate.configure.vectorIndex.quantizer.pq(),
@@ -395,7 +395,7 @@ describe('Testing of the collection.config namespace', () => {
395395
const collectionName = 'TestCollectionConfigAddProperty';
396396
const collection = await client.collections.create({
397397
name: collectionName,
398-
vectorizers: weaviate.configure.vectorizer.none(),
398+
vectorizers: weaviate.configure.vectors.none(),
399399
});
400400
const config = await collection.config
401401
.addProperty({
@@ -423,7 +423,7 @@ describe('Testing of the collection.config namespace', () => {
423423
const collectionName = 'TestCollectionConfigAddReference' as const;
424424
const collection = await client.collections.create({
425425
name: collectionName,
426-
vectorizers: weaviate.configure.vectorizer.none(),
426+
vectorizers: weaviate.configure.vectors.none(),
427427
});
428428
const config = await collection.config
429429
.addReference({
@@ -445,20 +445,20 @@ describe('Testing of the collection.config namespace', () => {
445445
const collectionName = 'TestCollectionConfigAddVector' as const;
446446
const collection = await client.collections.create({
447447
name: collectionName,
448-
vectorizers: weaviate.configure.vectorizer.none(),
448+
vectorizers: weaviate.configure.vectors.none(),
449449
});
450450
// Add a single named vector
451-
await collection.config.addVector(weaviate.configure.vectorizer.none({ name: 'vector-a' }));
451+
await collection.config.addVector(weaviate.configure.vectors.none({ name: 'vector-a' }));
452452

453453
// Add several named vectors
454454
await collection.config.addVector([
455-
weaviate.configure.vectorizer.none({ name: 'vector-b' }),
456-
weaviate.configure.vectorizer.none({ name: 'vector-c' }),
455+
weaviate.configure.vectors.none({ name: 'vector-b' }),
456+
weaviate.configure.vectors.none({ name: 'vector-c' }),
457457
]);
458458

459459
// Trying to update 'default' vector -- should be omitted from request.
460460
await collection.config.addVector(
461-
weaviate.configure.vectorizer.none({
461+
weaviate.configure.vectors.none({
462462
name: 'default',
463463
vectorIndexConfig: weaviate.configure.vectorIndex.flat(),
464464
})
@@ -547,7 +547,7 @@ describe('Testing of the collection.config namespace', () => {
547547
dataType: 'text',
548548
},
549549
],
550-
vectorizers: weaviate.configure.vectorizer.none(),
550+
vectorizers: weaviate.configure.vectors.none(),
551551
});
552552
const supportsUpdatingPropertyDescriptions = await client
553553
.getWeaviateVersion()
@@ -559,7 +559,7 @@ describe('Testing of the collection.config namespace', () => {
559559
testProp: 'This is a test property',
560560
}
561561
: undefined,
562-
vectorizers: weaviate.reconfigure.vectorizer.update({
562+
vectorizers: weaviate.reconfigure.vectors.update({
563563
vectorIndexConfig: weaviate.reconfigure.vectorIndex.hnsw({
564564
quantizer: weaviate.reconfigure.vectorIndex.quantizer.pq(),
565565
ef: 4,
@@ -695,7 +695,7 @@ describe('Testing of the collection.config namespace', () => {
695695
const collection = client.collections.use(collectionName);
696696
const config = await collection.config
697697
.update({
698-
vectorizers: weaviate.reconfigure.vectorizer.update({
698+
vectorizers: weaviate.reconfigure.vectors.update({
699699
vectorIndexConfig: weaviate.reconfigure.vectorIndex.hnsw({
700700
quantizer: weaviate.reconfigure.vectorIndex.quantizer.pq(),
701701
ef: 4,
@@ -747,7 +747,7 @@ describe('Testing of the collection.config namespace', () => {
747747
const collection = client.collections.use(collectionName);
748748
await client.collections.create({
749749
name: collectionName,
750-
vectorizers: weaviate.configure.vectorizer.none(),
750+
vectorizers: weaviate.configure.vectors.none(),
751751
});
752752
let config = await collection.config.get();
753753
expect(config.generative).toBeUndefined();

src/collections/configure/index.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ const configure = {
6060
generative,
6161
multiVectors,
6262
reranker,
63+
/**
64+
* @deprecated Use `vectors` instead.
65+
*/
6366
vectorizer,
67+
vectors: vectorizer,
6468
vectorIndex: configureVectorIndex,
6569
dataType,
6670
tokenization,
@@ -220,6 +224,9 @@ const reconfigure = {
220224
: undefined,
221225
};
222226
},
227+
/**
228+
* @deprecated Use `vectors` instead.
229+
*/
223230
vectorizer: {
224231
/**
225232
* Create a `VectorConfigUpdate` object to be used when updating the named vector configuration of Weaviate.
@@ -236,6 +243,22 @@ const reconfigure = {
236243
};
237244
},
238245
},
246+
vectors: {
247+
/**
248+
* Create a `VectorConfigUpdate` object to be used when updating the named vector configuration of Weaviate.
249+
*
250+
* @param {string} name The name of the vector.
251+
* @param {VectorizerOptions} options The options for the named vector.
252+
*/
253+
update: <N extends string | undefined, I extends VectorIndexType>(
254+
options: VectorizerUpdateOptions<N, I>
255+
): VectorConfigUpdate<N, I> => {
256+
return {
257+
name: options?.name as N,
258+
vectorIndex: options.vectorIndexConfig,
259+
};
260+
},
261+
},
239262
/**
240263
* Create a `ReplicationConfigUpdate` object to be used when updating the replication configuration of Weaviate.
241264
*

0 commit comments

Comments
 (0)