chromadb 3.0.1-alpha.0 → 3.0.1
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 +3 -4
- package/dist/chromadb.legacy-esm.js +7 -9
- package/dist/chromadb.mjs +7 -9
- package/dist/chromadb.mjs.map +1 -1
- package/dist/cjs/chromadb.cjs +7 -9
- package/dist/cjs/chromadb.cjs.map +1 -1
- package/dist/cjs/chromadb.d.cts +3 -4
- package/package.json +2 -2
- package/src/chroma-client.ts +2 -2
- package/src/collection-configuration.ts +1 -5
- package/src/embedding-function.ts +1 -5
- package/src/utils.ts +2 -1
package/dist/chromadb.d.ts
CHANGED
|
@@ -289,10 +289,9 @@ interface EmbeddingFunction {
|
|
|
289
289
|
getConfig?(): Record<string, any>;
|
|
290
290
|
/**
|
|
291
291
|
* Validates that a configuration update is allowed.
|
|
292
|
-
* @param oldConfig - Previous configuration
|
|
293
292
|
* @param newConfig - New configuration to validate
|
|
294
293
|
*/
|
|
295
|
-
validateConfigUpdate?(
|
|
294
|
+
validateConfigUpdate?(newConfig: Record<string, any>): void;
|
|
296
295
|
/**
|
|
297
296
|
* Validates that a configuration object is valid.
|
|
298
297
|
* @param config - Configuration to validate
|
|
@@ -550,7 +549,7 @@ declare class ChromaClient {
|
|
|
550
549
|
* @param options.embeddingFunction - Optional embedding function to use
|
|
551
550
|
* @returns A CollectionAPI instance for the specified collection
|
|
552
551
|
*/
|
|
553
|
-
|
|
552
|
+
getCollectionById({ id, embeddingFunction, }: {
|
|
554
553
|
id: string;
|
|
555
554
|
embeddingFunction?: EmbeddingFunction;
|
|
556
555
|
}): CollectionAPI;
|
|
@@ -559,7 +558,7 @@ declare class ChromaClient {
|
|
|
559
558
|
* @param items - Array of collection IDs or objects with ID and optional embedding function
|
|
560
559
|
* @returns Array of CollectionAPI instances
|
|
561
560
|
*/
|
|
562
|
-
|
|
561
|
+
getCollectionsById(items: string[] | {
|
|
563
562
|
id: string;
|
|
564
563
|
embeddingFunction?: EmbeddingFunction;
|
|
565
564
|
}[]): CollectionAPIImpl[];
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
__publicField
|
|
3
3
|
} from "./chunk-NSSMTXJJ.mjs";
|
|
4
4
|
|
|
5
|
-
// src/deno
|
|
5
|
+
// src/deno.ts
|
|
6
6
|
if (typeof globalThis.Deno !== "undefined") {
|
|
7
7
|
const OriginalRequest = globalThis.Request;
|
|
8
8
|
const PatchedRequest = function(input, init) {
|
|
@@ -1047,7 +1047,8 @@ var validateWhere = (where) => {
|
|
|
1047
1047
|
`Expected 'where' value for $and or $or to be a list of 'where' expressions, but got ${value}`
|
|
1048
1048
|
);
|
|
1049
1049
|
}
|
|
1050
|
-
|
|
1050
|
+
value.forEach((w2) => validateWhere(w2));
|
|
1051
|
+
return;
|
|
1051
1052
|
}
|
|
1052
1053
|
if (typeof value === "object") {
|
|
1053
1054
|
if (Object.keys(value).length != 1) {
|
|
@@ -1206,11 +1207,8 @@ var processUpdateCollectionConfig = async ({
|
|
|
1206
1207
|
currentConfiguration.embeddingFunction ?? void 0
|
|
1207
1208
|
);
|
|
1208
1209
|
const newEmbeddingFunction = newConfiguration.embeddingFunction;
|
|
1209
|
-
if (embeddingFunction && embeddingFunction.validateConfigUpdate &&
|
|
1210
|
-
embeddingFunction.validateConfigUpdate(
|
|
1211
|
-
embeddingFunction.getConfig(),
|
|
1212
|
-
newEmbeddingFunction.getConfig()
|
|
1213
|
-
);
|
|
1210
|
+
if (embeddingFunction && embeddingFunction.validateConfigUpdate && newEmbeddingFunction && newEmbeddingFunction.getConfig) {
|
|
1211
|
+
embeddingFunction.validateConfigUpdate(newEmbeddingFunction.getConfig());
|
|
1214
1212
|
}
|
|
1215
1213
|
return {
|
|
1216
1214
|
updateConfiguration: {
|
|
@@ -2120,7 +2118,7 @@ var ChromaClient = class {
|
|
|
2120
2118
|
* @param options.embeddingFunction - Optional embedding function to use
|
|
2121
2119
|
* @returns A CollectionAPI instance for the specified collection
|
|
2122
2120
|
*/
|
|
2123
|
-
|
|
2121
|
+
getCollectionById({
|
|
2124
2122
|
id,
|
|
2125
2123
|
embeddingFunction
|
|
2126
2124
|
}) {
|
|
@@ -2136,7 +2134,7 @@ var ChromaClient = class {
|
|
|
2136
2134
|
* @param items - Array of collection IDs or objects with ID and optional embedding function
|
|
2137
2135
|
* @returns Array of CollectionAPI instances
|
|
2138
2136
|
*/
|
|
2139
|
-
|
|
2137
|
+
getCollectionsById(items) {
|
|
2140
2138
|
if (items.length === 0) return [];
|
|
2141
2139
|
let requestedCollections = items;
|
|
2142
2140
|
if (typeof items[0] === "string") {
|
package/dist/chromadb.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
__publicField
|
|
3
3
|
} from "./chunk-NSSMTXJJ.mjs";
|
|
4
4
|
|
|
5
|
-
// src/deno
|
|
5
|
+
// src/deno.ts
|
|
6
6
|
if (typeof globalThis.Deno !== "undefined") {
|
|
7
7
|
const OriginalRequest = globalThis.Request;
|
|
8
8
|
const PatchedRequest = function(input, init) {
|
|
@@ -1047,7 +1047,8 @@ var validateWhere = (where) => {
|
|
|
1047
1047
|
`Expected 'where' value for $and or $or to be a list of 'where' expressions, but got ${value}`
|
|
1048
1048
|
);
|
|
1049
1049
|
}
|
|
1050
|
-
|
|
1050
|
+
value.forEach((w2) => validateWhere(w2));
|
|
1051
|
+
return;
|
|
1051
1052
|
}
|
|
1052
1053
|
if (typeof value === "object") {
|
|
1053
1054
|
if (Object.keys(value).length != 1) {
|
|
@@ -1206,11 +1207,8 @@ var processUpdateCollectionConfig = async ({
|
|
|
1206
1207
|
currentConfiguration.embeddingFunction ?? void 0
|
|
1207
1208
|
);
|
|
1208
1209
|
const newEmbeddingFunction = newConfiguration.embeddingFunction;
|
|
1209
|
-
if (embeddingFunction && embeddingFunction.validateConfigUpdate &&
|
|
1210
|
-
embeddingFunction.validateConfigUpdate(
|
|
1211
|
-
embeddingFunction.getConfig(),
|
|
1212
|
-
newEmbeddingFunction.getConfig()
|
|
1213
|
-
);
|
|
1210
|
+
if (embeddingFunction && embeddingFunction.validateConfigUpdate && newEmbeddingFunction && newEmbeddingFunction.getConfig) {
|
|
1211
|
+
embeddingFunction.validateConfigUpdate(newEmbeddingFunction.getConfig());
|
|
1214
1212
|
}
|
|
1215
1213
|
return {
|
|
1216
1214
|
updateConfiguration: {
|
|
@@ -2120,7 +2118,7 @@ var ChromaClient = class {
|
|
|
2120
2118
|
* @param options.embeddingFunction - Optional embedding function to use
|
|
2121
2119
|
* @returns A CollectionAPI instance for the specified collection
|
|
2122
2120
|
*/
|
|
2123
|
-
|
|
2121
|
+
getCollectionById({
|
|
2124
2122
|
id,
|
|
2125
2123
|
embeddingFunction
|
|
2126
2124
|
}) {
|
|
@@ -2136,7 +2134,7 @@ var ChromaClient = class {
|
|
|
2136
2134
|
* @param items - Array of collection IDs or objects with ID and optional embedding function
|
|
2137
2135
|
* @returns Array of CollectionAPI instances
|
|
2138
2136
|
*/
|
|
2139
|
-
|
|
2137
|
+
getCollectionsById(items) {
|
|
2140
2138
|
if (items.length === 0) return [];
|
|
2141
2139
|
let requestedCollections = items;
|
|
2142
2140
|
if (typeof items[0] === "string") {
|