chromadb 1.10.3 → 1.10.4
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 +93 -3
- package/dist/chromadb.legacy-esm.js +45 -6
- package/dist/chromadb.mjs +45 -6
- package/dist/chromadb.mjs.map +1 -1
- package/dist/cjs/chromadb.cjs +58 -7
- package/dist/cjs/chromadb.cjs.map +1 -1
- package/dist/cjs/chromadb.d.cts +93 -3
- package/package.json +1 -1
- package/src/AdminClient.ts +6 -7
- package/src/ChromaClient.ts +38 -2
- package/src/index.ts +2 -0
package/dist/chromadb.d.ts
CHANGED
|
@@ -1433,7 +1433,7 @@ declare class ChromaClient {
|
|
|
1433
1433
|
*/
|
|
1434
1434
|
getOrCreateCollection({ name, metadata, embeddingFunction, }: GetOrCreateCollectionParams): Promise<Collection>;
|
|
1435
1435
|
/**
|
|
1436
|
-
*
|
|
1436
|
+
* Get all collection names.
|
|
1437
1437
|
*
|
|
1438
1438
|
* @returns {Promise<string[]>} A promise that resolves to a list of collection names.
|
|
1439
1439
|
* @param {PositiveInteger} [params.limit] - Optional limit on the number of items to get.
|
|
@@ -1449,6 +1449,26 @@ declare class ChromaClient {
|
|
|
1449
1449
|
* ```
|
|
1450
1450
|
*/
|
|
1451
1451
|
listCollections({ limit, offset }?: ListCollectionsParams): Promise<string[]>;
|
|
1452
|
+
/**
|
|
1453
|
+
* List collection names, IDs, and metadata.
|
|
1454
|
+
*
|
|
1455
|
+
* @param {PositiveInteger} [params.limit] - Optional limit on the number of items to get.
|
|
1456
|
+
* @param {PositiveInteger} [params.offset] - Optional offset on the items to get.
|
|
1457
|
+
* @throws {Error} If there is an issue listing the collections.
|
|
1458
|
+
* @returns {Promise<{ name: string, id: string, metadata?: CollectionMetadata }[]>} A promise that resolves to a list of collection names, IDs, and metadata.
|
|
1459
|
+
*
|
|
1460
|
+
* @example
|
|
1461
|
+
* ```typescript
|
|
1462
|
+
* const collections = await client.listCollectionsAndMetadata({
|
|
1463
|
+
* limit: 10,
|
|
1464
|
+
* offset: 0,
|
|
1465
|
+
* });
|
|
1466
|
+
*/
|
|
1467
|
+
listCollectionsAndMetadata({ limit, offset, }?: ListCollectionsParams): Promise<{
|
|
1468
|
+
name: string;
|
|
1469
|
+
id: string;
|
|
1470
|
+
metadata?: CollectionMetadata;
|
|
1471
|
+
}[]>;
|
|
1452
1472
|
/**
|
|
1453
1473
|
* Counts all collections.
|
|
1454
1474
|
*
|
|
@@ -1498,6 +1518,8 @@ interface Tenant {
|
|
|
1498
1518
|
name: string;
|
|
1499
1519
|
}
|
|
1500
1520
|
interface Database {
|
|
1521
|
+
id: string;
|
|
1522
|
+
tenant: string;
|
|
1501
1523
|
name: string;
|
|
1502
1524
|
}
|
|
1503
1525
|
declare class AdminClient {
|
|
@@ -1628,7 +1650,9 @@ declare class AdminClient {
|
|
|
1628
1650
|
createDatabase({ name, tenantName, }: {
|
|
1629
1651
|
name: string;
|
|
1630
1652
|
tenantName: string;
|
|
1631
|
-
}): Promise<
|
|
1653
|
+
}): Promise<{
|
|
1654
|
+
name: string;
|
|
1655
|
+
}>;
|
|
1632
1656
|
/**
|
|
1633
1657
|
* Gets a database with the specified properties.
|
|
1634
1658
|
*
|
|
@@ -1831,4 +1855,70 @@ declare class OllamaEmbeddingFunction implements IEmbeddingFunction {
|
|
|
1831
1855
|
generate(texts: string[]): Promise<number[][]>;
|
|
1832
1856
|
}
|
|
1833
1857
|
|
|
1834
|
-
|
|
1858
|
+
/**
|
|
1859
|
+
* This is a generic Chroma error.
|
|
1860
|
+
*/
|
|
1861
|
+
declare class ChromaError extends Error {
|
|
1862
|
+
readonly cause?: unknown | undefined;
|
|
1863
|
+
constructor(name: string, message: string, cause?: unknown | undefined);
|
|
1864
|
+
}
|
|
1865
|
+
/**
|
|
1866
|
+
* Indicates that there was a problem with the connection to the Chroma server (e.g. the server is down or the client is not connected to the internet)
|
|
1867
|
+
*/
|
|
1868
|
+
declare class ChromaConnectionError extends Error {
|
|
1869
|
+
readonly cause?: unknown | undefined;
|
|
1870
|
+
name: string;
|
|
1871
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
1872
|
+
}
|
|
1873
|
+
/** Indicates that the server encountered an error while handling the request. */
|
|
1874
|
+
declare class ChromaServerError extends Error {
|
|
1875
|
+
readonly cause?: unknown | undefined;
|
|
1876
|
+
name: string;
|
|
1877
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
1878
|
+
}
|
|
1879
|
+
/** Indicate that there was an issue with the request that the client made. */
|
|
1880
|
+
declare class ChromaClientError extends Error {
|
|
1881
|
+
readonly cause?: unknown | undefined;
|
|
1882
|
+
name: string;
|
|
1883
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
1884
|
+
}
|
|
1885
|
+
/** The request lacked valid authentication. */
|
|
1886
|
+
declare class ChromaUnauthorizedError extends Error {
|
|
1887
|
+
readonly cause?: unknown | undefined;
|
|
1888
|
+
name: string;
|
|
1889
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
1890
|
+
}
|
|
1891
|
+
/** The user does not have permission to access the requested resource. */
|
|
1892
|
+
declare class ChromaForbiddenError extends Error {
|
|
1893
|
+
readonly cause?: unknown | undefined;
|
|
1894
|
+
name: string;
|
|
1895
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
1896
|
+
}
|
|
1897
|
+
declare class ChromaNotFoundError extends Error {
|
|
1898
|
+
readonly cause?: unknown | undefined;
|
|
1899
|
+
name: string;
|
|
1900
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
1901
|
+
}
|
|
1902
|
+
declare class ChromaValueError extends Error {
|
|
1903
|
+
readonly cause?: unknown | undefined;
|
|
1904
|
+
name: string;
|
|
1905
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
1906
|
+
}
|
|
1907
|
+
declare class InvalidCollectionError extends Error {
|
|
1908
|
+
readonly cause?: unknown | undefined;
|
|
1909
|
+
name: string;
|
|
1910
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
1911
|
+
}
|
|
1912
|
+
declare class InvalidArgumentError extends Error {
|
|
1913
|
+
readonly cause?: unknown | undefined;
|
|
1914
|
+
name: string;
|
|
1915
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
1916
|
+
}
|
|
1917
|
+
declare class ChromaUniqueError extends Error {
|
|
1918
|
+
readonly cause?: unknown | undefined;
|
|
1919
|
+
name: string;
|
|
1920
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
1921
|
+
}
|
|
1922
|
+
declare function createErrorByType(type: string, message: string): InvalidCollectionError | InvalidArgumentError | undefined;
|
|
1923
|
+
|
|
1924
|
+
export { AddRecordsParams, AdminClient, ChromaClient, ChromaClientError, ChromaClientParams, ChromaConnectionError, ChromaError, ChromaForbiddenError, ChromaNotFoundError, ChromaServerError, ChromaUnauthorizedError, ChromaUniqueError, ChromaValueError, CloudClient, CohereEmbeddingFunction, Collection, CollectionMetadata, CollectionParams, CreateCollectionParams, DefaultEmbeddingFunction, DeleteCollectionParams, DeleteParams, Document, Documents, Embedding, Embeddings, GetCollectionParams, GetOrCreateCollectionParams, GetParams, GetResponse, GoogleGenerativeAiEmbeddingFunction, HuggingFaceEmbeddingServerFunction, ID, IDs, IEmbeddingFunction, IncludeEnum, InvalidArgumentError, InvalidCollectionError, JinaEmbeddingFunction, ListCollectionsParams, Metadata, Metadatas, ModifyCollectionParams, OllamaEmbeddingFunction, OpenAIEmbeddingFunction, PeekParams, QueryRecordsParams, QueryResponse, TransformersEmbeddingFunction, UpdateRecordsParams, UpsertRecordsParams, Where, WhereDocument, createErrorByType };
|
|
@@ -4267,12 +4267,12 @@ var AdminClient = class {
|
|
|
4267
4267
|
name,
|
|
4268
4268
|
tenantName
|
|
4269
4269
|
}) {
|
|
4270
|
-
const
|
|
4270
|
+
const result = await this.api.getDatabase(
|
|
4271
4271
|
name,
|
|
4272
4272
|
tenantName,
|
|
4273
4273
|
this.api.options
|
|
4274
4274
|
);
|
|
4275
|
-
return
|
|
4275
|
+
return result;
|
|
4276
4276
|
}
|
|
4277
4277
|
/**
|
|
4278
4278
|
* Deletes a database.
|
|
@@ -4305,13 +4305,12 @@ var AdminClient = class {
|
|
|
4305
4305
|
offset,
|
|
4306
4306
|
tenantName
|
|
4307
4307
|
}) {
|
|
4308
|
-
|
|
4308
|
+
return await this.api.listDatabases(
|
|
4309
4309
|
tenantName,
|
|
4310
4310
|
limit,
|
|
4311
4311
|
offset,
|
|
4312
4312
|
this.api.options
|
|
4313
4313
|
);
|
|
4314
|
-
return listDatabases.map((db) => ({ name: db.name }));
|
|
4315
4314
|
}
|
|
4316
4315
|
};
|
|
4317
4316
|
|
|
@@ -4616,7 +4615,7 @@ var ChromaClient = class {
|
|
|
4616
4615
|
});
|
|
4617
4616
|
}
|
|
4618
4617
|
/**
|
|
4619
|
-
*
|
|
4618
|
+
* Get all collection names.
|
|
4620
4619
|
*
|
|
4621
4620
|
* @returns {Promise<string[]>} A promise that resolves to a list of collection names.
|
|
4622
4621
|
* @param {PositiveInteger} [params.limit] - Optional limit on the number of items to get.
|
|
@@ -4642,6 +4641,34 @@ var ChromaClient = class {
|
|
|
4642
4641
|
);
|
|
4643
4642
|
return collections.map((collection) => collection.name);
|
|
4644
4643
|
}
|
|
4644
|
+
/**
|
|
4645
|
+
* List collection names, IDs, and metadata.
|
|
4646
|
+
*
|
|
4647
|
+
* @param {PositiveInteger} [params.limit] - Optional limit on the number of items to get.
|
|
4648
|
+
* @param {PositiveInteger} [params.offset] - Optional offset on the items to get.
|
|
4649
|
+
* @throws {Error} If there is an issue listing the collections.
|
|
4650
|
+
* @returns {Promise<{ name: string, id: string, metadata?: CollectionMetadata }[]>} A promise that resolves to a list of collection names, IDs, and metadata.
|
|
4651
|
+
*
|
|
4652
|
+
* @example
|
|
4653
|
+
* ```typescript
|
|
4654
|
+
* const collections = await client.listCollectionsAndMetadata({
|
|
4655
|
+
* limit: 10,
|
|
4656
|
+
* offset: 0,
|
|
4657
|
+
* });
|
|
4658
|
+
*/
|
|
4659
|
+
async listCollectionsAndMetadata({
|
|
4660
|
+
limit,
|
|
4661
|
+
offset
|
|
4662
|
+
} = {}) {
|
|
4663
|
+
await this.init();
|
|
4664
|
+
return await this.api.listCollections(
|
|
4665
|
+
this.tenant,
|
|
4666
|
+
this.database,
|
|
4667
|
+
limit,
|
|
4668
|
+
offset,
|
|
4669
|
+
this.api.options
|
|
4670
|
+
);
|
|
4671
|
+
}
|
|
4645
4672
|
/**
|
|
4646
4673
|
* Counts all collections.
|
|
4647
4674
|
*
|
|
@@ -5159,15 +5186,27 @@ var OllamaEmbeddingFunction = class {
|
|
|
5159
5186
|
export {
|
|
5160
5187
|
AdminClient,
|
|
5161
5188
|
ChromaClient,
|
|
5189
|
+
ChromaClientError,
|
|
5190
|
+
ChromaConnectionError,
|
|
5191
|
+
ChromaError,
|
|
5192
|
+
ChromaForbiddenError,
|
|
5193
|
+
ChromaNotFoundError,
|
|
5194
|
+
ChromaServerError,
|
|
5195
|
+
ChromaUnauthorizedError,
|
|
5196
|
+
ChromaUniqueError,
|
|
5197
|
+
ChromaValueError,
|
|
5162
5198
|
CloudClient,
|
|
5163
5199
|
CohereEmbeddingFunction,
|
|
5164
5200
|
Collection,
|
|
5165
5201
|
DefaultEmbeddingFunction,
|
|
5166
5202
|
GoogleGenerativeAiEmbeddingFunction,
|
|
5167
5203
|
HuggingFaceEmbeddingServerFunction,
|
|
5204
|
+
InvalidArgumentError,
|
|
5205
|
+
InvalidCollectionError,
|
|
5168
5206
|
JinaEmbeddingFunction,
|
|
5169
5207
|
OllamaEmbeddingFunction,
|
|
5170
5208
|
OpenAIEmbeddingFunction,
|
|
5171
|
-
TransformersEmbeddingFunction
|
|
5209
|
+
TransformersEmbeddingFunction,
|
|
5210
|
+
createErrorByType
|
|
5172
5211
|
};
|
|
5173
5212
|
//# sourceMappingURL=chromadb.mjs.map
|
package/dist/chromadb.mjs
CHANGED
|
@@ -4267,12 +4267,12 @@ var AdminClient = class {
|
|
|
4267
4267
|
name,
|
|
4268
4268
|
tenantName
|
|
4269
4269
|
}) {
|
|
4270
|
-
const
|
|
4270
|
+
const result = await this.api.getDatabase(
|
|
4271
4271
|
name,
|
|
4272
4272
|
tenantName,
|
|
4273
4273
|
this.api.options
|
|
4274
4274
|
);
|
|
4275
|
-
return
|
|
4275
|
+
return result;
|
|
4276
4276
|
}
|
|
4277
4277
|
/**
|
|
4278
4278
|
* Deletes a database.
|
|
@@ -4305,13 +4305,12 @@ var AdminClient = class {
|
|
|
4305
4305
|
offset,
|
|
4306
4306
|
tenantName
|
|
4307
4307
|
}) {
|
|
4308
|
-
|
|
4308
|
+
return await this.api.listDatabases(
|
|
4309
4309
|
tenantName,
|
|
4310
4310
|
limit,
|
|
4311
4311
|
offset,
|
|
4312
4312
|
this.api.options
|
|
4313
4313
|
);
|
|
4314
|
-
return listDatabases.map((db) => ({ name: db.name }));
|
|
4315
4314
|
}
|
|
4316
4315
|
};
|
|
4317
4316
|
|
|
@@ -4616,7 +4615,7 @@ var ChromaClient = class {
|
|
|
4616
4615
|
});
|
|
4617
4616
|
}
|
|
4618
4617
|
/**
|
|
4619
|
-
*
|
|
4618
|
+
* Get all collection names.
|
|
4620
4619
|
*
|
|
4621
4620
|
* @returns {Promise<string[]>} A promise that resolves to a list of collection names.
|
|
4622
4621
|
* @param {PositiveInteger} [params.limit] - Optional limit on the number of items to get.
|
|
@@ -4642,6 +4641,34 @@ var ChromaClient = class {
|
|
|
4642
4641
|
);
|
|
4643
4642
|
return collections.map((collection) => collection.name);
|
|
4644
4643
|
}
|
|
4644
|
+
/**
|
|
4645
|
+
* List collection names, IDs, and metadata.
|
|
4646
|
+
*
|
|
4647
|
+
* @param {PositiveInteger} [params.limit] - Optional limit on the number of items to get.
|
|
4648
|
+
* @param {PositiveInteger} [params.offset] - Optional offset on the items to get.
|
|
4649
|
+
* @throws {Error} If there is an issue listing the collections.
|
|
4650
|
+
* @returns {Promise<{ name: string, id: string, metadata?: CollectionMetadata }[]>} A promise that resolves to a list of collection names, IDs, and metadata.
|
|
4651
|
+
*
|
|
4652
|
+
* @example
|
|
4653
|
+
* ```typescript
|
|
4654
|
+
* const collections = await client.listCollectionsAndMetadata({
|
|
4655
|
+
* limit: 10,
|
|
4656
|
+
* offset: 0,
|
|
4657
|
+
* });
|
|
4658
|
+
*/
|
|
4659
|
+
async listCollectionsAndMetadata({
|
|
4660
|
+
limit,
|
|
4661
|
+
offset
|
|
4662
|
+
} = {}) {
|
|
4663
|
+
await this.init();
|
|
4664
|
+
return await this.api.listCollections(
|
|
4665
|
+
this.tenant,
|
|
4666
|
+
this.database,
|
|
4667
|
+
limit,
|
|
4668
|
+
offset,
|
|
4669
|
+
this.api.options
|
|
4670
|
+
);
|
|
4671
|
+
}
|
|
4645
4672
|
/**
|
|
4646
4673
|
* Counts all collections.
|
|
4647
4674
|
*
|
|
@@ -5159,15 +5186,27 @@ var OllamaEmbeddingFunction = class {
|
|
|
5159
5186
|
export {
|
|
5160
5187
|
AdminClient,
|
|
5161
5188
|
ChromaClient,
|
|
5189
|
+
ChromaClientError,
|
|
5190
|
+
ChromaConnectionError,
|
|
5191
|
+
ChromaError,
|
|
5192
|
+
ChromaForbiddenError,
|
|
5193
|
+
ChromaNotFoundError,
|
|
5194
|
+
ChromaServerError,
|
|
5195
|
+
ChromaUnauthorizedError,
|
|
5196
|
+
ChromaUniqueError,
|
|
5197
|
+
ChromaValueError,
|
|
5162
5198
|
CloudClient,
|
|
5163
5199
|
CohereEmbeddingFunction,
|
|
5164
5200
|
Collection,
|
|
5165
5201
|
DefaultEmbeddingFunction,
|
|
5166
5202
|
GoogleGenerativeAiEmbeddingFunction,
|
|
5167
5203
|
HuggingFaceEmbeddingServerFunction,
|
|
5204
|
+
InvalidArgumentError,
|
|
5205
|
+
InvalidCollectionError,
|
|
5168
5206
|
JinaEmbeddingFunction,
|
|
5169
5207
|
OllamaEmbeddingFunction,
|
|
5170
5208
|
OpenAIEmbeddingFunction,
|
|
5171
|
-
TransformersEmbeddingFunction
|
|
5209
|
+
TransformersEmbeddingFunction,
|
|
5210
|
+
createErrorByType
|
|
5172
5211
|
};
|
|
5173
5212
|
//# sourceMappingURL=chromadb.mjs.map
|