Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions src/collections/aggregate/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }),
}),
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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<any> = [];
Expand Down
42 changes: 21 additions & 21 deletions src/collections/config/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<TestCollectionConfigGet>(collectionName);
const config = await collection.config.get();
Expand Down Expand Up @@ -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<TestCollectionConfigGet>(collectionName);
const config = await collection.config.get();
Expand Down Expand Up @@ -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'],
}),
Expand Down Expand Up @@ -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(),
}),
Expand All @@ -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(),
}),
Expand Down Expand Up @@ -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(),
}),
Expand All @@ -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(),
}),
Expand All @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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({
Expand All @@ -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(),
})
Expand Down Expand Up @@ -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()
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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();
Expand Down
23 changes: 23 additions & 0 deletions src/collections/configure/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ const vectorDistances = {
const configure = {
generative,
reranker,
/**
* @deprecated Use `vectors` instead.
*/
vectorizer,
vectors: vectorizer,
vectorIndex: configureVectorIndex,
dataType,
tokenization,
Expand Down Expand Up @@ -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.
Expand All @@ -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: <N extends string | undefined, I extends VectorIndexType>(
options: VectorizerUpdateOptions<N, I>
): VectorConfigUpdate<N, I> => {
return {
name: options?.name as N,
vectorIndex: options.vectorIndexConfig,
};
},
},
/**
* Create a `ReplicationConfigUpdate` object to be used when updating the replication configuration of Weaviate.
*
Expand Down
Loading