chromadb 1.6.1 → 1.7.1-beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chromadb.d.ts +460 -182
- package/dist/chromadb.legacy-esm.js +794 -33
- package/dist/chromadb.mjs +794 -33
- package/dist/chromadb.mjs.map +1 -1
- package/dist/cjs/chromadb.cjs +796 -33
- package/dist/cjs/chromadb.cjs.map +1 -1
- package/dist/cjs/chromadb.d.cts +460 -182
- package/package.json +2 -2
- package/src/AdminClient.ts +272 -0
- package/src/ChromaClient.ts +66 -30
- package/src/Collection.ts +17 -58
- package/src/embeddings/HuggingFaceEmbeddingServerFunction.ts +31 -0
- package/src/generated/api.ts +563 -45
- package/src/generated/configuration.ts +5 -5
- package/src/generated/index.ts +2 -2
- package/src/generated/models.ts +79 -35
- package/src/generated/runtime.ts +5 -5
- package/src/index.ts +33 -1
- package/src/types.ts +75 -0
- package/src/utils.ts +17 -3
package/dist/chromadb.d.ts
CHANGED
|
@@ -1,70 +1,6 @@
|
|
|
1
1
|
import * as openai from 'openai';
|
|
2
2
|
import * as cohere_ai from 'cohere-ai';
|
|
3
3
|
|
|
4
|
-
interface IEmbeddingFunction {
|
|
5
|
-
generate(texts: string[]): Promise<number[][]>;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
declare enum IncludeEnum {
|
|
9
|
-
Documents = "documents",
|
|
10
|
-
Embeddings = "embeddings",
|
|
11
|
-
Metadatas = "metadatas",
|
|
12
|
-
Distances = "distances"
|
|
13
|
-
}
|
|
14
|
-
type Number = number;
|
|
15
|
-
type Embedding = Array<Number>;
|
|
16
|
-
type Embeddings = Array<Embedding>;
|
|
17
|
-
type Metadata = Record<string, string | number | boolean>;
|
|
18
|
-
type Metadatas = Array<Metadata>;
|
|
19
|
-
type Document = string;
|
|
20
|
-
type Documents = Array<Document>;
|
|
21
|
-
type ID = string;
|
|
22
|
-
type IDs = ID[];
|
|
23
|
-
type PositiveInteger = number;
|
|
24
|
-
type LiteralValue = string | number | boolean;
|
|
25
|
-
type ListLiteralValue = LiteralValue[];
|
|
26
|
-
type LiteralNumber = number;
|
|
27
|
-
type LogicalOperator = "$and" | "$or";
|
|
28
|
-
type InclusionOperator = "$in" | "$nin";
|
|
29
|
-
type WhereOperator = "$gt" | "$gte" | "$lt" | "$lte" | "$ne" | "$eq";
|
|
30
|
-
type OperatorExpression = {
|
|
31
|
-
[key in WhereOperator | InclusionOperator | LogicalOperator]?: LiteralValue | ListLiteralValue;
|
|
32
|
-
};
|
|
33
|
-
type BaseWhere = {
|
|
34
|
-
[key: string]: LiteralValue | OperatorExpression;
|
|
35
|
-
};
|
|
36
|
-
type LogicalWhere = {
|
|
37
|
-
[key in LogicalOperator]?: Where[];
|
|
38
|
-
};
|
|
39
|
-
type Where = BaseWhere | LogicalWhere;
|
|
40
|
-
type WhereDocumentOperator = "$contains" | LogicalOperator;
|
|
41
|
-
type WhereDocument = {
|
|
42
|
-
[key in WhereDocumentOperator]?: LiteralValue | LiteralNumber | WhereDocument[];
|
|
43
|
-
};
|
|
44
|
-
type CollectionType = {
|
|
45
|
-
name: string;
|
|
46
|
-
id: string;
|
|
47
|
-
metadata: Metadata | null;
|
|
48
|
-
};
|
|
49
|
-
type GetResponse = {
|
|
50
|
-
ids: IDs;
|
|
51
|
-
embeddings: null | Embeddings;
|
|
52
|
-
documents: (null | Document)[];
|
|
53
|
-
metadatas: (null | Metadata)[];
|
|
54
|
-
error: null | string;
|
|
55
|
-
};
|
|
56
|
-
type QueryResponse = {
|
|
57
|
-
ids: IDs[];
|
|
58
|
-
embeddings: null | Embeddings[];
|
|
59
|
-
documents: (null | Document)[][];
|
|
60
|
-
metadatas: (null | Metadata)[][];
|
|
61
|
-
distances: null | number[][];
|
|
62
|
-
};
|
|
63
|
-
type AddResponse = {
|
|
64
|
-
error: string;
|
|
65
|
-
};
|
|
66
|
-
type CollectionMetadata = Record<string, unknown>;
|
|
67
|
-
|
|
68
4
|
/**
|
|
69
5
|
* FastAPI
|
|
70
6
|
*
|
|
@@ -170,6 +106,7 @@ declare namespace Api {
|
|
|
170
106
|
embeddings?: Api.AddEmbedding.Embedding[];
|
|
171
107
|
metadatas?: Api.AddEmbedding.Metadata[];
|
|
172
108
|
documents?: string[];
|
|
109
|
+
uris?: string[];
|
|
173
110
|
ids: string[];
|
|
174
111
|
}
|
|
175
112
|
/**
|
|
@@ -188,6 +125,8 @@ declare namespace Api {
|
|
|
188
125
|
}
|
|
189
126
|
interface Count200Response {
|
|
190
127
|
}
|
|
128
|
+
interface CountCollections200Response {
|
|
129
|
+
}
|
|
191
130
|
interface CreateCollection {
|
|
192
131
|
name: string;
|
|
193
132
|
metadata?: Api.CreateCollection.Metadata;
|
|
@@ -203,6 +142,16 @@ declare namespace Api {
|
|
|
203
142
|
}
|
|
204
143
|
interface CreateCollection200Response {
|
|
205
144
|
}
|
|
145
|
+
interface CreateDatabase {
|
|
146
|
+
name: string;
|
|
147
|
+
}
|
|
148
|
+
interface CreateDatabase200Response {
|
|
149
|
+
}
|
|
150
|
+
interface CreateTenant {
|
|
151
|
+
name: string;
|
|
152
|
+
}
|
|
153
|
+
interface CreateTenant200Response {
|
|
154
|
+
}
|
|
206
155
|
interface DeleteCollection200Response {
|
|
207
156
|
}
|
|
208
157
|
interface DeleteEmbedding {
|
|
@@ -222,6 +171,8 @@ declare namespace Api {
|
|
|
222
171
|
}
|
|
223
172
|
interface GetCollection200Response {
|
|
224
173
|
}
|
|
174
|
+
interface GetDatabase200Response {
|
|
175
|
+
}
|
|
225
176
|
interface GetEmbedding {
|
|
226
177
|
ids?: string[];
|
|
227
178
|
where?: Api.GetEmbedding.Where;
|
|
@@ -237,7 +188,7 @@ declare namespace Api {
|
|
|
237
188
|
* @memberof GetEmbedding
|
|
238
189
|
*/
|
|
239
190
|
offset?: number;
|
|
240
|
-
include?: (Api.GetEmbedding.Include.EnumValueEnum | Api.GetEmbedding.Include.EnumValueEnum2 | Api.GetEmbedding.Include.EnumValueEnum3 | Api.GetEmbedding.Include.EnumValueEnum4)[];
|
|
191
|
+
include?: (Api.GetEmbedding.Include.EnumValueEnum | Api.GetEmbedding.Include.EnumValueEnum2 | Api.GetEmbedding.Include.EnumValueEnum3 | Api.GetEmbedding.Include.EnumValueEnum4 | Api.GetEmbedding.Include.EnumValueEnum5 | Api.GetEmbedding.Include.EnumValueEnum6)[];
|
|
241
192
|
}
|
|
242
193
|
/**
|
|
243
194
|
* @export
|
|
@@ -248,7 +199,7 @@ declare namespace Api {
|
|
|
248
199
|
}
|
|
249
200
|
interface WhereDocument {
|
|
250
201
|
}
|
|
251
|
-
type Include = Api.GetEmbedding.Include.EnumValueEnum | Api.GetEmbedding.Include.EnumValueEnum2 | Api.GetEmbedding.Include.EnumValueEnum3 | Api.GetEmbedding.Include.EnumValueEnum4;
|
|
202
|
+
type Include = Api.GetEmbedding.Include.EnumValueEnum | Api.GetEmbedding.Include.EnumValueEnum2 | Api.GetEmbedding.Include.EnumValueEnum3 | Api.GetEmbedding.Include.EnumValueEnum4 | Api.GetEmbedding.Include.EnumValueEnum5 | Api.GetEmbedding.Include.EnumValueEnum6;
|
|
252
203
|
/**
|
|
253
204
|
* @export
|
|
254
205
|
* @namespace Include
|
|
@@ -266,15 +217,25 @@ declare namespace Api {
|
|
|
266
217
|
enum EnumValueEnum4 {
|
|
267
218
|
Distances = "distances"
|
|
268
219
|
}
|
|
220
|
+
enum EnumValueEnum5 {
|
|
221
|
+
Uris = "uris"
|
|
222
|
+
}
|
|
223
|
+
enum EnumValueEnum6 {
|
|
224
|
+
Data = "data"
|
|
225
|
+
}
|
|
269
226
|
}
|
|
270
227
|
}
|
|
271
228
|
interface GetNearestNeighbors200Response {
|
|
272
229
|
}
|
|
230
|
+
interface GetTenant200Response {
|
|
231
|
+
}
|
|
273
232
|
interface HTTPValidationError {
|
|
274
233
|
detail?: Api.ValidationError[];
|
|
275
234
|
}
|
|
276
235
|
interface ListCollections200Response {
|
|
277
236
|
}
|
|
237
|
+
interface PreFlightChecks200Response {
|
|
238
|
+
}
|
|
278
239
|
interface QueryEmbedding {
|
|
279
240
|
where?: Api.QueryEmbedding.Where;
|
|
280
241
|
'where_document'?: Api.QueryEmbedding.WhereDocument;
|
|
@@ -284,7 +245,7 @@ declare namespace Api {
|
|
|
284
245
|
* @memberof QueryEmbedding
|
|
285
246
|
*/
|
|
286
247
|
'n_results'?: number;
|
|
287
|
-
include?: (Api.QueryEmbedding.Include.EnumValueEnum | Api.QueryEmbedding.Include.EnumValueEnum2 | Api.QueryEmbedding.Include.EnumValueEnum3 | Api.QueryEmbedding.Include.EnumValueEnum4)[];
|
|
248
|
+
include?: (Api.QueryEmbedding.Include.EnumValueEnum | Api.QueryEmbedding.Include.EnumValueEnum2 | Api.QueryEmbedding.Include.EnumValueEnum3 | Api.QueryEmbedding.Include.EnumValueEnum4 | Api.QueryEmbedding.Include.EnumValueEnum5 | Api.QueryEmbedding.Include.EnumValueEnum6)[];
|
|
288
249
|
}
|
|
289
250
|
/**
|
|
290
251
|
* @export
|
|
@@ -297,7 +258,7 @@ declare namespace Api {
|
|
|
297
258
|
}
|
|
298
259
|
interface QueryEmbedding2 {
|
|
299
260
|
}
|
|
300
|
-
type Include = Api.QueryEmbedding.Include.EnumValueEnum | Api.QueryEmbedding.Include.EnumValueEnum2 | Api.QueryEmbedding.Include.EnumValueEnum3 | Api.QueryEmbedding.Include.EnumValueEnum4;
|
|
261
|
+
type Include = Api.QueryEmbedding.Include.EnumValueEnum | Api.QueryEmbedding.Include.EnumValueEnum2 | Api.QueryEmbedding.Include.EnumValueEnum3 | Api.QueryEmbedding.Include.EnumValueEnum4 | Api.QueryEmbedding.Include.EnumValueEnum5 | Api.QueryEmbedding.Include.EnumValueEnum6;
|
|
301
262
|
/**
|
|
302
263
|
* @export
|
|
303
264
|
* @namespace Include
|
|
@@ -315,6 +276,12 @@ declare namespace Api {
|
|
|
315
276
|
enum EnumValueEnum4 {
|
|
316
277
|
Distances = "distances"
|
|
317
278
|
}
|
|
279
|
+
enum EnumValueEnum5 {
|
|
280
|
+
Uris = "uris"
|
|
281
|
+
}
|
|
282
|
+
enum EnumValueEnum6 {
|
|
283
|
+
Data = "data"
|
|
284
|
+
}
|
|
318
285
|
}
|
|
319
286
|
}
|
|
320
287
|
interface Update200Response {
|
|
@@ -337,6 +304,7 @@ declare namespace Api {
|
|
|
337
304
|
embeddings?: Api.UpdateEmbedding.Embedding[];
|
|
338
305
|
metadatas?: Api.UpdateEmbedding.Metadata[];
|
|
339
306
|
documents?: string[];
|
|
307
|
+
uris?: string[];
|
|
340
308
|
ids: string[];
|
|
341
309
|
}
|
|
342
310
|
/**
|
|
@@ -408,27 +376,64 @@ declare class ApiApi extends BaseAPI {
|
|
|
408
376
|
* @throws {RequiredError}
|
|
409
377
|
*/
|
|
410
378
|
count(collectionId: string, options?: RequestInit): Promise<Api.Count200Response>;
|
|
379
|
+
/**
|
|
380
|
+
* @summary Count Collections
|
|
381
|
+
* @param {string} [tenant]
|
|
382
|
+
* @param {string} [database]
|
|
383
|
+
* @param {RequestInit} [options] Override http request option.
|
|
384
|
+
* @throws {RequiredError}
|
|
385
|
+
*/
|
|
386
|
+
countCollections(tenant: string | undefined, database: string | undefined, options?: RequestInit): Promise<Api.CountCollections200Response>;
|
|
411
387
|
/**
|
|
412
388
|
* @summary Create Collection
|
|
389
|
+
* @param {string} [tenant]
|
|
390
|
+
* @param {string} [database]
|
|
413
391
|
* @param {Api.CreateCollection} request
|
|
414
392
|
* @param {RequestInit} [options] Override http request option.
|
|
415
393
|
* @throws {RequiredError}
|
|
416
394
|
*/
|
|
417
|
-
createCollection(request: Api.CreateCollection, options?: RequestInit): Promise<Api.CreateCollection200Response>;
|
|
395
|
+
createCollection(tenant: string | undefined, database: string | undefined, request: Api.CreateCollection, options?: RequestInit): Promise<Api.CreateCollection200Response>;
|
|
396
|
+
/**
|
|
397
|
+
* @summary Create Database
|
|
398
|
+
* @param {string} [tenant]
|
|
399
|
+
* @param {Api.CreateDatabase} request
|
|
400
|
+
* @param {RequestInit} [options] Override http request option.
|
|
401
|
+
* @throws {RequiredError}
|
|
402
|
+
*/
|
|
403
|
+
createDatabase(tenant: string | undefined, request: Api.CreateDatabase, options?: RequestInit): Promise<Api.CreateDatabase200Response>;
|
|
404
|
+
/**
|
|
405
|
+
* @summary Create Tenant
|
|
406
|
+
* @param {Api.CreateTenant} request
|
|
407
|
+
* @param {RequestInit} [options] Override http request option.
|
|
408
|
+
* @throws {RequiredError}
|
|
409
|
+
*/
|
|
410
|
+
createTenant(request: Api.CreateTenant, options?: RequestInit): Promise<Api.CreateTenant200Response>;
|
|
418
411
|
/**
|
|
419
412
|
* @summary Delete Collection
|
|
420
413
|
* @param {string} collectionName
|
|
414
|
+
* @param {string} [tenant]
|
|
415
|
+
* @param {string} [database]
|
|
421
416
|
* @param {RequestInit} [options] Override http request option.
|
|
422
417
|
* @throws {RequiredError}
|
|
423
418
|
*/
|
|
424
|
-
deleteCollection(collectionName: string, options?: RequestInit): Promise<Api.DeleteCollection200Response>;
|
|
419
|
+
deleteCollection(collectionName: string, tenant: string | undefined, database: string | undefined, options?: RequestInit): Promise<Api.DeleteCollection200Response>;
|
|
425
420
|
/**
|
|
426
421
|
* @summary Get Collection
|
|
427
422
|
* @param {string} collectionName
|
|
423
|
+
* @param {string} [tenant]
|
|
424
|
+
* @param {string} [database]
|
|
425
|
+
* @param {RequestInit} [options] Override http request option.
|
|
426
|
+
* @throws {RequiredError}
|
|
427
|
+
*/
|
|
428
|
+
getCollection(collectionName: string, tenant: string | undefined, database: string | undefined, options?: RequestInit): Promise<Api.GetCollection200Response>;
|
|
429
|
+
/**
|
|
430
|
+
* @summary Get Database
|
|
431
|
+
* @param {string} database
|
|
432
|
+
* @param {string} [tenant]
|
|
428
433
|
* @param {RequestInit} [options] Override http request option.
|
|
429
434
|
* @throws {RequiredError}
|
|
430
435
|
*/
|
|
431
|
-
|
|
436
|
+
getDatabase(database: string, tenant: string | undefined, options?: RequestInit): Promise<Api.GetDatabase200Response>;
|
|
432
437
|
/**
|
|
433
438
|
* @summary Get Nearest Neighbors
|
|
434
439
|
* @param {string} collectionId
|
|
@@ -437,6 +442,13 @@ declare class ApiApi extends BaseAPI {
|
|
|
437
442
|
* @throws {RequiredError}
|
|
438
443
|
*/
|
|
439
444
|
getNearestNeighbors(collectionId: string, request: Api.QueryEmbedding, options?: RequestInit): Promise<Api.GetNearestNeighbors200Response>;
|
|
445
|
+
/**
|
|
446
|
+
* @summary Get Tenant
|
|
447
|
+
* @param {string} tenant
|
|
448
|
+
* @param {RequestInit} [options] Override http request option.
|
|
449
|
+
* @throws {RequiredError}
|
|
450
|
+
*/
|
|
451
|
+
getTenant(tenant: string, options?: RequestInit): Promise<Api.GetTenant200Response>;
|
|
440
452
|
/**
|
|
441
453
|
* @summary Heartbeat
|
|
442
454
|
* @param {RequestInit} [options] Override http request option.
|
|
@@ -447,10 +459,20 @@ declare class ApiApi extends BaseAPI {
|
|
|
447
459
|
}>;
|
|
448
460
|
/**
|
|
449
461
|
* @summary List Collections
|
|
462
|
+
* @param {string} [tenant]
|
|
463
|
+
* @param {string} [database]
|
|
464
|
+
* @param {number} [limit]
|
|
465
|
+
* @param {number} [offset]
|
|
450
466
|
* @param {RequestInit} [options] Override http request option.
|
|
451
467
|
* @throws {RequiredError}
|
|
452
468
|
*/
|
|
453
|
-
listCollections(options?: RequestInit): Promise<Api.ListCollections200Response>;
|
|
469
|
+
listCollections(tenant: string | undefined, database: string | undefined, limit: number | undefined, offset: number | undefined, options?: RequestInit): Promise<Api.ListCollections200Response>;
|
|
470
|
+
/**
|
|
471
|
+
* @summary Pre Flight Checks
|
|
472
|
+
* @param {RequestInit} [options] Override http request option.
|
|
473
|
+
* @throws {RequiredError}
|
|
474
|
+
*/
|
|
475
|
+
preFlightChecks(options?: RequestInit): Promise<Api.PreFlightChecks200Response>;
|
|
454
476
|
/**
|
|
455
477
|
* @summary Reset
|
|
456
478
|
* @param {RequestInit} [options] Override http request option.
|
|
@@ -497,6 +519,170 @@ declare class ApiApi extends BaseAPI {
|
|
|
497
519
|
version(options?: RequestInit): Promise<string>;
|
|
498
520
|
}
|
|
499
521
|
|
|
522
|
+
interface ClientAuthProvider {
|
|
523
|
+
/**
|
|
524
|
+
* Abstract method for authenticating a client.
|
|
525
|
+
*/
|
|
526
|
+
authenticate(): ClientAuthResponse;
|
|
527
|
+
}
|
|
528
|
+
interface ClientAuthConfigurationProvider<T> {
|
|
529
|
+
/**
|
|
530
|
+
* Abstract method for getting the configuration for the client.
|
|
531
|
+
*/
|
|
532
|
+
getConfig(): T;
|
|
533
|
+
}
|
|
534
|
+
interface ClientAuthCredentialsProvider<T> {
|
|
535
|
+
/**
|
|
536
|
+
* Abstract method for getting the credentials for the client.
|
|
537
|
+
* @param user
|
|
538
|
+
*/
|
|
539
|
+
getCredentials(user?: string): T;
|
|
540
|
+
}
|
|
541
|
+
declare enum AuthInfoType {
|
|
542
|
+
COOKIE = "cookie",
|
|
543
|
+
HEADER = "header",
|
|
544
|
+
URL = "url",
|
|
545
|
+
METADATA = "metadata"
|
|
546
|
+
}
|
|
547
|
+
interface ClientAuthResponse {
|
|
548
|
+
getAuthInfoType(): AuthInfoType;
|
|
549
|
+
getAuthInfo(): {
|
|
550
|
+
key: string;
|
|
551
|
+
value: string;
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
type AuthOptions = {
|
|
555
|
+
provider: ClientAuthProvider | string | undefined;
|
|
556
|
+
credentialsProvider?: ClientAuthCredentialsProvider<any> | undefined;
|
|
557
|
+
configProvider?: ClientAuthConfigurationProvider<any> | undefined;
|
|
558
|
+
credentials?: any | undefined;
|
|
559
|
+
providerOptions?: any | undefined;
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
interface IEmbeddingFunction {
|
|
563
|
+
generate(texts: string[]): Promise<number[][]>;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
declare enum IncludeEnum {
|
|
567
|
+
Documents = "documents",
|
|
568
|
+
Embeddings = "embeddings",
|
|
569
|
+
Metadatas = "metadatas",
|
|
570
|
+
Distances = "distances"
|
|
571
|
+
}
|
|
572
|
+
type Number = number;
|
|
573
|
+
type Embedding = Array<Number>;
|
|
574
|
+
type Embeddings = Array<Embedding>;
|
|
575
|
+
type Metadata = Record<string, string | number | boolean>;
|
|
576
|
+
type Metadatas = Array<Metadata>;
|
|
577
|
+
type Document = string;
|
|
578
|
+
type Documents = Array<Document>;
|
|
579
|
+
type ID = string;
|
|
580
|
+
type IDs = ID[];
|
|
581
|
+
type PositiveInteger = number;
|
|
582
|
+
type LiteralValue = string | number | boolean;
|
|
583
|
+
type ListLiteralValue = LiteralValue[];
|
|
584
|
+
type LiteralNumber = number;
|
|
585
|
+
type LogicalOperator = "$and" | "$or";
|
|
586
|
+
type InclusionOperator = "$in" | "$nin";
|
|
587
|
+
type WhereOperator = "$gt" | "$gte" | "$lt" | "$lte" | "$ne" | "$eq";
|
|
588
|
+
type OperatorExpression = {
|
|
589
|
+
[key in WhereOperator | InclusionOperator | LogicalOperator]?: LiteralValue | ListLiteralValue;
|
|
590
|
+
};
|
|
591
|
+
type BaseWhere = {
|
|
592
|
+
[key: string]: LiteralValue | OperatorExpression;
|
|
593
|
+
};
|
|
594
|
+
type LogicalWhere = {
|
|
595
|
+
[key in LogicalOperator]?: Where[];
|
|
596
|
+
};
|
|
597
|
+
type Where = BaseWhere | LogicalWhere;
|
|
598
|
+
type WhereDocumentOperator = "$contains" | LogicalOperator;
|
|
599
|
+
type WhereDocument = {
|
|
600
|
+
[key in WhereDocumentOperator]?: LiteralValue | LiteralNumber | WhereDocument[];
|
|
601
|
+
};
|
|
602
|
+
type CollectionType = {
|
|
603
|
+
name: string;
|
|
604
|
+
id: string;
|
|
605
|
+
metadata: Metadata | null;
|
|
606
|
+
};
|
|
607
|
+
type GetResponse = {
|
|
608
|
+
ids: IDs;
|
|
609
|
+
embeddings: null | Embeddings;
|
|
610
|
+
documents: (null | Document)[];
|
|
611
|
+
metadatas: (null | Metadata)[];
|
|
612
|
+
error: null | string;
|
|
613
|
+
};
|
|
614
|
+
type QueryResponse = {
|
|
615
|
+
ids: IDs[];
|
|
616
|
+
embeddings: null | Embeddings[];
|
|
617
|
+
documents: (null | Document)[][];
|
|
618
|
+
metadatas: (null | Metadata)[][];
|
|
619
|
+
distances: null | number[][];
|
|
620
|
+
};
|
|
621
|
+
type AddResponse = {
|
|
622
|
+
error: string;
|
|
623
|
+
};
|
|
624
|
+
type CollectionMetadata = Record<string, unknown>;
|
|
625
|
+
type GetParams = {
|
|
626
|
+
ids?: ID | IDs;
|
|
627
|
+
where?: Where;
|
|
628
|
+
limit?: PositiveInteger;
|
|
629
|
+
offset?: PositiveInteger;
|
|
630
|
+
include?: IncludeEnum[];
|
|
631
|
+
whereDocument?: WhereDocument;
|
|
632
|
+
};
|
|
633
|
+
type ListCollectionsParams = {
|
|
634
|
+
limit?: PositiveInteger;
|
|
635
|
+
offset?: PositiveInteger;
|
|
636
|
+
};
|
|
637
|
+
type ChromaClientParams = {
|
|
638
|
+
path?: string;
|
|
639
|
+
fetchOptions?: RequestInit;
|
|
640
|
+
auth?: AuthOptions;
|
|
641
|
+
tenant?: string;
|
|
642
|
+
database?: string;
|
|
643
|
+
};
|
|
644
|
+
type CreateCollectionParams = {
|
|
645
|
+
name: string;
|
|
646
|
+
metadata?: CollectionMetadata;
|
|
647
|
+
embeddingFunction?: IEmbeddingFunction;
|
|
648
|
+
};
|
|
649
|
+
type GetOrCreateCollectionParams = CreateCollectionParams;
|
|
650
|
+
type GetCollectionParams = {
|
|
651
|
+
name: string;
|
|
652
|
+
embeddingFunction?: IEmbeddingFunction;
|
|
653
|
+
};
|
|
654
|
+
type DeleteCollectionParams = {
|
|
655
|
+
name: string;
|
|
656
|
+
};
|
|
657
|
+
type AddParams = {
|
|
658
|
+
ids: ID | IDs;
|
|
659
|
+
embeddings?: Embedding | Embeddings;
|
|
660
|
+
metadatas?: Metadata | Metadatas;
|
|
661
|
+
documents?: Document | Documents;
|
|
662
|
+
};
|
|
663
|
+
type UpsertParams = AddParams;
|
|
664
|
+
type UpdateParams = AddParams;
|
|
665
|
+
type ModifyCollectionParams = {
|
|
666
|
+
name?: string;
|
|
667
|
+
metadata?: CollectionMetadata;
|
|
668
|
+
};
|
|
669
|
+
type QueryParams = {
|
|
670
|
+
queryEmbeddings?: Embedding | Embeddings;
|
|
671
|
+
nResults?: PositiveInteger;
|
|
672
|
+
where?: Where;
|
|
673
|
+
queryTexts?: string | string[];
|
|
674
|
+
whereDocument?: WhereDocument;
|
|
675
|
+
include?: IncludeEnum[];
|
|
676
|
+
};
|
|
677
|
+
type PeekParams = {
|
|
678
|
+
limit?: PositiveInteger;
|
|
679
|
+
};
|
|
680
|
+
type DeleteParams = {
|
|
681
|
+
ids?: ID | IDs;
|
|
682
|
+
where?: Where;
|
|
683
|
+
whereDocument?: WhereDocument;
|
|
684
|
+
};
|
|
685
|
+
|
|
500
686
|
declare class Collection {
|
|
501
687
|
name: string;
|
|
502
688
|
id: string;
|
|
@@ -544,12 +730,7 @@ declare class Collection {
|
|
|
544
730
|
* });
|
|
545
731
|
* ```
|
|
546
732
|
*/
|
|
547
|
-
add({ ids, embeddings, metadatas, documents, }:
|
|
548
|
-
ids: ID | IDs;
|
|
549
|
-
embeddings?: Embedding | Embeddings;
|
|
550
|
-
metadatas?: Metadata | Metadatas;
|
|
551
|
-
documents?: Document | Documents;
|
|
552
|
-
}): Promise<AddResponse>;
|
|
733
|
+
add({ ids, embeddings, metadatas, documents, }: AddParams): Promise<AddResponse>;
|
|
553
734
|
/**
|
|
554
735
|
* Upsert items to the collection
|
|
555
736
|
* @param {Object} params - The parameters for the query.
|
|
@@ -569,12 +750,7 @@ declare class Collection {
|
|
|
569
750
|
* });
|
|
570
751
|
* ```
|
|
571
752
|
*/
|
|
572
|
-
upsert({ ids, embeddings, metadatas, documents, }:
|
|
573
|
-
ids: ID | IDs;
|
|
574
|
-
embeddings?: Embedding | Embeddings;
|
|
575
|
-
metadatas?: Metadata | Metadatas;
|
|
576
|
-
documents?: Document | Documents;
|
|
577
|
-
}): Promise<boolean>;
|
|
753
|
+
upsert({ ids, embeddings, metadatas, documents, }: UpsertParams): Promise<boolean>;
|
|
578
754
|
/**
|
|
579
755
|
* Count the number of items in the collection
|
|
580
756
|
* @returns {Promise<number>} - The response from the API.
|
|
@@ -600,10 +776,7 @@ declare class Collection {
|
|
|
600
776
|
* });
|
|
601
777
|
* ```
|
|
602
778
|
*/
|
|
603
|
-
modify({ name, metadata }?:
|
|
604
|
-
name?: string;
|
|
605
|
-
metadata?: CollectionMetadata;
|
|
606
|
-
}): Promise<void>;
|
|
779
|
+
modify({ name, metadata }?: ModifyCollectionParams): Promise<void>;
|
|
607
780
|
/**
|
|
608
781
|
* Get items from the collection
|
|
609
782
|
* @param {Object} params - The parameters for the query.
|
|
@@ -627,14 +800,7 @@ declare class Collection {
|
|
|
627
800
|
* });
|
|
628
801
|
* ```
|
|
629
802
|
*/
|
|
630
|
-
get({ ids, where, limit, offset, include, whereDocument, }?:
|
|
631
|
-
ids?: ID | IDs;
|
|
632
|
-
where?: Where;
|
|
633
|
-
limit?: PositiveInteger;
|
|
634
|
-
offset?: PositiveInteger;
|
|
635
|
-
include?: IncludeEnum[];
|
|
636
|
-
whereDocument?: WhereDocument;
|
|
637
|
-
}): Promise<GetResponse>;
|
|
803
|
+
get({ ids, where, limit, offset, include, whereDocument, }?: GetParams): Promise<GetResponse>;
|
|
638
804
|
/**
|
|
639
805
|
* Update the embeddings, documents, and/or metadatas of existing items
|
|
640
806
|
* @param {Object} params - The parameters for the query.
|
|
@@ -654,12 +820,7 @@ declare class Collection {
|
|
|
654
820
|
* });
|
|
655
821
|
* ```
|
|
656
822
|
*/
|
|
657
|
-
update({ ids, embeddings, metadatas, documents, }:
|
|
658
|
-
ids: ID | IDs;
|
|
659
|
-
embeddings?: Embedding | Embeddings;
|
|
660
|
-
metadatas?: Metadata | Metadatas;
|
|
661
|
-
documents?: Document | Documents;
|
|
662
|
-
}): Promise<boolean>;
|
|
823
|
+
update({ ids, embeddings, metadatas, documents, }: UpdateParams): Promise<boolean>;
|
|
663
824
|
/**
|
|
664
825
|
* Performs a query on the collection using the specified parameters.
|
|
665
826
|
*
|
|
@@ -693,14 +854,7 @@ declare class Collection {
|
|
|
693
854
|
* ```
|
|
694
855
|
*
|
|
695
856
|
*/
|
|
696
|
-
query({ queryEmbeddings, nResults, where, queryTexts, whereDocument, include, }:
|
|
697
|
-
queryEmbeddings?: Embedding | Embeddings;
|
|
698
|
-
nResults?: PositiveInteger;
|
|
699
|
-
where?: Where;
|
|
700
|
-
queryTexts?: string | string[];
|
|
701
|
-
whereDocument?: WhereDocument;
|
|
702
|
-
include?: IncludeEnum[];
|
|
703
|
-
}): Promise<QueryResponse>;
|
|
857
|
+
query({ queryEmbeddings, nResults, where, queryTexts, whereDocument, include, }: QueryParams): Promise<QueryResponse>;
|
|
704
858
|
/**
|
|
705
859
|
* Peek inside the collection
|
|
706
860
|
* @param {Object} params - The parameters for the query.
|
|
@@ -715,9 +869,7 @@ declare class Collection {
|
|
|
715
869
|
* });
|
|
716
870
|
* ```
|
|
717
871
|
*/
|
|
718
|
-
peek({ limit }?:
|
|
719
|
-
limit?: PositiveInteger;
|
|
720
|
-
}): Promise<GetResponse>;
|
|
872
|
+
peek({ limit }?: PeekParams): Promise<GetResponse>;
|
|
721
873
|
/**
|
|
722
874
|
* Deletes items from the collection.
|
|
723
875
|
* @param {Object} params - The parameters for deleting items from the collection.
|
|
@@ -736,52 +888,8 @@ declare class Collection {
|
|
|
736
888
|
* });
|
|
737
889
|
* ```
|
|
738
890
|
*/
|
|
739
|
-
delete({ ids, where, whereDocument }?:
|
|
740
|
-
ids?: ID | IDs;
|
|
741
|
-
where?: Where;
|
|
742
|
-
whereDocument?: WhereDocument;
|
|
743
|
-
}): Promise<string[]>;
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
interface ClientAuthProvider {
|
|
747
|
-
/**
|
|
748
|
-
* Abstract method for authenticating a client.
|
|
749
|
-
*/
|
|
750
|
-
authenticate(): ClientAuthResponse;
|
|
751
|
-
}
|
|
752
|
-
interface ClientAuthConfigurationProvider<T> {
|
|
753
|
-
/**
|
|
754
|
-
* Abstract method for getting the configuration for the client.
|
|
755
|
-
*/
|
|
756
|
-
getConfig(): T;
|
|
757
|
-
}
|
|
758
|
-
interface ClientAuthCredentialsProvider<T> {
|
|
759
|
-
/**
|
|
760
|
-
* Abstract method for getting the credentials for the client.
|
|
761
|
-
* @param user
|
|
762
|
-
*/
|
|
763
|
-
getCredentials(user?: string): T;
|
|
764
|
-
}
|
|
765
|
-
declare enum AuthInfoType {
|
|
766
|
-
COOKIE = "cookie",
|
|
767
|
-
HEADER = "header",
|
|
768
|
-
URL = "url",
|
|
769
|
-
METADATA = "metadata"
|
|
770
|
-
}
|
|
771
|
-
interface ClientAuthResponse {
|
|
772
|
-
getAuthInfoType(): AuthInfoType;
|
|
773
|
-
getAuthInfo(): {
|
|
774
|
-
key: string;
|
|
775
|
-
value: string;
|
|
776
|
-
};
|
|
891
|
+
delete({ ids, where, whereDocument }?: DeleteParams): Promise<string[]>;
|
|
777
892
|
}
|
|
778
|
-
type AuthOptions = {
|
|
779
|
-
provider: ClientAuthProvider | string | undefined;
|
|
780
|
-
credentialsProvider?: ClientAuthCredentialsProvider<any> | undefined;
|
|
781
|
-
configProvider?: ClientAuthConfigurationProvider<any> | undefined;
|
|
782
|
-
credentials?: any | undefined;
|
|
783
|
-
providerOptions?: any | undefined;
|
|
784
|
-
};
|
|
785
893
|
|
|
786
894
|
declare class ChromaClient {
|
|
787
895
|
/**
|
|
@@ -789,6 +897,9 @@ declare class ChromaClient {
|
|
|
789
897
|
*/
|
|
790
898
|
private api;
|
|
791
899
|
private apiAdapter;
|
|
900
|
+
private tenant;
|
|
901
|
+
private database;
|
|
902
|
+
private _adminClient?;
|
|
792
903
|
/**
|
|
793
904
|
* Creates a new ChromaClient instance.
|
|
794
905
|
* @param {Object} params - The parameters for creating a new client
|
|
@@ -802,11 +913,7 @@ declare class ChromaClient {
|
|
|
802
913
|
* });
|
|
803
914
|
* ```
|
|
804
915
|
*/
|
|
805
|
-
constructor({ path, fetchOptions, auth, }?:
|
|
806
|
-
path?: string;
|
|
807
|
-
fetchOptions?: RequestInit;
|
|
808
|
-
auth?: AuthOptions;
|
|
809
|
-
});
|
|
916
|
+
constructor({ path, fetchOptions, auth, tenant, database, }?: ChromaClientParams);
|
|
810
917
|
/**
|
|
811
918
|
* Resets the state of the object by making an API call to the reset endpoint.
|
|
812
919
|
*
|
|
@@ -860,11 +967,7 @@ declare class ChromaClient {
|
|
|
860
967
|
* });
|
|
861
968
|
* ```
|
|
862
969
|
*/
|
|
863
|
-
createCollection({ name, metadata, embeddingFunction }:
|
|
864
|
-
name: string;
|
|
865
|
-
metadata?: CollectionMetadata;
|
|
866
|
-
embeddingFunction?: IEmbeddingFunction;
|
|
867
|
-
}): Promise<Collection>;
|
|
970
|
+
createCollection({ name, metadata, embeddingFunction }: CreateCollectionParams): Promise<Collection>;
|
|
868
971
|
/**
|
|
869
972
|
* Gets or creates a collection with the specified properties.
|
|
870
973
|
*
|
|
@@ -886,23 +989,36 @@ declare class ChromaClient {
|
|
|
886
989
|
* });
|
|
887
990
|
* ```
|
|
888
991
|
*/
|
|
889
|
-
getOrCreateCollection({ name, metadata, embeddingFunction }:
|
|
890
|
-
name: string;
|
|
891
|
-
metadata?: CollectionMetadata;
|
|
892
|
-
embeddingFunction?: IEmbeddingFunction;
|
|
893
|
-
}): Promise<Collection>;
|
|
992
|
+
getOrCreateCollection({ name, metadata, embeddingFunction }: GetOrCreateCollectionParams): Promise<Collection>;
|
|
894
993
|
/**
|
|
895
994
|
* Lists all collections.
|
|
896
995
|
*
|
|
897
996
|
* @returns {Promise<CollectionType[]>} A promise that resolves to a list of collection names.
|
|
997
|
+
* @param {PositiveInteger} [params.limit] - Optional limit on the number of items to get.
|
|
998
|
+
* @param {PositiveInteger} [params.offset] - Optional offset on the items to get.
|
|
898
999
|
* @throws {Error} If there is an issue listing the collections.
|
|
899
1000
|
*
|
|
900
1001
|
* @example
|
|
901
1002
|
* ```typescript
|
|
902
|
-
* const collections = await client.listCollections(
|
|
1003
|
+
* const collections = await client.listCollections({
|
|
1004
|
+
* limit: 10,
|
|
1005
|
+
* offset: 0,
|
|
1006
|
+
* });
|
|
903
1007
|
* ```
|
|
904
1008
|
*/
|
|
905
|
-
listCollections(): Promise<CollectionType[]>;
|
|
1009
|
+
listCollections({ limit, offset, }?: ListCollectionsParams): Promise<CollectionType[]>;
|
|
1010
|
+
/**
|
|
1011
|
+
* Counts all collections.
|
|
1012
|
+
*
|
|
1013
|
+
* @returns {Promise<number>} A promise that resolves to the number of collections.
|
|
1014
|
+
* @throws {Error} If there is an issue counting the collections.
|
|
1015
|
+
*
|
|
1016
|
+
* @example
|
|
1017
|
+
* ```typescript
|
|
1018
|
+
* const collections = await client.countCollections();
|
|
1019
|
+
* ```
|
|
1020
|
+
*/
|
|
1021
|
+
countCollections(): Promise<number>;
|
|
906
1022
|
/**
|
|
907
1023
|
* Gets a collection with the specified name.
|
|
908
1024
|
* @param {Object} params - The parameters for getting a collection.
|
|
@@ -918,10 +1034,7 @@ declare class ChromaClient {
|
|
|
918
1034
|
* });
|
|
919
1035
|
* ```
|
|
920
1036
|
*/
|
|
921
|
-
getCollection({ name, embeddingFunction }:
|
|
922
|
-
name: string;
|
|
923
|
-
embeddingFunction?: IEmbeddingFunction;
|
|
924
|
-
}): Promise<Collection>;
|
|
1037
|
+
getCollection({ name, embeddingFunction }: GetCollectionParams): Promise<Collection>;
|
|
925
1038
|
/**
|
|
926
1039
|
* Deletes a collection with the specified name.
|
|
927
1040
|
* @param {Object} params - The parameters for deleting a collection.
|
|
@@ -936,9 +1049,166 @@ declare class ChromaClient {
|
|
|
936
1049
|
* });
|
|
937
1050
|
* ```
|
|
938
1051
|
*/
|
|
939
|
-
deleteCollection({ name }:
|
|
940
|
-
|
|
1052
|
+
deleteCollection({ name }: DeleteCollectionParams): Promise<void>;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
interface Tenant {
|
|
1056
|
+
name: string;
|
|
1057
|
+
}
|
|
1058
|
+
interface Database {
|
|
1059
|
+
name: string;
|
|
1060
|
+
}
|
|
1061
|
+
declare class AdminClient {
|
|
1062
|
+
/**
|
|
1063
|
+
* @ignore
|
|
1064
|
+
*/
|
|
1065
|
+
private api;
|
|
1066
|
+
private apiAdapter;
|
|
1067
|
+
tenant: string;
|
|
1068
|
+
database: string;
|
|
1069
|
+
/**
|
|
1070
|
+
* Creates a new AdminClient instance.
|
|
1071
|
+
* @param {Object} params - The parameters for creating a new client
|
|
1072
|
+
* @param {string} [params.path] - The base path for the Chroma API.
|
|
1073
|
+
* @returns {AdminClient} A new AdminClient instance.
|
|
1074
|
+
*
|
|
1075
|
+
* @example
|
|
1076
|
+
* ```typescript
|
|
1077
|
+
* const client = new AdminClient({
|
|
1078
|
+
* path: "http://localhost:8000"
|
|
1079
|
+
* });
|
|
1080
|
+
* ```
|
|
1081
|
+
*/
|
|
1082
|
+
constructor({ path, fetchOptions, auth, tenant, database }?: {
|
|
1083
|
+
path?: string;
|
|
1084
|
+
fetchOptions?: RequestInit;
|
|
1085
|
+
auth?: AuthOptions;
|
|
1086
|
+
tenant?: string;
|
|
1087
|
+
database?: string;
|
|
1088
|
+
});
|
|
1089
|
+
/**
|
|
1090
|
+
* Sets the tenant and database for the client.
|
|
1091
|
+
*
|
|
1092
|
+
* @param {Object} params - The parameters for setting tenant and database.
|
|
1093
|
+
* @param {string} params.tenant - The name of the tenant.
|
|
1094
|
+
* @param {string} params.database - The name of the database.
|
|
1095
|
+
*
|
|
1096
|
+
* @returns {Promise<void>} A promise that returns nothing
|
|
1097
|
+
* @throws {Error} Any issues
|
|
1098
|
+
*
|
|
1099
|
+
* @example
|
|
1100
|
+
* ```typescript
|
|
1101
|
+
* await adminClient.setTenant({
|
|
1102
|
+
* tenant: "my_tenant",
|
|
1103
|
+
* database: "my_database",
|
|
1104
|
+
* });
|
|
1105
|
+
* ```
|
|
1106
|
+
*/
|
|
1107
|
+
setTenant({ tenant, database }: {
|
|
1108
|
+
tenant: string;
|
|
1109
|
+
database?: string;
|
|
941
1110
|
}): Promise<void>;
|
|
1111
|
+
/**
|
|
1112
|
+
* Sets the database for the client.
|
|
1113
|
+
*
|
|
1114
|
+
* @param {Object} params - The parameters for setting the database.
|
|
1115
|
+
* @param {string} params.database - The name of the database.
|
|
1116
|
+
*
|
|
1117
|
+
* @returns {Promise<void>} A promise that returns nothing
|
|
1118
|
+
* @throws {Error} Any issues
|
|
1119
|
+
*
|
|
1120
|
+
* @example
|
|
1121
|
+
* ```typescript
|
|
1122
|
+
* await adminClient.setDatabase({
|
|
1123
|
+
* database: "my_database",
|
|
1124
|
+
* });
|
|
1125
|
+
* ```
|
|
1126
|
+
*/
|
|
1127
|
+
setDatabase({ database }: {
|
|
1128
|
+
database?: string;
|
|
1129
|
+
}): Promise<void>;
|
|
1130
|
+
/**
|
|
1131
|
+
* Creates a new tenant with the specified properties.
|
|
1132
|
+
*
|
|
1133
|
+
* @param {Object} params - The parameters for creating a new tenant.
|
|
1134
|
+
* @param {string} params.name - The name of the tenant.
|
|
1135
|
+
*
|
|
1136
|
+
* @returns {Promise<Tenant>} A promise that resolves to the created tenant.
|
|
1137
|
+
* @throws {Error} If there is an issue creating the tenant.
|
|
1138
|
+
*
|
|
1139
|
+
* @example
|
|
1140
|
+
* ```typescript
|
|
1141
|
+
* await adminClient.createTenant({
|
|
1142
|
+
* name: "my_tenant",
|
|
1143
|
+
* });
|
|
1144
|
+
* ```
|
|
1145
|
+
*/
|
|
1146
|
+
createTenant({ name, }: {
|
|
1147
|
+
name: string;
|
|
1148
|
+
}): Promise<Tenant>;
|
|
1149
|
+
/**
|
|
1150
|
+
* Gets a tenant with the specified properties.
|
|
1151
|
+
*
|
|
1152
|
+
* @param {Object} params - The parameters for getting a tenant.
|
|
1153
|
+
* @param {string} params.name - The name of the tenant.
|
|
1154
|
+
*
|
|
1155
|
+
* @returns {Promise<Tenant>} A promise that resolves to the tenant.
|
|
1156
|
+
* @throws {Error} If there is an issue getting the tenant.
|
|
1157
|
+
*
|
|
1158
|
+
* @example
|
|
1159
|
+
* ```typescript
|
|
1160
|
+
* await adminClient.getTenant({
|
|
1161
|
+
* name: "my_tenant",
|
|
1162
|
+
* });
|
|
1163
|
+
* ```
|
|
1164
|
+
*/
|
|
1165
|
+
getTenant({ name, }: {
|
|
1166
|
+
name: string;
|
|
1167
|
+
}): Promise<Tenant>;
|
|
1168
|
+
/**
|
|
1169
|
+
* Creates a new database with the specified properties.
|
|
1170
|
+
*
|
|
1171
|
+
* @param {Object} params - The parameters for creating a new database.
|
|
1172
|
+
* @param {string} params.name - The name of the database.
|
|
1173
|
+
* @param {string} params.tenantName - The name of the tenant.
|
|
1174
|
+
*
|
|
1175
|
+
* @returns {Promise<Database>} A promise that resolves to the created database.
|
|
1176
|
+
* @throws {Error} If there is an issue creating the database.
|
|
1177
|
+
*
|
|
1178
|
+
* @example
|
|
1179
|
+
* ```typescript
|
|
1180
|
+
* await adminClient.createDatabase({
|
|
1181
|
+
* name: "my_database",
|
|
1182
|
+
* tenantName: "my_tenant",
|
|
1183
|
+
* });
|
|
1184
|
+
* ```
|
|
1185
|
+
*/
|
|
1186
|
+
createDatabase({ name, tenantName }: {
|
|
1187
|
+
name: string;
|
|
1188
|
+
tenantName: string;
|
|
1189
|
+
}): Promise<Database>;
|
|
1190
|
+
/**
|
|
1191
|
+
* Gets a database with the specified properties.
|
|
1192
|
+
*
|
|
1193
|
+
* @param {Object} params - The parameters for getting a database.
|
|
1194
|
+
* @param {string} params.name - The name of the database.
|
|
1195
|
+
* @param {string} params.tenantName - The name of the tenant.
|
|
1196
|
+
*
|
|
1197
|
+
* @returns {Promise<Database>} A promise that resolves to the database.
|
|
1198
|
+
* @throws {Error} If there is an issue getting the database.
|
|
1199
|
+
*
|
|
1200
|
+
* @example
|
|
1201
|
+
* ```typescript
|
|
1202
|
+
* await adminClient.getDatabase({
|
|
1203
|
+
* name: "my_database",
|
|
1204
|
+
* tenantName: "my_tenant",
|
|
1205
|
+
* });
|
|
1206
|
+
* ```
|
|
1207
|
+
*/
|
|
1208
|
+
getDatabase({ name, tenantName }: {
|
|
1209
|
+
name: string;
|
|
1210
|
+
tenantName: string;
|
|
1211
|
+
}): Promise<Database>;
|
|
942
1212
|
}
|
|
943
1213
|
|
|
944
1214
|
declare class OpenAIEmbeddingFunction implements IEmbeddingFunction {
|
|
@@ -976,4 +1246,12 @@ declare class CohereEmbeddingFunction implements IEmbeddingFunction {
|
|
|
976
1246
|
}>;
|
|
977
1247
|
}
|
|
978
1248
|
|
|
979
|
-
|
|
1249
|
+
declare class HuggingFaceEmbeddingServerFunction implements IEmbeddingFunction {
|
|
1250
|
+
private url;
|
|
1251
|
+
constructor({ url }: {
|
|
1252
|
+
url: string;
|
|
1253
|
+
});
|
|
1254
|
+
generate(texts: string[]): Promise<any>;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
export { type AddParams, AdminClient, ChromaClient, type ChromaClientParams, CohereEmbeddingFunction, Collection, type CollectionMetadata, type CollectionType, type CreateCollectionParams, type DeleteCollectionParams, type DeleteParams, type Document, type Documents, type Embedding, type Embeddings, type GetCollectionParams, type GetOrCreateCollectionParams, type GetParams, type GetResponse, HuggingFaceEmbeddingServerFunction, type ID, type IDs, type IEmbeddingFunction, IncludeEnum, type ListCollectionsParams, type Metadata, type Metadatas, type ModifyCollectionParams, OpenAIEmbeddingFunction, type PeekParams, type QueryParams, type QueryResponse, type UpdateParams, type UpsertParams, type Where, type WhereDocument };
|