chromadb 3.4.3 → 3.5.0

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.
@@ -55,8 +55,21 @@ type FloatListValueType$1 = {
55
55
  type FloatValueType$1 = {
56
56
  float_inverted_index?: null | FloatInvertedIndexType$1;
57
57
  };
58
+ /**
59
+ * Full-text search index algorithm.
60
+ *
61
+ * Controls which index format and query pipeline are used for
62
+ * document substring search within a collection.
63
+ */
64
+ type FtsAlgorithm = 'trigram' | 'token_bitmap';
58
65
  type FtsIndexConfig$1 = {
59
- [key: string]: never;
66
+ /**
67
+ * FTS index algorithm.
68
+ * Omitted from JSON when set to the default (Trigram) so that old
69
+ * servers/clients that do not know about this field can still
70
+ * deserialize the schema.
71
+ */
72
+ algorithm?: FtsAlgorithm;
60
73
  };
61
74
  type FtsIndexType$1 = {
62
75
  config: FtsIndexConfig$1;
@@ -209,10 +222,6 @@ type Schema$1 = {
209
222
  keys: {
210
223
  [key: string]: ValueTypes$1;
211
224
  };
212
- /**
213
- * ID of the attached function that created this output collection (if applicable)
214
- */
215
- source_attached_function_id?: string | null;
216
225
  };
217
226
  type SearchPayload = {
218
227
  filter?: {
@@ -284,6 +293,13 @@ type SpannIndexConfig = {
284
293
  write_rng_epsilon?: number | null;
285
294
  write_rng_factor?: number | null;
286
295
  };
296
+ /**
297
+ * Sparse vector index algorithm.
298
+ *
299
+ * Controls which posting list format and query engine are used for
300
+ * sparse vector search within a collection.
301
+ */
302
+ type SparseIndexAlgorithm = 'wand' | 'max_score';
287
303
  /**
288
304
  * Represents a sparse vector using parallel arrays for indices and values.
289
305
  *
@@ -307,6 +323,13 @@ type SparseVector = {
307
323
  values: Array<number>;
308
324
  };
309
325
  type SparseVectorIndexConfig$1 = {
326
+ /**
327
+ * Sparse index algorithm (cloud-only, tenant-gated).
328
+ * Omitted from JSON when set to the default (Wand) so that old
329
+ * servers/clients that do not know about this field can still
330
+ * deserialize the schema.
331
+ */
332
+ algorithm?: SparseIndexAlgorithm;
310
333
  /**
311
334
  * Whether this embedding is BM25
312
335
  */
@@ -396,10 +419,13 @@ type UserIdentity = GetUserIdentityResponse;
396
419
  * All committed writes will be visible. This is the default.
397
420
  * - INDEX_ONLY: Read only from the compacted index, skipping the WAL.
398
421
  * Recent writes that haven't been compacted may not be visible, but queries are faster.
422
+ * - INDEX_AND_BOUNDED_WAL: Read from the index and up to a server-configured number of
423
+ * WAL entries for bounded query latency.
399
424
  */
400
425
  declare const ReadLevel: {
401
426
  readonly INDEX_AND_WAL: "index_and_wal";
402
427
  readonly INDEX_ONLY: "index_only";
428
+ readonly INDEX_AND_BOUNDED_WAL: "index_and_bounded_wal";
403
429
  };
404
430
  type ReadLevel = (typeof ReadLevel)[keyof typeof ReadLevel];
405
431
 
@@ -1290,7 +1316,6 @@ declare class Schema {
1290
1316
  private setIndexForKey;
1291
1317
  private enableAllIndexesForKey;
1292
1318
  private disableAllIndexesForKey;
1293
- private validateSingleSparseVectorIndex;
1294
1319
  private validateSparseVectorConfig;
1295
1320
  private initializeDefaults;
1296
1321
  private initializeKeys;
@@ -1601,6 +1626,7 @@ interface Collection {
1601
1626
  * Controls whether to read from the write-ahead log.
1602
1627
  * - ReadLevel.INDEX_AND_WAL: Read from both index and WAL (default)
1603
1628
  * - ReadLevel.INDEX_ONLY: Read only from index, faster but recent writes may not be visible
1629
+ * - ReadLevel.INDEX_AND_BOUNDED_WAL: Read up to a server-configured number of WAL entries
1604
1630
  */
1605
1631
  readLevel?: ReadLevel;
1606
1632
  }): Promise<number>;
@@ -1754,6 +1780,7 @@ interface Collection {
1754
1780
  * Controls whether to read from the write-ahead log.
1755
1781
  * - ReadLevel.INDEX_AND_WAL: Read from both index and WAL (default)
1756
1782
  * - ReadLevel.INDEX_ONLY: Read only from index, faster but recent writes may not be visible
1783
+ * - ReadLevel.INDEX_AND_BOUNDED_WAL: Read up to a server-configured number of WAL entries
1757
1784
  */
1758
1785
  readLevel?: ReadLevel;
1759
1786
  }): Promise<SearchResult>;
@@ -26,7 +26,8 @@ if (typeof globalThis.Deno !== "undefined") {
26
26
  // src/types.ts
27
27
  var ReadLevel = {
28
28
  INDEX_AND_WAL: "index_and_wal",
29
- INDEX_ONLY: "index_only"
29
+ INDEX_ONLY: "index_only",
30
+ INDEX_AND_BOUNDED_WAL: "index_and_bounded_wal"
30
31
  };
31
32
  var baseRecordSetFields = [
32
33
  "ids",
@@ -3317,9 +3318,7 @@ var Schema = class _Schema {
3317
3318
  );
3318
3319
  }
3319
3320
  if (keyProvided && key && key === EMBEDDING_KEY) {
3320
- throw new Error(
3321
- "Cannot modify #embedding. Currently not supported"
3322
- );
3321
+ throw new Error("Cannot modify #embedding. Currently not supported");
3323
3322
  }
3324
3323
  if (keyProvided && key === DOCUMENT_KEY && !(config instanceof FtsIndexConfig)) {
3325
3324
  throw new Error(
@@ -3457,7 +3456,6 @@ var Schema = class _Schema {
3457
3456
  }
3458
3457
  setIndexForKey(key, config, enabled) {
3459
3458
  if (config instanceof SparseVectorIndexConfig && enabled) {
3460
- this.validateSingleSparseVectorIndex(key);
3461
3459
  this.validateSparseVectorConfig(config);
3462
3460
  }
3463
3461
  const current = this.keys[key] = ensureValueTypes(this.keys[key]);
@@ -3544,17 +3542,6 @@ var Schema = class _Schema {
3544
3542
  new BoolInvertedIndexType(false, new BoolInvertedIndexConfig())
3545
3543
  );
3546
3544
  }
3547
- validateSingleSparseVectorIndex(targetKey) {
3548
- for (const [existingKey, valueTypes] of Object.entries(this.keys)) {
3549
- if (existingKey === targetKey) continue;
3550
- const sparseIndex = valueTypes.sparseVector?.sparseVectorIndex;
3551
- if (sparseIndex?.enabled) {
3552
- throw new Error(
3553
- `Cannot enable sparse vector index on key '${targetKey}'. A sparse vector index is already enabled on key '${existingKey}'. Only one sparse vector index is allowed per collection.`
3554
- );
3555
- }
3556
- }
3557
- }
3558
3545
  validateSparseVectorConfig(config) {
3559
3546
  if (config.sourceKey !== null && config.sourceKey !== void 0 && !config.embeddingFunction) {
3560
3547
  throw new Error(
package/dist/chromadb.mjs CHANGED
@@ -26,7 +26,8 @@ if (typeof globalThis.Deno !== "undefined") {
26
26
  // src/types.ts
27
27
  var ReadLevel = {
28
28
  INDEX_AND_WAL: "index_and_wal",
29
- INDEX_ONLY: "index_only"
29
+ INDEX_ONLY: "index_only",
30
+ INDEX_AND_BOUNDED_WAL: "index_and_bounded_wal"
30
31
  };
31
32
  var baseRecordSetFields = [
32
33
  "ids",
@@ -3317,9 +3318,7 @@ var Schema = class _Schema {
3317
3318
  );
3318
3319
  }
3319
3320
  if (keyProvided && key && key === EMBEDDING_KEY) {
3320
- throw new Error(
3321
- "Cannot modify #embedding. Currently not supported"
3322
- );
3321
+ throw new Error("Cannot modify #embedding. Currently not supported");
3323
3322
  }
3324
3323
  if (keyProvided && key === DOCUMENT_KEY && !(config instanceof FtsIndexConfig)) {
3325
3324
  throw new Error(
@@ -3457,7 +3456,6 @@ var Schema = class _Schema {
3457
3456
  }
3458
3457
  setIndexForKey(key, config, enabled) {
3459
3458
  if (config instanceof SparseVectorIndexConfig && enabled) {
3460
- this.validateSingleSparseVectorIndex(key);
3461
3459
  this.validateSparseVectorConfig(config);
3462
3460
  }
3463
3461
  const current = this.keys[key] = ensureValueTypes(this.keys[key]);
@@ -3544,17 +3542,6 @@ var Schema = class _Schema {
3544
3542
  new BoolInvertedIndexType(false, new BoolInvertedIndexConfig())
3545
3543
  );
3546
3544
  }
3547
- validateSingleSparseVectorIndex(targetKey) {
3548
- for (const [existingKey, valueTypes] of Object.entries(this.keys)) {
3549
- if (existingKey === targetKey) continue;
3550
- const sparseIndex = valueTypes.sparseVector?.sparseVectorIndex;
3551
- if (sparseIndex?.enabled) {
3552
- throw new Error(
3553
- `Cannot enable sparse vector index on key '${targetKey}'. A sparse vector index is already enabled on key '${existingKey}'. Only one sparse vector index is allowed per collection.`
3554
- );
3555
- }
3556
- }
3557
- }
3558
3545
  validateSparseVectorConfig(config) {
3559
3546
  if (config.sourceKey !== null && config.sourceKey !== void 0 && !config.embeddingFunction) {
3560
3547
  throw new Error(