chromadb 3.1.6 → 3.1.8
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 +18 -0
- package/dist/chromadb.legacy-esm.js +26 -17
- package/dist/chromadb.mjs +26 -17
- package/dist/chromadb.mjs.map +1 -1
- package/dist/cjs/chromadb.cjs +26 -17
- package/dist/cjs/chromadb.cjs.map +1 -1
- package/dist/cjs/chromadb.d.cts +18 -0
- package/package.json +6 -6
- package/src/api/sdk.gen.ts +25 -15
- package/src/api/types.gen.ts +167 -43
- package/src/cloud-client.ts +12 -4
package/dist/chromadb.d.ts
CHANGED
|
@@ -174,6 +174,12 @@ type Key$1 = 'Document' | 'Embedding' | 'Metadata' | 'Score' | {
|
|
|
174
174
|
* This represents the server-side schema structure used for index management
|
|
175
175
|
*/
|
|
176
176
|
type Schema$1 = {
|
|
177
|
+
/**
|
|
178
|
+
* Customer-managed encryption key for collection data
|
|
179
|
+
*/
|
|
180
|
+
cmek?: {
|
|
181
|
+
[key: string]: unknown;
|
|
182
|
+
} | null;
|
|
177
183
|
/**
|
|
178
184
|
* Default index configurations for each value type
|
|
179
185
|
*/
|
|
@@ -258,6 +264,10 @@ type SparseVector = {
|
|
|
258
264
|
* Dimension indices
|
|
259
265
|
*/
|
|
260
266
|
indices: Array<number>;
|
|
267
|
+
/**
|
|
268
|
+
* Tokens corresponding to each index
|
|
269
|
+
*/
|
|
270
|
+
tokens?: Array<string> | null;
|
|
261
271
|
/**
|
|
262
272
|
* Values corresponding to each index
|
|
263
273
|
*/
|
|
@@ -1542,6 +1552,10 @@ declare class CloudClient extends ChromaClient {
|
|
|
1542
1552
|
constructor(args?: Partial<{
|
|
1543
1553
|
/** API key for authentication (or set CHROMA_API_KEY env var) */
|
|
1544
1554
|
apiKey?: string;
|
|
1555
|
+
/** Host address of the Chroma cloud server. Defaults to 'api.trychroma.com' */
|
|
1556
|
+
host?: string;
|
|
1557
|
+
/** Port number of the Chroma cloud server. Defaults to 443 */
|
|
1558
|
+
port?: number;
|
|
1545
1559
|
/** Tenant name for multi-tenant deployments */
|
|
1546
1560
|
tenant?: string;
|
|
1547
1561
|
/** Database name to connect to */
|
|
@@ -1562,6 +1576,10 @@ declare class AdminCloudClient extends AdminClient {
|
|
|
1562
1576
|
constructor(args?: Partial<{
|
|
1563
1577
|
/** API key for authentication (or set CHROMA_API_KEY env var) */
|
|
1564
1578
|
apiKey?: string;
|
|
1579
|
+
/** Host address of the Chroma cloud server. Defaults to 'api.trychroma.com' */
|
|
1580
|
+
host?: string;
|
|
1581
|
+
/** Port number of the Chroma cloud server. Defaults to 443 */
|
|
1582
|
+
port?: number;
|
|
1565
1583
|
/** Additional fetch options for HTTP requests */
|
|
1566
1584
|
fetchOptions?: RequestInit;
|
|
1567
1585
|
}>);
|
|
@@ -491,19 +491,6 @@ var DefaultService = class {
|
|
|
491
491
|
...options
|
|
492
492
|
});
|
|
493
493
|
}
|
|
494
|
-
/**
|
|
495
|
-
* Detach a function
|
|
496
|
-
*/
|
|
497
|
-
static detachFunction(options) {
|
|
498
|
-
return (options.client ?? client).post({
|
|
499
|
-
url: "/api/v2/tenants/{tenant}/databases/{database}/attached_functions/{attached_function_id}/detach",
|
|
500
|
-
...options,
|
|
501
|
-
headers: {
|
|
502
|
-
"Content-Type": "application/json",
|
|
503
|
-
...options?.headers
|
|
504
|
-
}
|
|
505
|
-
});
|
|
506
|
-
}
|
|
507
494
|
/**
|
|
508
495
|
* Lists all collections in the specified database.
|
|
509
496
|
*/
|
|
@@ -570,6 +557,19 @@ var DefaultService = class {
|
|
|
570
557
|
}
|
|
571
558
|
});
|
|
572
559
|
}
|
|
560
|
+
/**
|
|
561
|
+
* Detach a function
|
|
562
|
+
*/
|
|
563
|
+
static detachFunction(options) {
|
|
564
|
+
return (options.client ?? client).post({
|
|
565
|
+
url: "/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/attached_functions/{name}/detach",
|
|
566
|
+
...options,
|
|
567
|
+
headers: {
|
|
568
|
+
"Content-Type": "application/json",
|
|
569
|
+
...options?.headers
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
573
|
/**
|
|
574
574
|
* Retrieves the number of records in a collection.
|
|
575
575
|
*/
|
|
@@ -618,6 +618,15 @@ var DefaultService = class {
|
|
|
618
618
|
}
|
|
619
619
|
});
|
|
620
620
|
}
|
|
621
|
+
/**
|
|
622
|
+
* Get an attached function by name
|
|
623
|
+
*/
|
|
624
|
+
static getAttachedFunction(options) {
|
|
625
|
+
return (options.client ?? client).get({
|
|
626
|
+
url: "/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/functions/{function_name}",
|
|
627
|
+
...options
|
|
628
|
+
});
|
|
629
|
+
}
|
|
621
630
|
/**
|
|
622
631
|
* Retrieves records from a collection by ID or metadata filter.
|
|
623
632
|
*/
|
|
@@ -4645,8 +4654,8 @@ var CloudClient = class extends ChromaClient {
|
|
|
4645
4654
|
const tenant = args.tenant || process2.env.CHROMA_TENANT;
|
|
4646
4655
|
const database = args.database || process2.env.CHROMA_DATABASE;
|
|
4647
4656
|
super({
|
|
4648
|
-
host: "api.trychroma.com",
|
|
4649
|
-
port:
|
|
4657
|
+
host: args.host || "api.trychroma.com",
|
|
4658
|
+
port: args.port || 443,
|
|
4650
4659
|
ssl: true,
|
|
4651
4660
|
tenant,
|
|
4652
4661
|
database,
|
|
@@ -4670,8 +4679,8 @@ var AdminCloudClient = class extends AdminClient {
|
|
|
4670
4679
|
);
|
|
4671
4680
|
}
|
|
4672
4681
|
super({
|
|
4673
|
-
host: "api.trychroma.com",
|
|
4674
|
-
port:
|
|
4682
|
+
host: args.host || "api.trychroma.com",
|
|
4683
|
+
port: args.port || 443,
|
|
4675
4684
|
ssl: true,
|
|
4676
4685
|
headers: { "x-chroma-token": apiKey },
|
|
4677
4686
|
fetchOptions: args.fetchOptions
|
package/dist/chromadb.mjs
CHANGED
|
@@ -491,19 +491,6 @@ var DefaultService = class {
|
|
|
491
491
|
...options
|
|
492
492
|
});
|
|
493
493
|
}
|
|
494
|
-
/**
|
|
495
|
-
* Detach a function
|
|
496
|
-
*/
|
|
497
|
-
static detachFunction(options) {
|
|
498
|
-
return (options.client ?? client).post({
|
|
499
|
-
url: "/api/v2/tenants/{tenant}/databases/{database}/attached_functions/{attached_function_id}/detach",
|
|
500
|
-
...options,
|
|
501
|
-
headers: {
|
|
502
|
-
"Content-Type": "application/json",
|
|
503
|
-
...options?.headers
|
|
504
|
-
}
|
|
505
|
-
});
|
|
506
|
-
}
|
|
507
494
|
/**
|
|
508
495
|
* Lists all collections in the specified database.
|
|
509
496
|
*/
|
|
@@ -570,6 +557,19 @@ var DefaultService = class {
|
|
|
570
557
|
}
|
|
571
558
|
});
|
|
572
559
|
}
|
|
560
|
+
/**
|
|
561
|
+
* Detach a function
|
|
562
|
+
*/
|
|
563
|
+
static detachFunction(options) {
|
|
564
|
+
return (options.client ?? client).post({
|
|
565
|
+
url: "/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/attached_functions/{name}/detach",
|
|
566
|
+
...options,
|
|
567
|
+
headers: {
|
|
568
|
+
"Content-Type": "application/json",
|
|
569
|
+
...options?.headers
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
573
|
/**
|
|
574
574
|
* Retrieves the number of records in a collection.
|
|
575
575
|
*/
|
|
@@ -618,6 +618,15 @@ var DefaultService = class {
|
|
|
618
618
|
}
|
|
619
619
|
});
|
|
620
620
|
}
|
|
621
|
+
/**
|
|
622
|
+
* Get an attached function by name
|
|
623
|
+
*/
|
|
624
|
+
static getAttachedFunction(options) {
|
|
625
|
+
return (options.client ?? client).get({
|
|
626
|
+
url: "/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/functions/{function_name}",
|
|
627
|
+
...options
|
|
628
|
+
});
|
|
629
|
+
}
|
|
621
630
|
/**
|
|
622
631
|
* Retrieves records from a collection by ID or metadata filter.
|
|
623
632
|
*/
|
|
@@ -4645,8 +4654,8 @@ var CloudClient = class extends ChromaClient {
|
|
|
4645
4654
|
const tenant = args.tenant || process2.env.CHROMA_TENANT;
|
|
4646
4655
|
const database = args.database || process2.env.CHROMA_DATABASE;
|
|
4647
4656
|
super({
|
|
4648
|
-
host: "api.trychroma.com",
|
|
4649
|
-
port:
|
|
4657
|
+
host: args.host || "api.trychroma.com",
|
|
4658
|
+
port: args.port || 443,
|
|
4650
4659
|
ssl: true,
|
|
4651
4660
|
tenant,
|
|
4652
4661
|
database,
|
|
@@ -4670,8 +4679,8 @@ var AdminCloudClient = class extends AdminClient {
|
|
|
4670
4679
|
);
|
|
4671
4680
|
}
|
|
4672
4681
|
super({
|
|
4673
|
-
host: "api.trychroma.com",
|
|
4674
|
-
port:
|
|
4682
|
+
host: args.host || "api.trychroma.com",
|
|
4683
|
+
port: args.port || 443,
|
|
4675
4684
|
ssl: true,
|
|
4676
4685
|
headers: { "x-chroma-token": apiKey },
|
|
4677
4686
|
fetchOptions: args.fetchOptions
|