Skip to content

Commit e8acb1b

Browse files
committed
Merge branch 'main' of https://github.com/weaviate/typescript-client into snyk-upgrade-decf84fdea74321504fd74b6fe0382d0
2 parents 33786ae + 3c58156 commit e8acb1b

File tree

12 files changed

+931
-713
lines changed

12 files changed

+931
-713
lines changed

package-lock.json

Lines changed: 34 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"homepage": "https://github.com/weaviate/typescript-client#readme",
5353
"dependencies": {
5454
"abort-controller-x": "^0.5.0",
55-
"graphql": "^16.11.0",
55+
"graphql": "^16.12.0",
5656
"graphql-request": "^6.1.0",
5757
"long": "^5.3.2",
5858
"nice-grpc": "^2.1.12",

src/backup/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ import BackupRestorer from './backupRestorer.js';
66

77
export type Backend = 'filesystem' | 's3' | 'gcs' | 'azure';
88
export type BackupStatus = 'STARTED' | 'TRANSFERRING' | 'TRANSFERRED' | 'SUCCESS' | 'FAILED';
9-
export type BackupCompressionLevel = 'DefaultCompression' | 'BestSpeed' | 'BestCompression';
9+
export type BackupCompressionLevel =
10+
| 'DefaultCompression'
11+
| 'BestSpeed'
12+
| 'BestCompression'
13+
| 'ZstdBestSpeed'
14+
| 'ZstdDefaultCompression'
15+
| 'ZstdBestCompression'
16+
| 'NoCompression';
1017

1118
export interface Backup {
1219
creator: () => BackupCreator;

src/backup/journey.test.ts

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,6 @@ describe('creates backup with valid compression config values', () => {
693693
.withWaitForCompletion(true)
694694
.withConfig({
695695
CPUPercentage: 80,
696-
ChunkSize: 512,
697696
CompressionLevel: 'BestSpeed',
698697
})
699698
.do()
@@ -754,44 +753,6 @@ describe('fails creating backup with invalid compression config', () => {
754753
});
755754
});
756755

757-
it('fails creating backup with ChunkSize too high', () => {
758-
return client.backup
759-
.creator()
760-
.withIncludeClassNames(PIZZA_CLASS_NAME)
761-
.withBackend(BACKEND)
762-
.withBackupId(BACKUP_ID)
763-
.withConfig({
764-
ChunkSize: 513, // Max is 512
765-
})
766-
.do()
767-
.then(() => {
768-
throw new Error('should fail on create backup');
769-
})
770-
.catch((err: Error) => {
771-
expect(err.message).toContain('422');
772-
expect(err.message).toContain('ChunkSize');
773-
});
774-
});
775-
776-
it('fails creating backup with ChunkSize too low', () => {
777-
return client.backup
778-
.creator()
779-
.withIncludeClassNames(PIZZA_CLASS_NAME)
780-
.withBackend(BACKEND)
781-
.withBackupId(BACKUP_ID)
782-
.withConfig({
783-
ChunkSize: 1, // Min is 2
784-
})
785-
.do()
786-
.then(() => {
787-
throw new Error('should fail on create backup');
788-
})
789-
.catch((err: Error) => {
790-
expect(err.message).toContain('422');
791-
expect(err.message).toContain('ChunkSize');
792-
});
793-
});
794-
795756
it('cleans up', () => cleanupTestFood(client));
796757
});
797758

src/collections/backup/client.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ export const backup = (connection: Connection): Backup => {
118118
}
119119
if (args.config) {
120120
builder = builder.withConfig({
121-
ChunkSize: args.config.chunkSize,
122121
CompressionLevel: args.config.compressionLevel,
123122
CPUPercentage: args.config.cpuPercentage,
124123
});

src/collections/backup/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export type BackupReturn = BackupStatusReturn & {
3131

3232
/** Configuration options available when creating a backup */
3333
export type BackupConfigCreate = {
34-
/** The size of the chunks to use for the backup. */
34+
/** Deprecated: This parameter no longer has any effect. (The size of the chunks to use for the backup.) */
3535
chunkSize?: number;
3636
/** The standard of compression to use for the backup. */
3737
compressionLevel?: BackupCompressionLevel;

src/collections/config/types/vectorizer.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ export type Multi2VecCohereConfig = {
153153
imageFields?: string[];
154154
/** The specific model to use. */
155155
model?: string;
156+
/** The number of dimensions for the generated embeddings. */
157+
dimensions?: number;
156158
/** The text fields used when vectorizing. */
157159
textFields?: string[];
158160
/** The truncation strategy to use. */
@@ -371,6 +373,8 @@ export type Text2VecCohereConfig = {
371373
baseURL?: string;
372374
/** The model to use. */
373375
model?: string;
376+
/** The number of dimensions for the generated embeddings. */
377+
dimensions?: number;
374378
/** Whether to truncate the input texts to fit within the context length. */
375379
truncate?: boolean;
376380
/** Whether to vectorize the collection name. */
@@ -586,6 +590,8 @@ export type Text2VecVoyageAIConfig = {
586590
truncate?: boolean;
587591
/** Whether to vectorize the collection name. */
588592
vectorizeCollectionName?: boolean;
593+
/** The number of dimensions for the generated embeddings. */
594+
dimensions?: number;
589595
};
590596

591597
/**

src/collections/configure/unit.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ describe('Unit testing of the vectorizer factory class', () => {
331331
const config = configure.vectors.multi2VecCohere({
332332
name: 'test',
333333
model: 'model',
334+
dimensions: 512,
334335
imageFields: [
335336
{ name: 'field1', weight: 0.1 },
336337
{ name: 'field2', weight: 0.2 },
@@ -350,6 +351,7 @@ describe('Unit testing of the vectorizer factory class', () => {
350351
name: 'multi2vec-cohere',
351352
config: {
352353
model: 'model',
354+
dimensions: 512,
353355
imageFields: ['field1', 'field2'],
354356
textFields: ['field3', 'field4'],
355357
weights: {
@@ -1002,6 +1004,7 @@ describe('Unit testing of the vectorizer factory class', () => {
10021004
name: 'test',
10031005
baseURL: 'base-url',
10041006
model: 'model',
1007+
dimensions: 512,
10051008
truncate: true,
10061009
});
10071010
expect(config).toEqual<VectorConfigCreate<never, 'test', 'hnsw', 'text2vec-cohere'>>({
@@ -1015,6 +1018,7 @@ describe('Unit testing of the vectorizer factory class', () => {
10151018
config: {
10161019
baseURL: 'base-url',
10171020
model: 'model',
1021+
dimensions: 512,
10181022
truncate: true,
10191023
},
10201024
},
@@ -1542,6 +1546,7 @@ describe('Unit testing of the vectorizer factory class', () => {
15421546
baseURL: 'base-url',
15431547
model: 'model',
15441548
truncate: true,
1549+
dimensions: 256,
15451550
});
15461551
expect(config).toEqual<VectorConfigCreate<never, 'test', 'hnsw', 'text2vec-voyageai'>>({
15471552
name: 'test',
@@ -1555,6 +1560,7 @@ describe('Unit testing of the vectorizer factory class', () => {
15551560
baseURL: 'base-url',
15561561
model: 'model',
15571562
truncate: true,
1563+
dimensions: 256,
15581564
},
15591565
},
15601566
});

src/collections/journey.test.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ describe('Journey testing of the client using a WCD cluster', () => {
5757
.then(async (config) => {
5858
expect(config).toEqual<CollectionConfig>({
5959
name: collectionName,
60+
description: undefined,
6061
generative: {
6162
name: 'generative-cohere',
6263
config: {},
@@ -85,6 +86,8 @@ describe('Journey testing of the client using a WCD cluster', () => {
8586
{
8687
name: 'name',
8788
dataType: 'text',
89+
description: undefined,
90+
nestedProperties: undefined,
8891
indexFilterable: true,
8992
indexInverted: false,
9093
indexRangeFilters: false,
@@ -100,6 +103,8 @@ describe('Journey testing of the client using a WCD cluster', () => {
100103
{
101104
name: 'age',
102105
dataType: 'int',
106+
description: undefined,
107+
nestedProperties: undefined,
103108
indexFilterable: true,
104109
indexInverted: false,
105110
indexRangeFilters: false,
@@ -115,6 +120,8 @@ describe('Journey testing of the client using a WCD cluster', () => {
115120
{
116121
name: 'location',
117122
dataType: 'geoCoordinates',
123+
description: undefined,
124+
nestedProperties: undefined,
118125
indexFilterable: true,
119126
indexInverted: false,
120127
indexRangeFilters: false,
@@ -130,6 +137,8 @@ describe('Journey testing of the client using a WCD cluster', () => {
130137
{
131138
name: 'dateOfBirth',
132139
dataType: 'date',
140+
description: undefined,
141+
nestedProperties: undefined,
133142
indexFilterable: true,
134143
indexInverted: false,
135144
indexRangeFilters: false,
@@ -165,6 +174,7 @@ describe('Journey testing of the client using a WCD cluster', () => {
165174
},
166175
vectorizers: {
167176
default: {
177+
properties: undefined,
168178
vectorizer: {
169179
name: 'text2vec-cohere',
170180
config: {
@@ -182,7 +192,7 @@ describe('Journey testing of the client using a WCD cluster', () => {
182192
dynamicEfFactor: 8,
183193
ef: -1,
184194
efConstruction: 128,
185-
filterStrategy: 'sweeping',
195+
filterStrategy: 'acorn',
186196
flatSearchCutoff: 40000,
187197
maxConnections: (await client.getWeaviateVersion().then((ver) => ver.isLowerThan(1, 26, 0)))
188198
? 64

src/connection/grpc.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,6 @@ const getMetadataWithEmbeddingServiceAuth = (config: GrpcConnectionParams, beare
264264
...config.headers,
265265
authorization: bearerToken,
266266
'X-Weaviate-Cluster-Url': config.host,
267-
// keeping for backwards compatibility for older clusters for now. On newer clusters, Embedding Service reuses Authorization header.
268-
'X-Weaviate-Api-Key': bearerToken,
269267
}
270268
: config.headers
271269
);

0 commit comments

Comments
 (0)