chromadb 3.2.0 → 3.2.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.
@@ -86,6 +86,12 @@ type HnswIndexConfig = {
86
86
  sync_threshold?: number | null;
87
87
  };
88
88
  type Include = 'distances' | 'documents' | 'embeddings' | 'metadatas' | 'uris';
89
+ type IndexStatusResponse = {
90
+ num_indexed_ops: number;
91
+ num_unindexed_ops: number;
92
+ op_indexing_progress: number;
93
+ total_ops: number;
94
+ };
89
95
  type IntInvertedIndexConfig$1 = {
90
96
  [key: string]: never;
91
97
  };
@@ -366,6 +372,19 @@ type VectorIndexType$1 = {
366
372
  * User identity information including tenant and database access.
367
373
  */
368
374
  type UserIdentity = GetUserIdentityResponse;
375
+ /**
376
+ * Read level controls whether queries read from the write-ahead log (WAL).
377
+ *
378
+ * - INDEX_AND_WAL: Read from both the compacted index and the WAL.
379
+ * All committed writes will be visible. This is the default.
380
+ * - INDEX_ONLY: Read only from the compacted index, skipping the WAL.
381
+ * Recent writes that haven't been compacted may not be visible, but queries are faster.
382
+ */
383
+ declare const ReadLevel: {
384
+ readonly INDEX_AND_WAL: "index_and_wal";
385
+ readonly INDEX_ONLY: "index_only";
386
+ };
387
+ type ReadLevel = (typeof ReadLevel)[keyof typeof ReadLevel];
369
388
 
370
389
  /**
371
390
  * Metadata that can be associated with a collection.
@@ -567,6 +586,10 @@ declare class QueryResult<TMeta extends Metadata = Metadata> {
567
586
  */
568
587
  rows(): QueryRowResult<TMeta>[][];
569
588
  }
589
+ /**
590
+ * Re-export IndexStatusResponse type for external use
591
+ */
592
+ type IndexingStatus = IndexStatusResponse;
570
593
 
571
594
  /**
572
595
  * Supported vector space types.
@@ -1643,6 +1666,11 @@ interface Collection {
1643
1666
  * @returns Promise resolving to column-major search results
1644
1667
  */
1645
1668
  search(searches: SearchLike | SearchLike[]): Promise<SearchResult>;
1669
+ /**
1670
+ * Gets the indexing status of the collection.
1671
+ * @returns Promise resolving to indexing status information
1672
+ */
1673
+ getIndexingStatus(): Promise<IndexingStatus>;
1646
1674
  }
1647
1675
 
1648
1676
  declare function withChroma(userNextConfig?: any): any;
@@ -1862,4 +1890,4 @@ declare class ChromaRateLimitError extends Error {
1862
1890
  }
1863
1891
  declare function createErrorByType(type: string, message: string): InvalidCollectionError | InvalidArgumentError | undefined;
1864
1892
 
1865
- export { Abs, AdminClient, type AdminClientArgs, AdminCloudClient, Aggregate, type AggregateInput, type AggregateJSON, type AnyEmbeddingFunction, type BaseRecordSet, BoolInvertedIndexConfig, BoolInvertedIndexType, BoolValueType, ChromaClient, type ChromaClientArgs, ChromaClientError, ChromaConnectionError, ChromaError, ChromaForbiddenError, ChromaNotFoundError, ChromaQuotaExceededError, ChromaRateLimitError, ChromaServerError, ChromaUnauthorizedError, ChromaUniqueError, ChromaValueError, CloudClient, Cmek, CmekProvider, type Collection, type CollectionConfiguration, type CollectionMetadata, type CreateCollectionConfiguration, DOCUMENT_KEY, Div, EMBEDDING_KEY, type EmbeddingFunction, type EmbeddingFunctionClass, type EmbeddingFunctionSpace, Exp, FloatInvertedIndexConfig, FloatInvertedIndexType, FloatListValueType, FloatValueType, FtsIndexConfig, FtsIndexType, GetResult, GroupBy, type GroupByInput, type GroupByJSON, type HNSWConfiguration, IncludeEnum, type IndexConfig, IntInvertedIndexConfig, IntInvertedIndexType, IntValueType, InvalidArgumentError, InvalidCollectionError, K, Key, type KeyFactory, Knn, type KnnOptions, Limit, type LimitInput, type LimitOptions, type ListDatabasesArgs, Log, Max, MaxK, type Metadata, Min, MinK, Mul, type PreparedInsertRecordSet, type PreparedRecordSet, type QueryRecordSet, QueryResult, type QueryRowResult, RankExpression, type RankInput, type RankLiteral, type RecordSet, Rrf, type RrfOptions, Schema, Search, type SearchInit, type SearchLike, SearchResult, type SearchResultRow, Select, type SelectInput, type SelectKeyInput, type SparseEmbeddingFunction, type SparseEmbeddingFunctionClass, type SparseVector, SparseVectorIndexConfig, type SparseVectorIndexConfigOptions, SparseVectorIndexType, SparseVectorValueType, StringInvertedIndexConfig, StringInvertedIndexType, StringValueType, Sub, Sum, type UpdateCollectionConfiguration, type UpdateHNSWConfiguration, type UpdateSPANNConfiguration, type UserIdentity, Val, ValueTypes, VectorIndexConfig, type VectorIndexConfigOptions, VectorIndexType, type Where, type WhereDocument, WhereExpression, type WhereInput, type WhereJSON, baseRecordSetFields, createErrorByType, getDefaultEFConfig, getEmbeddingFunction, getSparseEmbeddingFunction, knownEmbeddingFunctions, knownSparseEmbeddingFunctions, processCreateCollectionConfig, processUpdateCollectionConfig, recordSetFields, registerEmbeddingFunction, registerSparseEmbeddingFunction, serializeEmbeddingFunction, toSearch, withChroma };
1893
+ export { Abs, AdminClient, type AdminClientArgs, AdminCloudClient, Aggregate, type AggregateInput, type AggregateJSON, type AnyEmbeddingFunction, type BaseRecordSet, BoolInvertedIndexConfig, BoolInvertedIndexType, BoolValueType, ChromaClient, type ChromaClientArgs, ChromaClientError, ChromaConnectionError, ChromaError, ChromaForbiddenError, ChromaNotFoundError, ChromaQuotaExceededError, ChromaRateLimitError, ChromaServerError, ChromaUnauthorizedError, ChromaUniqueError, ChromaValueError, CloudClient, Cmek, CmekProvider, type Collection, type CollectionConfiguration, type CollectionMetadata, type CreateCollectionConfiguration, DOCUMENT_KEY, Div, EMBEDDING_KEY, type EmbeddingFunction, type EmbeddingFunctionClass, type EmbeddingFunctionSpace, Exp, FloatInvertedIndexConfig, FloatInvertedIndexType, FloatListValueType, FloatValueType, FtsIndexConfig, FtsIndexType, GetResult, GroupBy, type GroupByInput, type GroupByJSON, type HNSWConfiguration, IncludeEnum, type IndexConfig, type IndexingStatus, IntInvertedIndexConfig, IntInvertedIndexType, IntValueType, InvalidArgumentError, InvalidCollectionError, K, Key, type KeyFactory, Knn, type KnnOptions, Limit, type LimitInput, type LimitOptions, type ListDatabasesArgs, Log, Max, MaxK, type Metadata, Min, MinK, Mul, type PreparedInsertRecordSet, type PreparedRecordSet, type QueryRecordSet, QueryResult, type QueryRowResult, RankExpression, type RankInput, type RankLiteral, ReadLevel, type RecordSet, Rrf, type RrfOptions, Schema, Search, type SearchInit, type SearchLike, SearchResult, type SearchResultRow, Select, type SelectInput, type SelectKeyInput, type SparseEmbeddingFunction, type SparseEmbeddingFunctionClass, type SparseVector, SparseVectorIndexConfig, type SparseVectorIndexConfigOptions, SparseVectorIndexType, SparseVectorValueType, StringInvertedIndexConfig, StringInvertedIndexType, StringValueType, Sub, Sum, type UpdateCollectionConfiguration, type UpdateHNSWConfiguration, type UpdateSPANNConfiguration, type UserIdentity, Val, ValueTypes, VectorIndexConfig, type VectorIndexConfigOptions, VectorIndexType, type Where, type WhereDocument, WhereExpression, type WhereInput, type WhereJSON, baseRecordSetFields, createErrorByType, getDefaultEFConfig, getEmbeddingFunction, getSparseEmbeddingFunction, knownEmbeddingFunctions, knownSparseEmbeddingFunctions, processCreateCollectionConfig, processUpdateCollectionConfig, recordSetFields, registerEmbeddingFunction, registerSparseEmbeddingFunction, serializeEmbeddingFunction, toSearch, withChroma };
@@ -24,6 +24,10 @@ if (typeof globalThis.Deno !== "undefined") {
24
24
  }
25
25
 
26
26
  // src/types.ts
27
+ var ReadLevel = {
28
+ INDEX_AND_WAL: "index_and_wal",
29
+ INDEX_ONLY: "index_only"
30
+ };
27
31
  var baseRecordSetFields = [
28
32
  "ids",
29
33
  "embeddings",
@@ -640,6 +644,15 @@ var DefaultService = class {
640
644
  }
641
645
  });
642
646
  }
647
+ /**
648
+ * Retrieves the indexing status of a collection.
649
+ */
650
+ static indexingStatus(options) {
651
+ return (options.client ?? client).get({
652
+ url: "/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/indexing_status",
653
+ ...options
654
+ });
655
+ }
643
656
  /**
644
657
  * Query a collection in a variety of ways, including vector search, metadata filtering, and full-text search
645
658
  */
@@ -4094,7 +4107,7 @@ var CollectionImpl = class _CollectionImpl {
4094
4107
  uris: data.uris ?? []
4095
4108
  });
4096
4109
  }
4097
- async search(searches) {
4110
+ async search(searches, options) {
4098
4111
  const items = Array.isArray(searches) ? searches : [searches];
4099
4112
  if (items.length === 0) {
4100
4113
  throw new ChromaValueError(
@@ -4110,7 +4123,10 @@ var CollectionImpl = class _CollectionImpl {
4110
4123
  const { data } = await DefaultService.collectionSearch({
4111
4124
  client: this.apiClient,
4112
4125
  path: await this.path(),
4113
- body: { searches: payloads }
4126
+ body: {
4127
+ searches: payloads,
4128
+ read_level: options?.readLevel
4129
+ }
4114
4130
  });
4115
4131
  return new SearchResult(data);
4116
4132
  }
@@ -4244,6 +4260,13 @@ var CollectionImpl = class _CollectionImpl {
4244
4260
  }
4245
4261
  });
4246
4262
  }
4263
+ async getIndexingStatus() {
4264
+ const { data } = await DefaultService.indexingStatus({
4265
+ client: this.apiClient,
4266
+ path: await this.path()
4267
+ });
4268
+ return data;
4269
+ }
4247
4270
  };
4248
4271
 
4249
4272
  // src/next.ts
@@ -5000,6 +5023,7 @@ export {
5000
5023
  Mul,
5001
5024
  QueryResult,
5002
5025
  RankExpression,
5026
+ ReadLevel,
5003
5027
  Rrf,
5004
5028
  Schema,
5005
5029
  Search,
package/dist/chromadb.mjs CHANGED
@@ -24,6 +24,10 @@ if (typeof globalThis.Deno !== "undefined") {
24
24
  }
25
25
 
26
26
  // src/types.ts
27
+ var ReadLevel = {
28
+ INDEX_AND_WAL: "index_and_wal",
29
+ INDEX_ONLY: "index_only"
30
+ };
27
31
  var baseRecordSetFields = [
28
32
  "ids",
29
33
  "embeddings",
@@ -640,6 +644,15 @@ var DefaultService = class {
640
644
  }
641
645
  });
642
646
  }
647
+ /**
648
+ * Retrieves the indexing status of a collection.
649
+ */
650
+ static indexingStatus(options) {
651
+ return (options.client ?? client).get({
652
+ url: "/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/indexing_status",
653
+ ...options
654
+ });
655
+ }
643
656
  /**
644
657
  * Query a collection in a variety of ways, including vector search, metadata filtering, and full-text search
645
658
  */
@@ -4094,7 +4107,7 @@ var CollectionImpl = class _CollectionImpl {
4094
4107
  uris: data.uris ?? []
4095
4108
  });
4096
4109
  }
4097
- async search(searches) {
4110
+ async search(searches, options) {
4098
4111
  const items = Array.isArray(searches) ? searches : [searches];
4099
4112
  if (items.length === 0) {
4100
4113
  throw new ChromaValueError(
@@ -4110,7 +4123,10 @@ var CollectionImpl = class _CollectionImpl {
4110
4123
  const { data } = await DefaultService.collectionSearch({
4111
4124
  client: this.apiClient,
4112
4125
  path: await this.path(),
4113
- body: { searches: payloads }
4126
+ body: {
4127
+ searches: payloads,
4128
+ read_level: options?.readLevel
4129
+ }
4114
4130
  });
4115
4131
  return new SearchResult(data);
4116
4132
  }
@@ -4244,6 +4260,13 @@ var CollectionImpl = class _CollectionImpl {
4244
4260
  }
4245
4261
  });
4246
4262
  }
4263
+ async getIndexingStatus() {
4264
+ const { data } = await DefaultService.indexingStatus({
4265
+ client: this.apiClient,
4266
+ path: await this.path()
4267
+ });
4268
+ return data;
4269
+ }
4247
4270
  };
4248
4271
 
4249
4272
  // src/next.ts
@@ -5000,6 +5023,7 @@ export {
5000
5023
  Mul,
5001
5024
  QueryResult,
5002
5025
  RankExpression,
5026
+ ReadLevel,
5003
5027
  Rrf,
5004
5028
  Schema,
5005
5029
  Search,