chromadb 3.2.2 → 3.3.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.
@@ -63,7 +63,7 @@ type GetUserIdentityResponse = {
63
63
  user_id: string;
64
64
  };
65
65
  type HashMap = {
66
- [key: string]: boolean | number | string | SparseVector | null;
66
+ [key: string]: boolean | number | string | SparseVector | Array<boolean> | Array<number> | Array<string> | null;
67
67
  };
68
68
  type HnswConfiguration = {
69
69
  ef_construction?: number | null;
@@ -85,6 +85,9 @@ type HnswIndexConfig = {
85
85
  resize_factor?: number | null;
86
86
  sync_threshold?: number | null;
87
87
  };
88
+ /**
89
+ * Use this enum to specify which fields should be returned when retrieving records.
90
+ */
88
91
  type Include = 'distances' | 'documents' | 'embeddings' | 'metadatas' | 'uris';
89
92
  type IndexStatusResponse = {
90
93
  num_indexed_ops: number;
@@ -250,6 +253,7 @@ type SpannConfiguration = {
250
253
  * Configuration for SPANN vector index algorithm parameters
251
254
  */
252
255
  type SpannIndexConfig = {
256
+ center_drift_threshold?: number | null;
253
257
  ef_construction?: number | null;
254
258
  ef_search?: number | null;
255
259
  initial_lambda?: number | null;
@@ -258,6 +262,10 @@ type SpannIndexConfig = {
258
262
  nreplica_count?: number | null;
259
263
  num_centers_to_merge_to?: number | null;
260
264
  num_samples_kmeans?: number | null;
265
+ /**
266
+ * Enable quantization for vector search (cloud-only feature)
267
+ */
268
+ quantize?: boolean;
261
269
  reassign_neighbor_count?: number | null;
262
270
  search_nprobe?: number | null;
263
271
  search_rng_epsilon?: number | null;
@@ -386,16 +394,20 @@ declare const ReadLevel: {
386
394
  };
387
395
  type ReadLevel = (typeof ReadLevel)[keyof typeof ReadLevel];
388
396
 
397
+ /**
398
+ * Scalar metadata values that can be stored in arrays.
399
+ */
400
+ type MetadataScalar = boolean | number | string;
389
401
  /**
390
402
  * Metadata that can be associated with a collection.
391
- * Values must be boolean, number, or string types.
403
+ * Values can be boolean, number, string, SparseVector, typed arrays, or null.
392
404
  */
393
- type CollectionMetadata = Record<string, boolean | number | string | SparseVector | null>;
405
+ type CollectionMetadata = Record<string, boolean | number | string | SparseVector | boolean[] | number[] | string[] | null>;
394
406
  /**
395
407
  * Metadata that can be associated with individual records.
396
- * Values must be boolean, number, or string types.
408
+ * Values can be boolean, number, string, SparseVector, typed arrays, or null.
397
409
  */
398
- type Metadata = Record<string, boolean | number | string | SparseVector | null>;
410
+ type Metadata = Record<string, boolean | number | string | SparseVector | boolean[] | number[] | string[] | null>;
399
411
  /**
400
412
  * Base interface for record sets containing optional fields.
401
413
  */
@@ -454,6 +466,10 @@ type OperatorExpression = {
454
466
  $in: LiteralValue[];
455
467
  } | {
456
468
  $nin: LiteralValue[];
469
+ } | {
470
+ $contains: LiteralValue;
471
+ } | {
472
+ $not_contains: LiteralValue;
457
473
  };
458
474
  /**
459
475
  * Where clause for filtering records based on metadata.
@@ -786,8 +802,29 @@ declare class Key {
786
802
  lte(value: unknown): WhereExpression;
787
803
  isIn(values: IterableInput<unknown>): WhereExpression;
788
804
  notIn(values: IterableInput<unknown>): WhereExpression;
789
- contains(value: string): WhereExpression;
790
- notContains(value: string): WhereExpression;
805
+ /**
806
+ * Contains filter.
807
+ *
808
+ * On `Key.DOCUMENT`: substring search (value must be a string).
809
+ * On metadata fields: checks if the array field contains the scalar value.
810
+ *
811
+ * @example
812
+ * K.DOCUMENT.contains("machine learning") // document substring
813
+ * K("tags").contains("action") // metadata array contains
814
+ * K("scores").contains(42) // metadata array contains
815
+ */
816
+ contains(value: string | number | boolean): WhereExpression;
817
+ /**
818
+ * Not-contains filter.
819
+ *
820
+ * On `Key.DOCUMENT`: excludes documents containing the substring.
821
+ * On metadata fields: checks that the array field does not contain the scalar value.
822
+ *
823
+ * @example
824
+ * K.DOCUMENT.notContains("deprecated") // document substring exclusion
825
+ * K("tags").notContains("draft") // metadata array not-contains
826
+ */
827
+ notContains(value: string | number | boolean): WhereExpression;
791
828
  regex(pattern: string): WhereExpression;
792
829
  notRegex(pattern: string): WhereExpression;
793
830
  }
@@ -1897,4 +1934,4 @@ declare class ChromaRateLimitError extends Error {
1897
1934
  }
1898
1935
  declare function createErrorByType(type: string, message: string): InvalidCollectionError | InvalidArgumentError | undefined;
1899
1936
 
1900
- 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 };
1937
+ 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, type MetadataScalar, 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 };