chromadb 3.1.3 → 3.1.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.
@@ -688,7 +688,7 @@ declare const registerSparseEmbeddingFunction: (name: string, fn: SparseEmbeddin
688
688
  * @param efConfig - Configuration for the embedding function
689
689
  * @returns EmbeddingFunction instance or undefined if it cannot be constructed
690
690
  */
691
- declare const getEmbeddingFunction: (collectionName: string, efConfig?: EmbeddingFunctionConfiguration, debug?: boolean) => Promise<EmbeddingFunction | undefined>;
691
+ declare const getEmbeddingFunction: (collectionName: string, efConfig?: EmbeddingFunctionConfiguration) => Promise<EmbeddingFunction | undefined>;
692
692
  /**
693
693
  * Retrieves and instantiates a sparse embedding function from configuration.
694
694
  * @param collectionName - Name of the collection (for error messages)
@@ -1325,7 +1325,7 @@ var registerSparseEmbeddingFunction = (name, fn) => {
1325
1325
  }
1326
1326
  knownSparseEmbeddingFunctions.set(name, fn);
1327
1327
  };
1328
- var getEmbeddingFunction = async (collectionName, efConfig, debug) => {
1328
+ var getEmbeddingFunction = async (collectionName, efConfig) => {
1329
1329
  if (!efConfig) {
1330
1330
  console.warn(
1331
1331
  `No embedding function configuration found for collection ${collectionName}. 'add' and 'query' will fail unless you provide them embeddings directly.`
@@ -1354,15 +1354,7 @@ var getEmbeddingFunction = async (collectionName, efConfig, debug) => {
1354
1354
  return void 0;
1355
1355
  }
1356
1356
  const packageName = pythonEmbeddingFunctions[efConfig.name] || efConfig.name;
1357
- if (debug) {
1358
- console.log("DEBUFFING");
1359
- console.log(packageName);
1360
- }
1361
1357
  if (packageName === "default-embed") {
1362
- console.log("INSIDE HIT");
1363
- if (debug) {
1364
- console.log("FROM DEBUG");
1365
- }
1366
1358
  await getDefaultEFConfig();
1367
1359
  }
1368
1360
  let embeddingFunction = knownEmbeddingFunctions.get(packageName);
@@ -3311,11 +3303,9 @@ var Schema = class _Schema {
3311
3303
  hnsw: json.hnsw ? cloneObject(json.hnsw) : null,
3312
3304
  spann: json.spann ? cloneObject(json.spann) : null
3313
3305
  });
3314
- console.log("SCHEMA THING 1");
3315
3306
  config.embeddingFunction = await getEmbeddingFunction(
3316
3307
  "schema deserialization",
3317
- json.embedding_function,
3318
- true
3308
+ json.embedding_function
3319
3309
  );
3320
3310
  if (!config.space && config.embeddingFunction?.defaultSpace) {
3321
3311
  config.space = config.embeddingFunction.defaultSpace();
@@ -4022,9 +4012,7 @@ var chromaFetch = async (input, init) => {
4022
4012
  case 429:
4023
4013
  throw new ChromaRateLimitError("Rate limit exceeded");
4024
4014
  }
4025
- throw new ChromaConnectionError(
4026
- `Unable to connect to the chromadb server (status: ${response.status}). Please try again later.`
4027
- );
4015
+ throw new ChromaServerError(`${response.status}: ${response.statusText}`);
4028
4016
  };
4029
4017
 
4030
4018
  // src/admin-client.ts
package/dist/chromadb.mjs CHANGED
@@ -1325,7 +1325,7 @@ var registerSparseEmbeddingFunction = (name, fn) => {
1325
1325
  }
1326
1326
  knownSparseEmbeddingFunctions.set(name, fn);
1327
1327
  };
1328
- var getEmbeddingFunction = async (collectionName, efConfig, debug) => {
1328
+ var getEmbeddingFunction = async (collectionName, efConfig) => {
1329
1329
  if (!efConfig) {
1330
1330
  console.warn(
1331
1331
  `No embedding function configuration found for collection ${collectionName}. 'add' and 'query' will fail unless you provide them embeddings directly.`
@@ -1354,15 +1354,7 @@ var getEmbeddingFunction = async (collectionName, efConfig, debug) => {
1354
1354
  return void 0;
1355
1355
  }
1356
1356
  const packageName = pythonEmbeddingFunctions[efConfig.name] || efConfig.name;
1357
- if (debug) {
1358
- console.log("DEBUFFING");
1359
- console.log(packageName);
1360
- }
1361
1357
  if (packageName === "default-embed") {
1362
- console.log("INSIDE HIT");
1363
- if (debug) {
1364
- console.log("FROM DEBUG");
1365
- }
1366
1358
  await getDefaultEFConfig();
1367
1359
  }
1368
1360
  let embeddingFunction = knownEmbeddingFunctions.get(packageName);
@@ -3311,11 +3303,9 @@ var Schema = class _Schema {
3311
3303
  hnsw: json.hnsw ? cloneObject(json.hnsw) : null,
3312
3304
  spann: json.spann ? cloneObject(json.spann) : null
3313
3305
  });
3314
- console.log("SCHEMA THING 1");
3315
3306
  config.embeddingFunction = await getEmbeddingFunction(
3316
3307
  "schema deserialization",
3317
- json.embedding_function,
3318
- true
3308
+ json.embedding_function
3319
3309
  );
3320
3310
  if (!config.space && config.embeddingFunction?.defaultSpace) {
3321
3311
  config.space = config.embeddingFunction.defaultSpace();
@@ -4022,9 +4012,7 @@ var chromaFetch = async (input, init) => {
4022
4012
  case 429:
4023
4013
  throw new ChromaRateLimitError("Rate limit exceeded");
4024
4014
  }
4025
- throw new ChromaConnectionError(
4026
- `Unable to connect to the chromadb server (status: ${response.status}). Please try again later.`
4027
- );
4015
+ throw new ChromaServerError(`${response.status}: ${response.statusText}`);
4028
4016
  };
4029
4017
 
4030
4018
  // src/admin-client.ts