chromadb 2.2.0 → 2.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.
- package/README.md +7 -4
- package/dist/chromadb.d.ts +903 -877
- package/dist/chromadb.legacy-esm.js +1886 -2227
- package/dist/chromadb.mjs +1886 -2227
- package/dist/chromadb.mjs.map +1 -1
- package/dist/chunk-MJPHVYKR.mjs +31 -0
- package/dist/chunk-MJPHVYKR.mjs.map +1 -0
- package/dist/cjs/chromadb.cjs +1883 -2203
- package/dist/cjs/chromadb.cjs.map +1 -1
- package/dist/cjs/chromadb.d.cts +903 -877
- package/dist/cjs/cli.cjs +110 -0
- package/dist/cjs/cli.cjs.map +1 -0
- package/dist/cjs/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.mjs +87 -0
- package/dist/cli.mjs.map +1 -0
- package/package.json +8 -3
- package/src/bindings.ts +34 -0
- package/src/browser-entry.js +2 -3
- package/src/cli.ts +63 -0
- package/src/index.ts +1 -1
- package/src/punycode-shim.js +2 -2
package/dist/chromadb.d.ts
CHANGED
|
@@ -32,389 +32,8 @@ interface ClientAuthProvider {
|
|
|
32
32
|
authenticate(): AuthHeaders;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
declare enum IncludeEnum {
|
|
36
|
-
Documents = "documents",
|
|
37
|
-
Embeddings = "embeddings",
|
|
38
|
-
Metadatas = "metadatas",
|
|
39
|
-
Distances = "distances"
|
|
40
|
-
}
|
|
41
|
-
type Embedding = number[];
|
|
42
|
-
type Embeddings = Embedding[];
|
|
43
|
-
type Metadata = Record<string, string | number | boolean>;
|
|
44
|
-
type Metadatas = Metadata[];
|
|
45
|
-
type Document = string;
|
|
46
|
-
type Documents = Document[];
|
|
47
|
-
type ID = string;
|
|
48
|
-
type IDs = ID[];
|
|
49
|
-
type PositiveInteger = number;
|
|
50
|
-
type LiteralValue = string | number | boolean;
|
|
51
|
-
type ListLiteralValue = LiteralValue[];
|
|
52
|
-
type LiteralNumber = number;
|
|
53
|
-
type LogicalOperator = "$and" | "$or";
|
|
54
|
-
type InclusionOperator = "$in" | "$nin";
|
|
55
|
-
type WhereOperator = "$gt" | "$gte" | "$lt" | "$lte" | "$ne" | "$eq";
|
|
56
|
-
type OperatorExpression = {
|
|
57
|
-
[key in WhereOperator | InclusionOperator | LogicalOperator]?: LiteralValue | ListLiteralValue;
|
|
58
|
-
};
|
|
59
|
-
type BaseWhere = {
|
|
60
|
-
[key: string]: LiteralValue | OperatorExpression;
|
|
61
|
-
};
|
|
62
|
-
type LogicalWhere = {
|
|
63
|
-
[key in LogicalOperator]?: Where[];
|
|
64
|
-
};
|
|
65
|
-
type Where = BaseWhere | LogicalWhere;
|
|
66
|
-
type WhereDocumentOperator = "$contains" | "$not_contains" | LogicalOperator;
|
|
67
|
-
type WhereDocument = {
|
|
68
|
-
[key in WhereDocumentOperator]?: LiteralValue | LiteralNumber | WhereDocument[];
|
|
69
|
-
};
|
|
70
|
-
type MultiGetResponse = {
|
|
71
|
-
ids: IDs;
|
|
72
|
-
embeddings: Embeddings | null;
|
|
73
|
-
documents: (Document | null)[];
|
|
74
|
-
metadatas: (Metadata | null)[];
|
|
75
|
-
included: IncludeEnum[];
|
|
76
|
-
};
|
|
77
|
-
type GetResponse = MultiGetResponse;
|
|
78
|
-
type SingleQueryResponse = {
|
|
79
|
-
ids: IDs;
|
|
80
|
-
embeddings: Embeddings | null;
|
|
81
|
-
documents: (Document | null)[];
|
|
82
|
-
metadatas: (Metadata | null)[];
|
|
83
|
-
distances: number[] | null;
|
|
84
|
-
included: IncludeEnum[];
|
|
85
|
-
};
|
|
86
|
-
type MultiQueryResponse = {
|
|
87
|
-
ids: IDs[];
|
|
88
|
-
embeddings: Embeddings[] | null;
|
|
89
|
-
documents: (Document | null)[][];
|
|
90
|
-
metadatas: (Metadata | null)[][];
|
|
91
|
-
distances: number[][] | null;
|
|
92
|
-
included: IncludeEnum[];
|
|
93
|
-
};
|
|
94
|
-
type QueryResponse = SingleQueryResponse | MultiQueryResponse;
|
|
95
|
-
interface CollectionParams {
|
|
96
|
-
name: string;
|
|
97
|
-
id: string;
|
|
98
|
-
metadata: CollectionMetadata | undefined;
|
|
99
|
-
embeddingFunction: IEmbeddingFunction;
|
|
100
|
-
}
|
|
101
|
-
type CollectionMetadata = Record<string, unknown>;
|
|
102
|
-
type ConfigOptions = {
|
|
103
|
-
options?: RequestInit;
|
|
104
|
-
};
|
|
105
|
-
type BaseGetParams = {
|
|
106
|
-
ids?: ID | IDs;
|
|
107
|
-
where?: Where;
|
|
108
|
-
limit?: PositiveInteger;
|
|
109
|
-
offset?: PositiveInteger;
|
|
110
|
-
include?: IncludeEnum[];
|
|
111
|
-
whereDocument?: WhereDocument;
|
|
112
|
-
};
|
|
113
|
-
type SingleGetParams = BaseGetParams & {
|
|
114
|
-
ids: ID;
|
|
115
|
-
};
|
|
116
|
-
type MultiGetParams = BaseGetParams & {
|
|
117
|
-
ids?: IDs;
|
|
118
|
-
};
|
|
119
|
-
type GetParams = SingleGetParams | MultiGetParams;
|
|
120
|
-
type ListCollectionsParams = {
|
|
121
|
-
limit?: PositiveInteger;
|
|
122
|
-
offset?: PositiveInteger;
|
|
123
|
-
};
|
|
124
|
-
type ChromaClientParams = {
|
|
125
|
-
path?: string;
|
|
126
|
-
fetchOptions?: RequestInit;
|
|
127
|
-
auth?: AuthOptions;
|
|
128
|
-
tenant?: string;
|
|
129
|
-
database?: string;
|
|
130
|
-
};
|
|
131
|
-
type CreateCollectionParams = {
|
|
132
|
-
name: string;
|
|
133
|
-
metadata?: CollectionMetadata;
|
|
134
|
-
embeddingFunction?: IEmbeddingFunction;
|
|
135
|
-
};
|
|
136
|
-
type GetOrCreateCollectionParams = CreateCollectionParams;
|
|
137
|
-
type GetCollectionParams = {
|
|
138
|
-
name: string;
|
|
139
|
-
embeddingFunction: IEmbeddingFunction;
|
|
140
|
-
};
|
|
141
|
-
type DeleteCollectionParams = {
|
|
142
|
-
name: string;
|
|
143
|
-
};
|
|
144
|
-
type BaseRecordOperationParams = {
|
|
145
|
-
ids: ID | IDs;
|
|
146
|
-
embeddings?: Embedding | Embeddings;
|
|
147
|
-
metadatas?: Metadata | Metadatas;
|
|
148
|
-
documents?: Document | Documents;
|
|
149
|
-
};
|
|
150
|
-
type SingleRecordOperationParams = BaseRecordOperationParams & {
|
|
151
|
-
ids: ID;
|
|
152
|
-
embeddings?: Embedding;
|
|
153
|
-
metadatas?: Metadata;
|
|
154
|
-
documents?: Document;
|
|
155
|
-
};
|
|
156
|
-
type SingleEmbeddingRecordOperationParams = SingleRecordOperationParams & {
|
|
157
|
-
embeddings: Embedding;
|
|
158
|
-
};
|
|
159
|
-
type SingleContentRecordOperationParams = SingleRecordOperationParams & {
|
|
160
|
-
documents: Document;
|
|
161
|
-
};
|
|
162
|
-
type SingleAddRecordOperationParams = SingleEmbeddingRecordOperationParams | SingleContentRecordOperationParams;
|
|
163
|
-
type MultiRecordOperationParams = BaseRecordOperationParams & {
|
|
164
|
-
ids: IDs;
|
|
165
|
-
embeddings?: Embeddings;
|
|
166
|
-
metadatas?: Metadatas;
|
|
167
|
-
documents?: Documents;
|
|
168
|
-
};
|
|
169
|
-
type MultiEmbeddingRecordOperationParams = MultiRecordOperationParams & {
|
|
170
|
-
embeddings: Embeddings;
|
|
171
|
-
};
|
|
172
|
-
type MultiContentRecordOperationParams = MultiRecordOperationParams & {
|
|
173
|
-
documents: Documents;
|
|
174
|
-
};
|
|
175
|
-
type MultiAddRecordsOperationParams = MultiEmbeddingRecordOperationParams | MultiContentRecordOperationParams;
|
|
176
|
-
type AddRecordsParams = SingleAddRecordOperationParams | MultiAddRecordsOperationParams;
|
|
177
|
-
type UpsertRecordsParams = AddRecordsParams;
|
|
178
|
-
type UpdateRecordsParams = MultiRecordOperationParams | SingleRecordOperationParams;
|
|
179
|
-
type ModifyCollectionParams = {
|
|
180
|
-
name?: string;
|
|
181
|
-
metadata?: CollectionMetadata;
|
|
182
|
-
};
|
|
183
|
-
type BaseQueryParams = {
|
|
184
|
-
nResults?: PositiveInteger;
|
|
185
|
-
where?: Where;
|
|
186
|
-
queryTexts?: string | string[];
|
|
187
|
-
queryEmbeddings?: Embedding | Embeddings;
|
|
188
|
-
whereDocument?: WhereDocument;
|
|
189
|
-
include?: IncludeEnum[];
|
|
190
|
-
};
|
|
191
|
-
type SingleTextQueryParams = BaseQueryParams & {
|
|
192
|
-
queryTexts: string;
|
|
193
|
-
queryEmbeddings?: never;
|
|
194
|
-
};
|
|
195
|
-
type SingleEmbeddingQueryParams = BaseQueryParams & {
|
|
196
|
-
queryTexts?: never;
|
|
197
|
-
queryEmbeddings: Embedding;
|
|
198
|
-
};
|
|
199
|
-
type MultiTextQueryParams = BaseQueryParams & {
|
|
200
|
-
queryTexts: string[];
|
|
201
|
-
queryEmbeddings?: never;
|
|
202
|
-
};
|
|
203
|
-
type MultiEmbeddingQueryParams = BaseQueryParams & {
|
|
204
|
-
queryTexts?: never;
|
|
205
|
-
queryEmbeddings: Embeddings;
|
|
206
|
-
};
|
|
207
|
-
type QueryRecordsParams = SingleTextQueryParams | SingleEmbeddingQueryParams | MultiTextQueryParams | MultiEmbeddingQueryParams;
|
|
208
|
-
type PeekParams = {
|
|
209
|
-
limit?: PositiveInteger;
|
|
210
|
-
};
|
|
211
|
-
type DeleteParams = {
|
|
212
|
-
ids?: ID | IDs;
|
|
213
|
-
where?: Where;
|
|
214
|
-
whereDocument?: WhereDocument;
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
declare class Collection {
|
|
218
|
-
name: string;
|
|
219
|
-
id: string;
|
|
220
|
-
metadata: CollectionMetadata | undefined;
|
|
221
|
-
/**
|
|
222
|
-
* @ignore
|
|
223
|
-
*/
|
|
224
|
-
private client;
|
|
225
|
-
/**
|
|
226
|
-
* @ignore
|
|
227
|
-
*/
|
|
228
|
-
embeddingFunction: IEmbeddingFunction;
|
|
229
|
-
/**
|
|
230
|
-
* @ignore
|
|
231
|
-
*/
|
|
232
|
-
constructor(name: string, id: string, client: ChromaClient, embeddingFunction: IEmbeddingFunction, metadata?: CollectionMetadata);
|
|
233
|
-
/**
|
|
234
|
-
* Add items to the collection
|
|
235
|
-
* @param {Object} params - The parameters for the query.
|
|
236
|
-
* @param {ID | IDs} [params.ids] - IDs of the items to add.
|
|
237
|
-
* @param {Embedding | Embeddings} [params.embeddings] - Optional embeddings of the items to add.
|
|
238
|
-
* @param {Metadata | Metadatas} [params.metadatas] - Optional metadata of the items to add.
|
|
239
|
-
* @param {Document | Documents} [params.documents] - Optional documents of the items to add.
|
|
240
|
-
* @returns {Promise<AddResponse>} - The response from the API. True if successful.
|
|
241
|
-
*
|
|
242
|
-
* @example
|
|
243
|
-
* ```typescript
|
|
244
|
-
* const response = await collection.add({
|
|
245
|
-
* ids: ["id1", "id2"],
|
|
246
|
-
* embeddings: [[1, 2, 3], [4, 5, 6]],
|
|
247
|
-
* metadatas: [{ "key": "value" }, { "key": "value" }],
|
|
248
|
-
* documents: ["document1", "document2"]
|
|
249
|
-
* });
|
|
250
|
-
* ```
|
|
251
|
-
*/
|
|
252
|
-
add(params: AddRecordsParams): Promise<void>;
|
|
253
|
-
/**
|
|
254
|
-
* Upsert items to the collection
|
|
255
|
-
* @param {Object} params - The parameters for the query.
|
|
256
|
-
* @param {ID | IDs} [params.ids] - IDs of the items to add.
|
|
257
|
-
* @param {Embedding | Embeddings} [params.embeddings] - Optional embeddings of the items to add.
|
|
258
|
-
* @param {Metadata | Metadatas} [params.metadatas] - Optional metadata of the items to add.
|
|
259
|
-
* @param {Document | Documents} [params.documents] - Optional documents of the items to add.
|
|
260
|
-
* @returns {Promise<void>}
|
|
261
|
-
*
|
|
262
|
-
* @example
|
|
263
|
-
* ```typescript
|
|
264
|
-
* const response = await collection.upsert({
|
|
265
|
-
* ids: ["id1", "id2"],
|
|
266
|
-
* embeddings: [[1, 2, 3], [4, 5, 6]],
|
|
267
|
-
* metadatas: [{ "key": "value" }, { "key": "value" }],
|
|
268
|
-
* documents: ["document1", "document2"],
|
|
269
|
-
* });
|
|
270
|
-
* ```
|
|
271
|
-
*/
|
|
272
|
-
upsert(params: UpsertRecordsParams): Promise<void>;
|
|
273
|
-
/**
|
|
274
|
-
* Count the number of items in the collection
|
|
275
|
-
* @returns {Promise<number>} - The number of items in the collection.
|
|
276
|
-
*
|
|
277
|
-
* @example
|
|
278
|
-
* ```typescript
|
|
279
|
-
* const count = await collection.count();
|
|
280
|
-
* ```
|
|
281
|
-
*/
|
|
282
|
-
count(): Promise<number>;
|
|
283
|
-
/**
|
|
284
|
-
* Get items from the collection
|
|
285
|
-
* @param {Object} params - The parameters for the query.
|
|
286
|
-
* @param {ID | IDs} [params.ids] - Optional IDs of the items to get.
|
|
287
|
-
* @param {Where} [params.where] - Optional where clause to filter items by.
|
|
288
|
-
* @param {PositiveInteger} [params.limit] - Optional limit on the number of items to get.
|
|
289
|
-
* @param {PositiveInteger} [params.offset] - Optional offset on the items to get.
|
|
290
|
-
* @param {IncludeEnum[]} [params.include] - Optional list of items to include in the response.
|
|
291
|
-
* @param {WhereDocument} [params.whereDocument] - Optional where clause to filter items by.
|
|
292
|
-
* @returns {Promise<GetResponse>} - The response from the server.
|
|
293
|
-
*
|
|
294
|
-
* @example
|
|
295
|
-
* ```typescript
|
|
296
|
-
* const response = await collection.get({
|
|
297
|
-
* ids: ["id1", "id2"],
|
|
298
|
-
* where: { "key": "value" },
|
|
299
|
-
* limit: 10,
|
|
300
|
-
* offset: 0,
|
|
301
|
-
* include: ["embeddings", "metadatas", "documents"],
|
|
302
|
-
* whereDocument: { $contains: "value" },
|
|
303
|
-
* });
|
|
304
|
-
* ```
|
|
305
|
-
*/
|
|
306
|
-
get({ ids, where, limit, offset, include, whereDocument, }?: BaseGetParams): Promise<GetResponse>;
|
|
307
|
-
/**
|
|
308
|
-
* Update items in the collection
|
|
309
|
-
* @param {Object} params - The parameters for the query.
|
|
310
|
-
* @param {ID | IDs} [params.ids] - IDs of the items to add.
|
|
311
|
-
* @param {Embedding | Embeddings} [params.embeddings] - Optional embeddings of the items to add.
|
|
312
|
-
* @param {Metadata | Metadatas} [params.metadatas] - Optional metadata of the items to add.
|
|
313
|
-
* @param {Document | Documents} [params.documents] - Optional documents of the items to add.
|
|
314
|
-
* @returns {Promise<void>}
|
|
315
|
-
*
|
|
316
|
-
* @example
|
|
317
|
-
* ```typescript
|
|
318
|
-
* const response = await collection.update({
|
|
319
|
-
* ids: ["id1", "id2"],
|
|
320
|
-
* embeddings: [[1, 2, 3], [4, 5, 6]],
|
|
321
|
-
* metadatas: [{ "key": "value" }, { "key": "value" }],
|
|
322
|
-
* documents: ["document1", "document2"],
|
|
323
|
-
* });
|
|
324
|
-
* ```
|
|
325
|
-
*/
|
|
326
|
-
update(params: UpdateRecordsParams): Promise<void>;
|
|
327
|
-
/**
|
|
328
|
-
* Performs a query on the collection using the specified parameters.
|
|
329
|
-
*
|
|
330
|
-
* @param {Object} params - The parameters for the query.
|
|
331
|
-
* @param {Embedding | Embeddings} [params.queryEmbeddings] - Optional query embeddings to use for the search.
|
|
332
|
-
* @param {PositiveInteger} [params.nResults] - Optional number of results to return (default is 10).
|
|
333
|
-
* @param {Where} [params.where] - Optional query condition to filter results based on metadata values.
|
|
334
|
-
* @param {string | string[]} [params.queryTexts] - Optional query text(s) to search for in the collection.
|
|
335
|
-
* @param {WhereDocument} [params.whereDocument] - Optional query condition to filter results based on document content.
|
|
336
|
-
* @param {IncludeEnum[]} [params.include] - Optional array of fields to include in the result, such as "metadata" and "document".
|
|
337
|
-
*
|
|
338
|
-
* @returns {Promise<QueryResponse>} A promise that resolves to the query results.
|
|
339
|
-
* @throws {Error} If there is an issue executing the query.
|
|
340
|
-
* @example
|
|
341
|
-
* // Query the collection using embeddings
|
|
342
|
-
* const results = await collection.query({
|
|
343
|
-
* queryEmbeddings: [[0.1, 0.2, ...], ...],
|
|
344
|
-
* nResults: 10,
|
|
345
|
-
* where: {"name": {"$eq": "John Doe"}},
|
|
346
|
-
* include: ["metadata", "document"]
|
|
347
|
-
* });
|
|
348
|
-
* @example
|
|
349
|
-
* ```js
|
|
350
|
-
* // Query the collection using query text
|
|
351
|
-
* const results = await collection.query({
|
|
352
|
-
* queryTexts: "some text",
|
|
353
|
-
* nResults: 10,
|
|
354
|
-
* where: {"name": {"$eq": "John Doe"}},
|
|
355
|
-
* include: ["metadata", "document"]
|
|
356
|
-
* });
|
|
357
|
-
* ```
|
|
358
|
-
*
|
|
359
|
-
*/
|
|
360
|
-
query({ nResults, where, whereDocument, include, queryTexts, queryEmbeddings, }: QueryRecordsParams): Promise<MultiQueryResponse>;
|
|
361
|
-
/**
|
|
362
|
-
* Modify the collection name or metadata
|
|
363
|
-
* @param {Object} params - The parameters for the query.
|
|
364
|
-
* @param {string} [params.name] - Optional new name for the collection.
|
|
365
|
-
* @param {CollectionMetadata} [params.metadata] - Optional new metadata for the collection.
|
|
366
|
-
* @returns {Promise<void>} - The response from the API.
|
|
367
|
-
*
|
|
368
|
-
* @example
|
|
369
|
-
* ```typescript
|
|
370
|
-
* const response = await client.updateCollection({
|
|
371
|
-
* name: "new name",
|
|
372
|
-
* metadata: { "key": "value" },
|
|
373
|
-
* });
|
|
374
|
-
* ```
|
|
375
|
-
*/
|
|
376
|
-
modify({ name, metadata, }: {
|
|
377
|
-
name?: string;
|
|
378
|
-
metadata?: CollectionMetadata;
|
|
379
|
-
}): Promise<CollectionParams>;
|
|
380
|
-
/**
|
|
381
|
-
* Peek inside the collection
|
|
382
|
-
* @param {Object} params - The parameters for the query.
|
|
383
|
-
* @param {PositiveInteger} [params.limit] - Optional number of results to return (default is 10).
|
|
384
|
-
* @returns {Promise<GetResponse>} A promise that resolves to the query results.
|
|
385
|
-
* @throws {Error} If there is an issue executing the query.
|
|
386
|
-
*
|
|
387
|
-
* @example
|
|
388
|
-
* ```typescript
|
|
389
|
-
* const results = await collection.peek({
|
|
390
|
-
* limit: 10
|
|
391
|
-
* });
|
|
392
|
-
* ```
|
|
393
|
-
*/
|
|
394
|
-
peek({ limit }?: PeekParams): Promise<MultiGetResponse>;
|
|
395
|
-
/**
|
|
396
|
-
* Deletes items from the collection.
|
|
397
|
-
* @param {Object} params - The parameters for deleting items from the collection.
|
|
398
|
-
* @param {ID | IDs} [params.ids] - Optional ID or array of IDs of items to delete.
|
|
399
|
-
* @param {Where} [params.where] - Optional query condition to filter items to delete based on metadata values.
|
|
400
|
-
* @param {WhereDocument} [params.whereDocument] - Optional query condition to filter items to delete based on document content.
|
|
401
|
-
* @returns {Promise<string[]>} A promise that resolves to the IDs of the deleted items.
|
|
402
|
-
* @throws {Error} If there is an issue deleting items from the collection.
|
|
403
|
-
*
|
|
404
|
-
* @example
|
|
405
|
-
* ```typescript
|
|
406
|
-
* const results = await collection.delete({
|
|
407
|
-
* ids: "some_id",
|
|
408
|
-
* where: {"name": {"$eq": "John Doe"}},
|
|
409
|
-
* whereDocument: {"$contains":"search_string"}
|
|
410
|
-
* });
|
|
411
|
-
* ```
|
|
412
|
-
*/
|
|
413
|
-
delete({ ids, where, whereDocument, }?: DeleteParams): Promise<void>;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
35
|
/**
|
|
417
|
-
*
|
|
36
|
+
* chroma-frontend
|
|
418
37
|
*
|
|
419
38
|
*
|
|
420
39
|
* OpenAPI spec version: 1.0.0
|
|
@@ -470,7 +89,7 @@ declare class Configuration {
|
|
|
470
89
|
}
|
|
471
90
|
|
|
472
91
|
/**
|
|
473
|
-
*
|
|
92
|
+
* chroma-frontend
|
|
474
93
|
*
|
|
475
94
|
*
|
|
476
95
|
* OpenAPI spec version: 1.0.0
|
|
@@ -501,7 +120,7 @@ declare class BaseAPI {
|
|
|
501
120
|
}
|
|
502
121
|
|
|
503
122
|
/**
|
|
504
|
-
*
|
|
123
|
+
* chroma-frontend
|
|
505
124
|
*
|
|
506
125
|
*
|
|
507
126
|
* OpenAPI spec version: 1.0.0
|
|
@@ -512,314 +131,402 @@ declare class BaseAPI {
|
|
|
512
131
|
* Do not edit the class manually.
|
|
513
132
|
*/
|
|
514
133
|
declare namespace Api {
|
|
515
|
-
interface
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
documents?: ((string | null)[]) | null;
|
|
519
|
-
uris?: ((string | null)[]) | null;
|
|
134
|
+
interface AddCollectionRecordsPayload {
|
|
135
|
+
documents?: (string | null)[] | null;
|
|
136
|
+
embeddings?: number[][] | null;
|
|
520
137
|
ids: string[];
|
|
138
|
+
metadatas?: ({
|
|
139
|
+
[name: string]: boolean | number | number | string;
|
|
140
|
+
} | null)[] | null;
|
|
141
|
+
uris?: (string | null)[] | null;
|
|
521
142
|
}
|
|
522
|
-
|
|
523
|
-
* @export
|
|
524
|
-
* @namespace AddV1V1Request
|
|
525
|
-
*/
|
|
526
|
-
namespace AddV1V1Request {
|
|
527
|
-
interface Metadatum {
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
interface AddV2Request {
|
|
531
|
-
embeddings?: (unknown[]) | null;
|
|
532
|
-
metadatas?: ((Api.AddV2Request.Metadatum | null)[]) | null;
|
|
533
|
-
documents?: ((string | null)[]) | null;
|
|
534
|
-
uris?: ((string | null)[]) | null;
|
|
535
|
-
ids: string[];
|
|
143
|
+
interface AddCollectionRecordsResponse {
|
|
536
144
|
}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
145
|
+
interface ChecklistResponse {
|
|
146
|
+
/**
|
|
147
|
+
* @type {number}
|
|
148
|
+
* @memberof ChecklistResponse
|
|
149
|
+
* minimum: 0
|
|
150
|
+
*/
|
|
151
|
+
max_batch_size: number;
|
|
544
152
|
}
|
|
545
|
-
interface
|
|
153
|
+
interface Collection {
|
|
154
|
+
configuration_json: Api.CollectionConfiguration;
|
|
155
|
+
database: string;
|
|
156
|
+
/**
|
|
157
|
+
* @type {number | null}
|
|
158
|
+
* @memberof Collection
|
|
159
|
+
*/
|
|
160
|
+
dimension?: number | null;
|
|
161
|
+
/**
|
|
162
|
+
* @description <p>CollectionUuid is a wrapper around Uuid to provide a type for the collection id.</p>
|
|
163
|
+
* @type {string}
|
|
164
|
+
* @memberof Collection
|
|
165
|
+
*/
|
|
166
|
+
id: string;
|
|
167
|
+
/**
|
|
168
|
+
* @type {number}
|
|
169
|
+
* @memberof Collection
|
|
170
|
+
*/
|
|
171
|
+
log_position: number;
|
|
172
|
+
metadata?: {
|
|
173
|
+
[name: string]: boolean | number | number | string;
|
|
174
|
+
} | null;
|
|
546
175
|
name: string;
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
176
|
+
tenant: string;
|
|
177
|
+
/**
|
|
178
|
+
* @type {number}
|
|
179
|
+
* @memberof Collection
|
|
180
|
+
*/
|
|
181
|
+
version: number;
|
|
550
182
|
}
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
namespace CreateCollectionV1V1Request {
|
|
556
|
-
interface Configuration {
|
|
557
|
-
}
|
|
558
|
-
interface Metadata {
|
|
559
|
-
}
|
|
183
|
+
interface CollectionConfiguration {
|
|
184
|
+
embedding_function?: Api.EmbeddingFunctionConfiguration | null;
|
|
185
|
+
hnsw?: Api.HnswConfiguration | null;
|
|
186
|
+
spann?: Api.SpannConfiguration | null;
|
|
560
187
|
}
|
|
561
|
-
interface
|
|
188
|
+
interface CreateCollectionPayload {
|
|
189
|
+
configuration?: Api.CollectionConfiguration | null;
|
|
190
|
+
get_or_create?: boolean;
|
|
191
|
+
metadata?: {
|
|
192
|
+
[name: string]: boolean | number | number | string;
|
|
193
|
+
} | null;
|
|
562
194
|
name: string;
|
|
563
|
-
configuration?: Api.CreateCollectionV2Request.Configuration | null;
|
|
564
|
-
metadata?: Api.CreateCollectionV2Request.Metadata | null;
|
|
565
|
-
'get_or_create'?: boolean;
|
|
566
|
-
}
|
|
567
|
-
/**
|
|
568
|
-
* @export
|
|
569
|
-
* @namespace CreateCollectionV2Request
|
|
570
|
-
*/
|
|
571
|
-
namespace CreateCollectionV2Request {
|
|
572
|
-
interface Configuration {
|
|
573
|
-
}
|
|
574
|
-
interface Metadata {
|
|
575
|
-
}
|
|
576
195
|
}
|
|
577
|
-
interface
|
|
196
|
+
interface CreateDatabasePayload {
|
|
578
197
|
name: string;
|
|
579
198
|
}
|
|
580
|
-
interface
|
|
581
|
-
name: string;
|
|
199
|
+
interface CreateDatabaseResponse {
|
|
582
200
|
}
|
|
583
|
-
interface
|
|
201
|
+
interface CreateTenantPayload {
|
|
584
202
|
name: string;
|
|
585
203
|
}
|
|
586
|
-
interface
|
|
204
|
+
interface CreateTenantResponse {
|
|
205
|
+
}
|
|
206
|
+
interface Database {
|
|
207
|
+
id: string;
|
|
587
208
|
name: string;
|
|
209
|
+
tenant: string;
|
|
588
210
|
}
|
|
589
|
-
interface
|
|
590
|
-
ids?:
|
|
591
|
-
where?: Api.DeleteV1V1Request.Where | null;
|
|
592
|
-
'where_document'?: Api.DeleteV1V1Request.WhereDocument | null;
|
|
211
|
+
interface DeleteCollectionRecordsPayload extends Api.RawWhereFields {
|
|
212
|
+
ids?: string[] | null;
|
|
593
213
|
}
|
|
594
|
-
|
|
595
|
-
* @export
|
|
596
|
-
* @namespace DeleteV1V1Request
|
|
597
|
-
*/
|
|
598
|
-
namespace DeleteV1V1Request {
|
|
599
|
-
interface Where {
|
|
600
|
-
}
|
|
601
|
-
interface WhereDocument {
|
|
602
|
-
}
|
|
214
|
+
interface DeleteCollectionRecordsResponse {
|
|
603
215
|
}
|
|
604
|
-
interface
|
|
605
|
-
ids?: (string[]) | null;
|
|
606
|
-
where?: Api.DeleteV2Request.Where | null;
|
|
607
|
-
'where_document'?: Api.DeleteV2Request.WhereDocument | null;
|
|
216
|
+
interface DeleteDatabaseResponse {
|
|
608
217
|
}
|
|
218
|
+
type EmbeddingFunctionConfiguration = Api.EmbeddingFunctionConfiguration.ObjectValue | Api.EmbeddingFunctionConfiguration.AllofValue;
|
|
609
219
|
/**
|
|
610
220
|
* @export
|
|
611
|
-
* @namespace
|
|
221
|
+
* @namespace EmbeddingFunctionConfiguration
|
|
612
222
|
*/
|
|
613
|
-
namespace
|
|
614
|
-
interface
|
|
615
|
-
|
|
616
|
-
interface WhereDocument {
|
|
223
|
+
namespace EmbeddingFunctionConfiguration {
|
|
224
|
+
interface ObjectValue {
|
|
225
|
+
type: Api.EmbeddingFunctionConfiguration.ObjectValue.TypeEnum;
|
|
617
226
|
}
|
|
618
|
-
}
|
|
619
|
-
interface GetNearestNeighborsV1V1Request {
|
|
620
|
-
where?: Api.GetNearestNeighborsV1V1Request.Where | null;
|
|
621
|
-
'where_document'?: Api.GetNearestNeighborsV1V1Request.WhereDocument | null;
|
|
622
|
-
'query_embeddings': unknown[];
|
|
623
227
|
/**
|
|
624
|
-
* @
|
|
625
|
-
* @
|
|
228
|
+
* @export
|
|
229
|
+
* @namespace ObjectValue
|
|
626
230
|
*/
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
* @export
|
|
632
|
-
* @namespace GetNearestNeighborsV1V1Request
|
|
633
|
-
*/
|
|
634
|
-
namespace GetNearestNeighborsV1V1Request {
|
|
635
|
-
interface Where {
|
|
231
|
+
namespace ObjectValue {
|
|
232
|
+
enum TypeEnum {
|
|
233
|
+
Legacy = "legacy"
|
|
234
|
+
}
|
|
636
235
|
}
|
|
637
|
-
interface
|
|
236
|
+
interface AllofValue extends Api.EmbeddingFunctionNewConfiguration {
|
|
237
|
+
type: Api.EmbeddingFunctionConfiguration.AllofValue.TypeEnum;
|
|
638
238
|
}
|
|
639
|
-
}
|
|
640
|
-
interface GetNearestNeighborsV2Request {
|
|
641
|
-
where?: Api.GetNearestNeighborsV2Request.Where | null;
|
|
642
|
-
'where_document'?: Api.GetNearestNeighborsV2Request.WhereDocument | null;
|
|
643
|
-
'query_embeddings': unknown[];
|
|
644
239
|
/**
|
|
645
|
-
* @
|
|
646
|
-
* @
|
|
240
|
+
* @export
|
|
241
|
+
* @namespace AllofValue
|
|
647
242
|
*/
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
* @export
|
|
653
|
-
* @namespace GetNearestNeighborsV2Request
|
|
654
|
-
*/
|
|
655
|
-
namespace GetNearestNeighborsV2Request {
|
|
656
|
-
interface Where {
|
|
657
|
-
}
|
|
658
|
-
interface WhereDocument {
|
|
243
|
+
namespace AllofValue {
|
|
244
|
+
enum TypeEnum {
|
|
245
|
+
Known = "known"
|
|
246
|
+
}
|
|
659
247
|
}
|
|
660
248
|
}
|
|
661
|
-
interface
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
249
|
+
interface EmbeddingFunctionNewConfiguration {
|
|
250
|
+
config: unknown;
|
|
251
|
+
name: string;
|
|
252
|
+
}
|
|
253
|
+
interface ErrorResponse {
|
|
254
|
+
error: string;
|
|
255
|
+
message: string;
|
|
256
|
+
}
|
|
257
|
+
interface ForkCollectionPayload {
|
|
258
|
+
new_name: string;
|
|
259
|
+
}
|
|
260
|
+
interface GetRequestPayload extends Api.RawWhereFields {
|
|
261
|
+
ids?: string[] | null;
|
|
262
|
+
include?: Api.Include[];
|
|
666
263
|
/**
|
|
667
264
|
* @type {number | null}
|
|
668
|
-
* @memberof
|
|
265
|
+
* @memberof GetRequestPayload
|
|
266
|
+
* minimum: 0
|
|
669
267
|
*/
|
|
670
268
|
limit?: number | null;
|
|
671
269
|
/**
|
|
672
270
|
* @type {number | null}
|
|
673
|
-
* @memberof
|
|
271
|
+
* @memberof GetRequestPayload
|
|
272
|
+
* minimum: 0
|
|
674
273
|
*/
|
|
675
274
|
offset?: number | null;
|
|
676
|
-
include?: Api.IncludeEnum[];
|
|
677
275
|
}
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
276
|
+
interface GetResponse {
|
|
277
|
+
documents?: (string | null)[] | null;
|
|
278
|
+
embeddings?: number[][] | null;
|
|
279
|
+
ids: string[];
|
|
280
|
+
include: Api.Include[];
|
|
281
|
+
metadatas?: ({
|
|
282
|
+
[name: string]: boolean | number | number | string;
|
|
283
|
+
} | null)[] | null;
|
|
284
|
+
uris?: (string | null)[] | null;
|
|
285
|
+
}
|
|
286
|
+
interface GetTenantResponse {
|
|
287
|
+
name: string;
|
|
288
|
+
}
|
|
289
|
+
interface GetUserIdentityResponse {
|
|
290
|
+
databases: string[];
|
|
291
|
+
tenant: string;
|
|
292
|
+
user_id: string;
|
|
687
293
|
}
|
|
688
|
-
interface
|
|
689
|
-
ids?: (string[]) | null;
|
|
690
|
-
where?: Api.GetV2Request.Where | null;
|
|
691
|
-
'where_document'?: Api.GetV2Request.WhereDocument | null;
|
|
692
|
-
sort?: string | null;
|
|
294
|
+
interface HeartbeatResponse {
|
|
693
295
|
/**
|
|
694
|
-
* @type {number
|
|
695
|
-
* @memberof
|
|
296
|
+
* @type {number}
|
|
297
|
+
* @memberof HeartbeatResponse
|
|
298
|
+
* minimum: 0
|
|
696
299
|
*/
|
|
697
|
-
|
|
300
|
+
"nanosecond heartbeat": number;
|
|
301
|
+
}
|
|
302
|
+
interface HnswConfiguration {
|
|
698
303
|
/**
|
|
699
|
-
* @type {number
|
|
700
|
-
* @memberof
|
|
304
|
+
* @type {number}
|
|
305
|
+
* @memberof HnswConfiguration
|
|
306
|
+
* minimum: 0
|
|
701
307
|
*/
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
308
|
+
ef_construction?: number;
|
|
309
|
+
/**
|
|
310
|
+
* @type {number}
|
|
311
|
+
* @memberof HnswConfiguration
|
|
312
|
+
* minimum: 0
|
|
313
|
+
*/
|
|
314
|
+
ef_search?: number;
|
|
315
|
+
/**
|
|
316
|
+
* @type {number}
|
|
317
|
+
* @memberof HnswConfiguration
|
|
318
|
+
* minimum: 0
|
|
319
|
+
*/
|
|
320
|
+
max_neighbors?: number;
|
|
321
|
+
/**
|
|
322
|
+
* @type {number}
|
|
323
|
+
* @memberof HnswConfiguration
|
|
324
|
+
*/
|
|
325
|
+
resize_factor?: number;
|
|
326
|
+
space?: Api.HnswSpace;
|
|
327
|
+
/**
|
|
328
|
+
* @type {number}
|
|
329
|
+
* @memberof HnswConfiguration
|
|
330
|
+
* minimum: 0
|
|
331
|
+
*/
|
|
332
|
+
sync_threshold?: number;
|
|
714
333
|
}
|
|
715
|
-
|
|
716
|
-
|
|
334
|
+
enum HnswSpace {
|
|
335
|
+
L2 = "l2",
|
|
336
|
+
Cosine = "cosine",
|
|
337
|
+
Ip = "ip"
|
|
717
338
|
}
|
|
718
|
-
enum
|
|
339
|
+
enum Include {
|
|
340
|
+
Distances = "distances",
|
|
719
341
|
Documents = "documents",
|
|
720
342
|
Embeddings = "embeddings",
|
|
721
343
|
Metadatas = "metadatas",
|
|
722
|
-
|
|
723
|
-
Uris = "uris",
|
|
724
|
-
Data = "data"
|
|
725
|
-
}
|
|
726
|
-
interface PreFlightChecksV1200Response {
|
|
727
|
-
}
|
|
728
|
-
interface PreFlightChecksV2200Response {
|
|
344
|
+
Uris = "uris"
|
|
729
345
|
}
|
|
730
|
-
interface
|
|
731
|
-
|
|
732
|
-
|
|
346
|
+
interface QueryRequestPayload extends Api.RawWhereFields {
|
|
347
|
+
ids?: string[] | null;
|
|
348
|
+
include?: Api.Include[];
|
|
349
|
+
/**
|
|
350
|
+
* @type {number | null}
|
|
351
|
+
* @memberof QueryRequestPayload
|
|
352
|
+
* minimum: 0
|
|
353
|
+
*/
|
|
354
|
+
n_results?: number | null;
|
|
355
|
+
query_embeddings: number[][];
|
|
733
356
|
}
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
357
|
+
interface QueryResponse {
|
|
358
|
+
distances?: (number | null)[][] | null;
|
|
359
|
+
documents?: (string | null)[][] | null;
|
|
360
|
+
embeddings?: (number[] | null)[][] | null;
|
|
361
|
+
ids: string[][];
|
|
362
|
+
include: Api.Include[];
|
|
363
|
+
metadatas?: ({
|
|
364
|
+
[name: string]: boolean | number | number | string;
|
|
365
|
+
} | null)[][] | null;
|
|
366
|
+
uris?: (string | null)[][] | null;
|
|
741
367
|
}
|
|
742
|
-
interface
|
|
743
|
-
|
|
744
|
-
|
|
368
|
+
interface RawWhereFields {
|
|
369
|
+
where?: unknown;
|
|
370
|
+
where_document?: unknown;
|
|
745
371
|
}
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
372
|
+
interface SpannConfiguration {
|
|
373
|
+
/**
|
|
374
|
+
* @type {number}
|
|
375
|
+
* @memberof SpannConfiguration
|
|
376
|
+
* minimum: 0
|
|
377
|
+
*/
|
|
378
|
+
ef_construction?: number;
|
|
379
|
+
/**
|
|
380
|
+
* @type {number}
|
|
381
|
+
* @memberof SpannConfiguration
|
|
382
|
+
* minimum: 0
|
|
383
|
+
*/
|
|
384
|
+
ef_search?: number;
|
|
385
|
+
/**
|
|
386
|
+
* @type {number}
|
|
387
|
+
* @memberof SpannConfiguration
|
|
388
|
+
* minimum: 0
|
|
389
|
+
*/
|
|
390
|
+
max_neighbors?: number;
|
|
391
|
+
/**
|
|
392
|
+
* @type {number}
|
|
393
|
+
* @memberof SpannConfiguration
|
|
394
|
+
* minimum: 0
|
|
395
|
+
*/
|
|
396
|
+
merge_threshold?: number;
|
|
397
|
+
/**
|
|
398
|
+
* @type {number}
|
|
399
|
+
* @memberof SpannConfiguration
|
|
400
|
+
* minimum: 0
|
|
401
|
+
*/
|
|
402
|
+
reassign_neighbor_count?: number;
|
|
403
|
+
/**
|
|
404
|
+
* @type {number}
|
|
405
|
+
* @memberof SpannConfiguration
|
|
406
|
+
* minimum: 0
|
|
407
|
+
*/
|
|
408
|
+
search_nprobe?: number;
|
|
409
|
+
space?: Api.HnswSpace;
|
|
410
|
+
/**
|
|
411
|
+
* @type {number}
|
|
412
|
+
* @memberof SpannConfiguration
|
|
413
|
+
* minimum: 0
|
|
414
|
+
*/
|
|
415
|
+
split_threshold?: number;
|
|
416
|
+
/**
|
|
417
|
+
* @type {number}
|
|
418
|
+
* @memberof SpannConfiguration
|
|
419
|
+
* minimum: 0
|
|
420
|
+
*/
|
|
421
|
+
write_nprobe?: number;
|
|
753
422
|
}
|
|
754
|
-
interface
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
uris?: ((string | null)[]) | null;
|
|
759
|
-
ids: string[];
|
|
423
|
+
interface UpdateCollectionConfiguration {
|
|
424
|
+
embedding_function?: Api.EmbeddingFunctionConfiguration | null;
|
|
425
|
+
hnsw?: Api.UpdateHnswConfiguration | null;
|
|
426
|
+
spann?: Api.SpannConfiguration | null;
|
|
760
427
|
}
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
}
|
|
428
|
+
interface UpdateCollectionPayload {
|
|
429
|
+
new_configuration?: Api.UpdateCollectionConfiguration | null;
|
|
430
|
+
new_metadata?: {
|
|
431
|
+
[name: string]: boolean | number | number | string;
|
|
432
|
+
} | null;
|
|
433
|
+
new_name?: string | null;
|
|
768
434
|
}
|
|
769
|
-
interface
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
documents?: ((string | null)[]) | null;
|
|
773
|
-
uris?: ((string | null)[]) | null;
|
|
435
|
+
interface UpdateCollectionRecordsPayload {
|
|
436
|
+
documents?: (string | null)[] | null;
|
|
437
|
+
embeddings?: (number[] | null)[] | null;
|
|
774
438
|
ids: string[];
|
|
439
|
+
metadatas?: ({
|
|
440
|
+
[name: string]: boolean | number | number | string;
|
|
441
|
+
} | null)[] | null;
|
|
442
|
+
uris?: (string | null)[] | null;
|
|
775
443
|
}
|
|
776
|
-
|
|
777
|
-
* @export
|
|
778
|
-
* @namespace UpdateV2Request
|
|
779
|
-
*/
|
|
780
|
-
namespace UpdateV2Request {
|
|
781
|
-
interface Metadatum {
|
|
782
|
-
}
|
|
444
|
+
interface UpdateCollectionRecordsResponse {
|
|
783
445
|
}
|
|
784
|
-
interface
|
|
785
|
-
embeddings?: (unknown[]) | null;
|
|
786
|
-
metadatas?: ((Api.UpsertV1V1Request.Metadatum | null)[]) | null;
|
|
787
|
-
documents?: ((string | null)[]) | null;
|
|
788
|
-
uris?: ((string | null)[]) | null;
|
|
789
|
-
ids: string[];
|
|
446
|
+
interface UpdateCollectionResponse {
|
|
790
447
|
}
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
448
|
+
interface UpdateHnswConfiguration {
|
|
449
|
+
/**
|
|
450
|
+
* @type {number | null}
|
|
451
|
+
* @memberof UpdateHnswConfiguration
|
|
452
|
+
* minimum: 0
|
|
453
|
+
*/
|
|
454
|
+
batch_size?: number | null;
|
|
455
|
+
/**
|
|
456
|
+
* @type {number | null}
|
|
457
|
+
* @memberof UpdateHnswConfiguration
|
|
458
|
+
* minimum: 0
|
|
459
|
+
*/
|
|
460
|
+
ef_search?: number | null;
|
|
461
|
+
/**
|
|
462
|
+
* @type {number | null}
|
|
463
|
+
* @memberof UpdateHnswConfiguration
|
|
464
|
+
* minimum: 0
|
|
465
|
+
*/
|
|
466
|
+
max_neighbors?: number | null;
|
|
467
|
+
/**
|
|
468
|
+
* @type {number | null}
|
|
469
|
+
* @memberof UpdateHnswConfiguration
|
|
470
|
+
* minimum: 0
|
|
471
|
+
*/
|
|
472
|
+
num_threads?: number | null;
|
|
473
|
+
/**
|
|
474
|
+
* @type {number | null}
|
|
475
|
+
* @memberof UpdateHnswConfiguration
|
|
476
|
+
*/
|
|
477
|
+
resize_factor?: number | null;
|
|
478
|
+
/**
|
|
479
|
+
* @type {number | null}
|
|
480
|
+
* @memberof UpdateHnswConfiguration
|
|
481
|
+
* minimum: 0
|
|
482
|
+
*/
|
|
483
|
+
sync_threshold?: number | null;
|
|
798
484
|
}
|
|
799
|
-
interface
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
documents?: ((string | null)[]) | null;
|
|
803
|
-
uris?: ((string | null)[]) | null;
|
|
485
|
+
interface UpsertCollectionRecordsPayload {
|
|
486
|
+
documents?: (string | null)[] | null;
|
|
487
|
+
embeddings?: number[][] | null;
|
|
804
488
|
ids: string[];
|
|
489
|
+
metadatas?: ({
|
|
490
|
+
[name: string]: boolean | number | number | string;
|
|
491
|
+
} | null)[] | null;
|
|
492
|
+
uris?: (string | null)[] | null;
|
|
805
493
|
}
|
|
806
|
-
|
|
807
|
-
* @export
|
|
808
|
-
* @namespace UpsertV2Request
|
|
809
|
-
*/
|
|
810
|
-
namespace UpsertV2Request {
|
|
811
|
-
interface Metadatum {
|
|
812
|
-
}
|
|
494
|
+
interface UpsertCollectionRecordsResponse {
|
|
813
495
|
}
|
|
814
|
-
interface
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
496
|
+
interface Vec2 {
|
|
497
|
+
configuration_json: Api.CollectionConfiguration;
|
|
498
|
+
database: string;
|
|
499
|
+
/**
|
|
500
|
+
* @type {number | null}
|
|
501
|
+
* @memberof Vec2
|
|
502
|
+
*/
|
|
503
|
+
dimension?: number | null;
|
|
504
|
+
/**
|
|
505
|
+
* @description <p>CollectionUuid is a wrapper around Uuid to provide a type for the collection id.</p>
|
|
506
|
+
* @type {string}
|
|
507
|
+
* @memberof Vec2
|
|
508
|
+
*/
|
|
509
|
+
id: string;
|
|
510
|
+
/**
|
|
511
|
+
* @type {number}
|
|
512
|
+
* @memberof Vec2
|
|
513
|
+
*/
|
|
514
|
+
log_position: number;
|
|
515
|
+
metadata?: {
|
|
516
|
+
[name: string]: boolean | number | number | string;
|
|
517
|
+
} | null;
|
|
518
|
+
name: string;
|
|
519
|
+
tenant: string;
|
|
520
|
+
/**
|
|
521
|
+
* @type {number}
|
|
522
|
+
* @memberof Vec2
|
|
523
|
+
*/
|
|
524
|
+
version: number;
|
|
818
525
|
}
|
|
819
526
|
}
|
|
820
527
|
|
|
821
528
|
/**
|
|
822
|
-
*
|
|
529
|
+
* chroma-frontend
|
|
823
530
|
*
|
|
824
531
|
*
|
|
825
532
|
* OpenAPI spec version: 1.0.0
|
|
@@ -838,388 +545,678 @@ declare namespace Api {
|
|
|
838
545
|
*/
|
|
839
546
|
declare class ApiApi extends BaseAPI {
|
|
840
547
|
/**
|
|
841
|
-
* @summary
|
|
842
|
-
* @param {string} collectionId
|
|
843
|
-
* @param {Api.AddV1V1Request} request
|
|
844
|
-
* @param {RequestInit} [options] Override http request option.
|
|
845
|
-
* @throws {RequiredError}
|
|
846
|
-
*/
|
|
847
|
-
addV1V1(collectionId: string, request: Api.AddV1V1Request, options?: RequestInit): Promise<unknown>;
|
|
848
|
-
/**
|
|
849
|
-
* @summary Add
|
|
850
|
-
* @param {string} tenant
|
|
851
|
-
* @param {string} databaseName
|
|
852
|
-
* @param {string} collectionId
|
|
853
|
-
* @param {Api.AddV2Request} request
|
|
854
|
-
* @param {RequestInit} [options] Override http request option.
|
|
855
|
-
* @throws {RequiredError}
|
|
856
|
-
*/
|
|
857
|
-
addV2(tenant: string, databaseName: string, collectionId: string, request: Api.AddV2Request, options?: RequestInit): Promise<unknown>;
|
|
858
|
-
/**
|
|
859
|
-
* @summary Count Collections V1
|
|
860
|
-
* @param {string} [tenant]
|
|
861
|
-
* @param {string} [database]
|
|
862
|
-
* @param {RequestInit} [options] Override http request option.
|
|
863
|
-
* @throws {RequiredError}
|
|
864
|
-
*/
|
|
865
|
-
countCollectionsV1V1(tenant: string | undefined, database: string | undefined, options?: RequestInit): Promise<unknown>;
|
|
866
|
-
/**
|
|
867
|
-
* @summary Count Collections
|
|
868
|
-
* @param {string} tenant
|
|
869
|
-
* @param {string} databaseName
|
|
870
|
-
* @param {RequestInit} [options] Override http request option.
|
|
871
|
-
* @throws {RequiredError}
|
|
872
|
-
*/
|
|
873
|
-
countCollectionsV2(tenant: string, databaseName: string, options?: RequestInit): Promise<unknown>;
|
|
874
|
-
/**
|
|
875
|
-
* @summary Count V1
|
|
876
|
-
* @param {string} collectionId
|
|
877
|
-
* @param {RequestInit} [options] Override http request option.
|
|
878
|
-
* @throws {RequiredError}
|
|
879
|
-
*/
|
|
880
|
-
countV1V1(collectionId: string, options?: RequestInit): Promise<unknown>;
|
|
881
|
-
/**
|
|
882
|
-
* @summary Count
|
|
548
|
+
* @summary Adds records to a collection.
|
|
883
549
|
* @param {string} tenant
|
|
884
|
-
* @param {string}
|
|
550
|
+
* @param {string} database
|
|
885
551
|
* @param {string} collectionId
|
|
552
|
+
* @param {Api.AddCollectionRecordsPayload} request
|
|
886
553
|
* @param {RequestInit} [options] Override http request option.
|
|
887
554
|
* @throws {RequiredError}
|
|
888
555
|
*/
|
|
889
|
-
|
|
890
|
-
/**
|
|
891
|
-
* @summary Create Collection V1
|
|
892
|
-
* @param {string} [tenant]
|
|
893
|
-
* @param {string} [database]
|
|
894
|
-
* @param {Api.CreateCollectionV1V1Request} request
|
|
895
|
-
* @param {RequestInit} [options] Override http request option.
|
|
896
|
-
* @throws {RequiredError}
|
|
897
|
-
*/
|
|
898
|
-
createCollectionV1V1(tenant: string | undefined, database: string | undefined, request: Api.CreateCollectionV1V1Request, options?: RequestInit): Promise<unknown>;
|
|
899
|
-
/**
|
|
900
|
-
* @summary Create Collection
|
|
901
|
-
* @param {string} tenant
|
|
902
|
-
* @param {string} databaseName
|
|
903
|
-
* @param {Api.CreateCollectionV2Request} request
|
|
904
|
-
* @param {RequestInit} [options] Override http request option.
|
|
905
|
-
* @throws {RequiredError}
|
|
906
|
-
*/
|
|
907
|
-
createCollectionV2(tenant: string, databaseName: string, request: Api.CreateCollectionV2Request, options?: RequestInit): Promise<unknown>;
|
|
908
|
-
/**
|
|
909
|
-
* @summary Create Database V1
|
|
910
|
-
* @param {string} [tenant]
|
|
911
|
-
* @param {Api.CreateDatabaseV1V1Request} request
|
|
912
|
-
* @param {RequestInit} [options] Override http request option.
|
|
913
|
-
* @throws {RequiredError}
|
|
914
|
-
*/
|
|
915
|
-
createDatabaseV1V1(tenant: string | undefined, request: Api.CreateDatabaseV1V1Request, options?: RequestInit): Promise<unknown>;
|
|
556
|
+
collectionAdd(tenant: string, database: string, collectionId: string, request: Api.AddCollectionRecordsPayload, options?: RequestInit): Promise<Api.AddCollectionRecordsResponse>;
|
|
916
557
|
/**
|
|
917
|
-
* @summary
|
|
918
|
-
* @param {string} tenant
|
|
919
|
-
* @param {
|
|
558
|
+
* @summary Retrieves the number of records in a collection.
|
|
559
|
+
* @param {string} tenant <p>Tenant ID for the collection</p>
|
|
560
|
+
* @param {string} database <p>Database containing this collection</p>
|
|
561
|
+
* @param {string} collectionId <p>Collection ID whose records are counted</p>
|
|
920
562
|
* @param {RequestInit} [options] Override http request option.
|
|
921
563
|
* @throws {RequiredError}
|
|
922
564
|
*/
|
|
923
|
-
|
|
565
|
+
collectionCount(tenant: string, database: string, collectionId: string, options?: RequestInit): Promise<number>;
|
|
924
566
|
/**
|
|
925
|
-
* @summary
|
|
926
|
-
* @param {
|
|
567
|
+
* @summary Deletes records in a collection. Can filter by IDs or metadata.
|
|
568
|
+
* @param {string} tenant <p>Tenant ID</p>
|
|
569
|
+
* @param {string} database <p>Database name</p>
|
|
570
|
+
* @param {string} collectionId <p>Collection ID</p>
|
|
571
|
+
* @param {Api.DeleteCollectionRecordsPayload} request
|
|
927
572
|
* @param {RequestInit} [options] Override http request option.
|
|
928
573
|
* @throws {RequiredError}
|
|
929
574
|
*/
|
|
930
|
-
|
|
575
|
+
collectionDelete(tenant: string, database: string, collectionId: string, request: Api.DeleteCollectionRecordsPayload, options?: RequestInit): Promise<Api.DeleteCollectionRecordsResponse>;
|
|
931
576
|
/**
|
|
932
|
-
* @summary
|
|
933
|
-
* @param {
|
|
577
|
+
* @summary Retrieves records from a collection by ID or metadata filter.
|
|
578
|
+
* @param {string} tenant <p>Tenant ID</p>
|
|
579
|
+
* @param {string} database <p>Database name for the collection</p>
|
|
580
|
+
* @param {string} collectionId <p>Collection ID to fetch records from</p>
|
|
581
|
+
* @param {Api.GetRequestPayload} request
|
|
934
582
|
* @param {RequestInit} [options] Override http request option.
|
|
935
583
|
* @throws {RequiredError}
|
|
936
584
|
*/
|
|
937
|
-
|
|
585
|
+
collectionGet(tenant: string, database: string, collectionId: string, request: Api.GetRequestPayload, options?: RequestInit): Promise<Api.GetResponse>;
|
|
938
586
|
/**
|
|
939
|
-
* @summary
|
|
940
|
-
* @param {string}
|
|
941
|
-
* @param {string}
|
|
942
|
-
* @param {string}
|
|
587
|
+
* @summary Query a collection in a variety of ways, including vector search, metadata filtering, and full-text search
|
|
588
|
+
* @param {string} tenant <p>Tenant ID</p>
|
|
589
|
+
* @param {string} database <p>Database name containing the collection</p>
|
|
590
|
+
* @param {string} collectionId <p>Collection ID to query</p>
|
|
591
|
+
* @param {number} [limit] <p>Limit for pagination</p>
|
|
592
|
+
* @param {number} [offset] <p>Offset for pagination</p>
|
|
593
|
+
* @param {Api.QueryRequestPayload} request
|
|
943
594
|
* @param {RequestInit} [options] Override http request option.
|
|
944
595
|
* @throws {RequiredError}
|
|
945
596
|
*/
|
|
946
|
-
|
|
597
|
+
collectionQuery(tenant: string, database: string, collectionId: string, limit: number | undefined, offset: number | undefined, request: Api.QueryRequestPayload, options?: RequestInit): Promise<Api.QueryResponse>;
|
|
947
598
|
/**
|
|
948
|
-
* @summary
|
|
949
|
-
* @param {string} collectionName
|
|
599
|
+
* @summary Updates records in a collection by ID.
|
|
950
600
|
* @param {string} tenant
|
|
951
|
-
* @param {string}
|
|
601
|
+
* @param {string} database
|
|
602
|
+
* @param {string} collectionId
|
|
603
|
+
* @param {Api.UpdateCollectionRecordsPayload} request
|
|
952
604
|
* @param {RequestInit} [options] Override http request option.
|
|
953
605
|
* @throws {RequiredError}
|
|
954
606
|
*/
|
|
955
|
-
|
|
607
|
+
collectionUpdate(tenant: string, database: string, collectionId: string, request: Api.UpdateCollectionRecordsPayload, options?: RequestInit): Promise<Api.UpdateCollectionRecordsResponse>;
|
|
956
608
|
/**
|
|
957
|
-
* @summary
|
|
958
|
-
* @param {string}
|
|
959
|
-
* @param {string}
|
|
609
|
+
* @summary Upserts records in a collection (create if not exists, otherwise update).
|
|
610
|
+
* @param {string} tenant <p>Tenant ID</p>
|
|
611
|
+
* @param {string} database <p>Database name</p>
|
|
612
|
+
* @param {string} collectionId <p>Collection ID</p>
|
|
613
|
+
* @param {Api.UpsertCollectionRecordsPayload} request
|
|
960
614
|
* @param {RequestInit} [options] Override http request option.
|
|
961
615
|
* @throws {RequiredError}
|
|
962
616
|
*/
|
|
963
|
-
|
|
617
|
+
collectionUpsert(tenant: string, database: string, collectionId: string, request: Api.UpsertCollectionRecordsPayload, options?: RequestInit): Promise<Api.UpsertCollectionRecordsResponse>;
|
|
964
618
|
/**
|
|
965
|
-
* @summary
|
|
966
|
-
* @param {string}
|
|
967
|
-
* @param {
|
|
619
|
+
* @summary Retrieves the total number of collections in a given database.
|
|
620
|
+
* @param {string} tenant <p>Tenant ID</p>
|
|
621
|
+
* @param {string} database <p>Database name to count collections from</p>
|
|
968
622
|
* @param {RequestInit} [options] Override http request option.
|
|
969
623
|
* @throws {RequiredError}
|
|
970
624
|
*/
|
|
971
|
-
|
|
625
|
+
countCollections(tenant: string, database: string, options?: RequestInit): Promise<number>;
|
|
972
626
|
/**
|
|
973
|
-
* @summary
|
|
974
|
-
* @param {string}
|
|
975
|
-
* @param {string}
|
|
976
|
-
* @param {
|
|
977
|
-
* @param {Api.DeleteV2Request} request
|
|
627
|
+
* @summary Creates a new collection under the specified database.
|
|
628
|
+
* @param {string} tenant <p>Tenant ID</p>
|
|
629
|
+
* @param {string} database <p>Database name containing the new collection</p>
|
|
630
|
+
* @param {Api.CreateCollectionPayload} request
|
|
978
631
|
* @param {RequestInit} [options] Override http request option.
|
|
979
632
|
* @throws {RequiredError}
|
|
980
633
|
*/
|
|
981
|
-
|
|
634
|
+
createCollection(tenant: string, database: string, request: Api.CreateCollectionPayload, options?: RequestInit): Promise<Api.Collection>;
|
|
982
635
|
/**
|
|
983
|
-
* @summary
|
|
984
|
-
* @param {string}
|
|
985
|
-
* @param {
|
|
986
|
-
* @param {string} [database]
|
|
636
|
+
* @summary Creates a new database for a given tenant.
|
|
637
|
+
* @param {string} tenant <p>Tenant ID to associate with the new database</p>
|
|
638
|
+
* @param {Api.CreateDatabasePayload} request
|
|
987
639
|
* @param {RequestInit} [options] Override http request option.
|
|
988
640
|
* @throws {RequiredError}
|
|
989
641
|
*/
|
|
990
|
-
|
|
642
|
+
createDatabase(tenant: string, request: Api.CreateDatabasePayload, options?: RequestInit): Promise<Api.CreateDatabaseResponse>;
|
|
991
643
|
/**
|
|
992
|
-
* @summary
|
|
993
|
-
* @param {
|
|
994
|
-
* @param {string} databaseName
|
|
995
|
-
* @param {string} collectionName
|
|
644
|
+
* @summary Creates a new tenant.
|
|
645
|
+
* @param {Api.CreateTenantPayload} request
|
|
996
646
|
* @param {RequestInit} [options] Override http request option.
|
|
997
647
|
* @throws {RequiredError}
|
|
998
648
|
*/
|
|
999
|
-
|
|
649
|
+
createTenant(request: Api.CreateTenantPayload, options?: RequestInit): Promise<Api.CreateTenantResponse>;
|
|
1000
650
|
/**
|
|
1001
|
-
* @summary
|
|
1002
|
-
* @param {string}
|
|
1003
|
-
* @param {string}
|
|
651
|
+
* @summary Deletes a collection in a given database.
|
|
652
|
+
* @param {string} tenant <p>Tenant ID</p>
|
|
653
|
+
* @param {string} database <p>Database name</p>
|
|
654
|
+
* @param {string} collectionId <p>UUID of the collection to delete</p>
|
|
1004
655
|
* @param {RequestInit} [options] Override http request option.
|
|
1005
656
|
* @throws {RequiredError}
|
|
1006
657
|
*/
|
|
1007
|
-
|
|
658
|
+
deleteCollection(tenant: string, database: string, collectionId: string, options?: RequestInit): Promise<Api.UpdateCollectionResponse>;
|
|
1008
659
|
/**
|
|
1009
|
-
* @summary
|
|
1010
|
-
* @param {string}
|
|
1011
|
-
* @param {string}
|
|
660
|
+
* @summary Deletes a specific database.
|
|
661
|
+
* @param {string} tenant <p>Tenant ID</p>
|
|
662
|
+
* @param {string} database <p>Name of the database to delete</p>
|
|
1012
663
|
* @param {RequestInit} [options] Override http request option.
|
|
1013
664
|
* @throws {RequiredError}
|
|
1014
665
|
*/
|
|
1015
|
-
|
|
666
|
+
deleteDatabase(tenant: string, database: string, options?: RequestInit): Promise<Api.DeleteDatabaseResponse>;
|
|
1016
667
|
/**
|
|
1017
|
-
* @summary
|
|
1018
|
-
* @param {string}
|
|
1019
|
-
* @param {
|
|
668
|
+
* @summary Forks an existing collection.
|
|
669
|
+
* @param {string} tenant <p>Tenant ID</p>
|
|
670
|
+
* @param {string} database <p>Database name</p>
|
|
671
|
+
* @param {string} collectionId <p>UUID of the collection to update</p>
|
|
672
|
+
* @param {Api.ForkCollectionPayload} request
|
|
1020
673
|
* @param {RequestInit} [options] Override http request option.
|
|
1021
674
|
* @throws {RequiredError}
|
|
1022
675
|
*/
|
|
1023
|
-
|
|
676
|
+
forkCollection(tenant: string, database: string, collectionId: string, request: Api.ForkCollectionPayload, options?: RequestInit): Promise<Api.Collection>;
|
|
1024
677
|
/**
|
|
1025
|
-
* @summary
|
|
1026
|
-
* @param {string} tenant
|
|
1027
|
-
* @param {string}
|
|
1028
|
-
* @param {string} collectionId
|
|
1029
|
-
* @param {Api.GetNearestNeighborsV2Request} request
|
|
678
|
+
* @summary Retrieves a collection by ID or name.
|
|
679
|
+
* @param {string} tenant <p>Tenant ID</p>
|
|
680
|
+
* @param {string} database <p>Database name</p>
|
|
681
|
+
* @param {string} collectionId <p>UUID of the collection</p>
|
|
1030
682
|
* @param {RequestInit} [options] Override http request option.
|
|
1031
683
|
* @throws {RequiredError}
|
|
1032
684
|
*/
|
|
1033
|
-
|
|
685
|
+
getCollection(tenant: string, database: string, collectionId: string, options?: RequestInit): Promise<Api.Collection>;
|
|
1034
686
|
/**
|
|
1035
|
-
* @summary
|
|
1036
|
-
* @param {string} tenant
|
|
687
|
+
* @summary Retrieves a specific database by name.
|
|
688
|
+
* @param {string} tenant <p>Tenant ID</p>
|
|
689
|
+
* @param {string} database <p>Name of the database to retrieve</p>
|
|
1037
690
|
* @param {RequestInit} [options] Override http request option.
|
|
1038
691
|
* @throws {RequiredError}
|
|
1039
692
|
*/
|
|
1040
|
-
|
|
693
|
+
getDatabase(tenant: string, database: string, options?: RequestInit): Promise<Api.Database>;
|
|
1041
694
|
/**
|
|
1042
|
-
* @summary
|
|
1043
|
-
* @param {string}
|
|
695
|
+
* @summary Returns an existing tenant by name.
|
|
696
|
+
* @param {string} tenantName <p>Tenant name or ID to retrieve</p>
|
|
1044
697
|
* @param {RequestInit} [options] Override http request option.
|
|
1045
698
|
* @throws {RequiredError}
|
|
1046
699
|
*/
|
|
1047
|
-
|
|
700
|
+
getTenant(tenantName: string, options?: RequestInit): Promise<Api.GetTenantResponse>;
|
|
1048
701
|
/**
|
|
1049
|
-
* @summary
|
|
702
|
+
* @summary Retrieves the current user's identity, tenant, and databases.
|
|
1050
703
|
* @param {RequestInit} [options] Override http request option.
|
|
1051
704
|
* @throws {RequiredError}
|
|
1052
705
|
*/
|
|
1053
|
-
|
|
706
|
+
getUserIdentity(options?: RequestInit): Promise<Api.GetUserIdentityResponse>;
|
|
1054
707
|
/**
|
|
1055
|
-
* @summary
|
|
1056
|
-
* @param {string} collectionId
|
|
1057
|
-
* @param {Api.GetV1V1Request} request
|
|
708
|
+
* @summary Health check endpoint that returns 200 if the server and executor are ready
|
|
1058
709
|
* @param {RequestInit} [options] Override http request option.
|
|
1059
710
|
* @throws {RequiredError}
|
|
1060
711
|
*/
|
|
1061
|
-
|
|
712
|
+
healthcheck(options?: RequestInit): Promise<string>;
|
|
1062
713
|
/**
|
|
1063
|
-
* @summary
|
|
1064
|
-
* @param {string} collectionId
|
|
1065
|
-
* @param {string} tenant
|
|
1066
|
-
* @param {string} databaseName
|
|
1067
|
-
* @param {Api.GetV2Request} request
|
|
714
|
+
* @summary Heartbeat endpoint that returns a nanosecond timestamp of the current time.
|
|
1068
715
|
* @param {RequestInit} [options] Override http request option.
|
|
1069
716
|
* @throws {RequiredError}
|
|
1070
717
|
*/
|
|
1071
|
-
|
|
718
|
+
heartbeat(options?: RequestInit): Promise<Api.HeartbeatResponse>;
|
|
1072
719
|
/**
|
|
1073
|
-
* @summary
|
|
720
|
+
* @summary Lists all collections in the specified database.
|
|
721
|
+
* @param {string} tenant <p>Tenant ID</p>
|
|
722
|
+
* @param {string} database <p>Database name to list collections from</p>
|
|
723
|
+
* @param {number} [limit] <p>Limit for pagination</p>
|
|
724
|
+
* @param {number} [offset] <p>Offset for pagination</p>
|
|
1074
725
|
* @param {RequestInit} [options] Override http request option.
|
|
1075
726
|
* @throws {RequiredError}
|
|
1076
727
|
*/
|
|
1077
|
-
|
|
1078
|
-
[name: string]: number;
|
|
1079
|
-
}>;
|
|
728
|
+
listCollections(tenant: string, database: string, limit: number | undefined, offset: number | undefined, options?: RequestInit): Promise<Api.Vec2[]>;
|
|
1080
729
|
/**
|
|
1081
|
-
* @summary
|
|
730
|
+
* @summary Lists all databases for a given tenant.
|
|
731
|
+
* @param {string} tenant <p>Tenant ID to list databases for</p>
|
|
732
|
+
* @param {number} [limit] <p>Limit for pagination</p>
|
|
733
|
+
* @param {number} [offset] <p>Offset for pagination</p>
|
|
1082
734
|
* @param {RequestInit} [options] Override http request option.
|
|
1083
735
|
* @throws {RequiredError}
|
|
1084
736
|
*/
|
|
1085
|
-
|
|
1086
|
-
[name: string]: number;
|
|
1087
|
-
}>;
|
|
737
|
+
listDatabases(tenant: string, limit: number | undefined, offset: number | undefined, options?: RequestInit): Promise<Api.Vec2[]>;
|
|
1088
738
|
/**
|
|
1089
|
-
* @summary
|
|
1090
|
-
* @param {number | null} [limit]
|
|
1091
|
-
* @param {number | null} [offset]
|
|
1092
|
-
* @param {string} [tenant]
|
|
1093
|
-
* @param {string} [database]
|
|
739
|
+
* @summary Pre-flight checks endpoint reporting basic readiness info.
|
|
1094
740
|
* @param {RequestInit} [options] Override http request option.
|
|
1095
741
|
* @throws {RequiredError}
|
|
1096
742
|
*/
|
|
1097
|
-
|
|
743
|
+
preFlightChecks(options?: RequestInit): Promise<Api.ChecklistResponse>;
|
|
1098
744
|
/**
|
|
1099
|
-
* @summary
|
|
1100
|
-
* @param {string} tenant
|
|
1101
|
-
* @param {string} databaseName
|
|
1102
|
-
* @param {number | null} [limit]
|
|
1103
|
-
* @param {number | null} [offset]
|
|
745
|
+
* @summary Reset endpoint allowing authorized users to reset the database.
|
|
1104
746
|
* @param {RequestInit} [options] Override http request option.
|
|
1105
747
|
* @throws {RequiredError}
|
|
1106
748
|
*/
|
|
1107
|
-
|
|
749
|
+
reset(options?: RequestInit): Promise<boolean>;
|
|
1108
750
|
/**
|
|
1109
|
-
* @summary
|
|
1110
|
-
* @param {string} tenant
|
|
1111
|
-
* @param {
|
|
1112
|
-
* @param {
|
|
751
|
+
* @summary Updates an existing collection's name or metadata.
|
|
752
|
+
* @param {string} tenant <p>Tenant ID</p>
|
|
753
|
+
* @param {string} database <p>Database name</p>
|
|
754
|
+
* @param {string} collectionId <p>UUID of the collection to update</p>
|
|
755
|
+
* @param {Api.UpdateCollectionPayload} request
|
|
1113
756
|
* @param {RequestInit} [options] Override http request option.
|
|
1114
757
|
* @throws {RequiredError}
|
|
1115
758
|
*/
|
|
1116
|
-
|
|
759
|
+
updateCollection(tenant: string, database: string, collectionId: string, request: Api.UpdateCollectionPayload, options?: RequestInit): Promise<Api.UpdateCollectionResponse>;
|
|
1117
760
|
/**
|
|
1118
|
-
* @summary
|
|
761
|
+
* @summary Returns the version of the server.
|
|
1119
762
|
* @param {RequestInit} [options] Override http request option.
|
|
1120
763
|
* @throws {RequiredError}
|
|
1121
764
|
*/
|
|
1122
|
-
|
|
765
|
+
version(options?: RequestInit): Promise<string>;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
type HnswSpace = EmbeddingFunctionSpace;
|
|
769
|
+
interface HNSWConfiguration {
|
|
770
|
+
space?: HnswSpace;
|
|
771
|
+
ef_construction?: number;
|
|
772
|
+
max_neighbors?: number;
|
|
773
|
+
ef_search?: number;
|
|
774
|
+
num_threads?: number;
|
|
775
|
+
batch_size?: number;
|
|
776
|
+
sync_threshold?: number;
|
|
777
|
+
resize_factor?: number;
|
|
778
|
+
}
|
|
779
|
+
interface CreateHNSWConfiguration extends HNSWConfiguration {
|
|
780
|
+
}
|
|
781
|
+
interface UpdateHNSWConfiguration {
|
|
782
|
+
ef_search?: number;
|
|
783
|
+
num_threads?: number;
|
|
784
|
+
batch_size?: number;
|
|
785
|
+
sync_threshold?: number;
|
|
786
|
+
resize_factor?: number;
|
|
787
|
+
}
|
|
788
|
+
interface SpannConfiguration {
|
|
789
|
+
space?: EmbeddingFunctionSpace;
|
|
790
|
+
search_nprobe?: number;
|
|
791
|
+
write_nprobe?: number;
|
|
792
|
+
ef_construction?: number;
|
|
793
|
+
max_neighbors?: number;
|
|
794
|
+
ef_search?: number;
|
|
795
|
+
reassign_neighbor_count?: number;
|
|
796
|
+
split_threshold?: number;
|
|
797
|
+
merge_threshold?: number;
|
|
798
|
+
}
|
|
799
|
+
interface CreateSpannConfiguration extends SpannConfiguration {
|
|
800
|
+
}
|
|
801
|
+
interface UpdateSpannConfiguration {
|
|
802
|
+
search_nprobe?: number;
|
|
803
|
+
ef_search?: number;
|
|
804
|
+
}
|
|
805
|
+
interface CreateCollectionConfiguration {
|
|
806
|
+
hnsw?: CreateHNSWConfiguration | null;
|
|
807
|
+
spann?: CreateSpannConfiguration | null;
|
|
808
|
+
embedding_function?: IEmbeddingFunction | null;
|
|
809
|
+
}
|
|
810
|
+
interface UpdateCollectionConfiguration {
|
|
811
|
+
hnsw?: UpdateHNSWConfiguration | null;
|
|
812
|
+
spann?: UpdateSpannConfiguration | null;
|
|
813
|
+
embedding_function?: IEmbeddingFunction | null;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
declare enum IncludeEnum {
|
|
817
|
+
Documents = "documents",
|
|
818
|
+
Embeddings = "embeddings",
|
|
819
|
+
Metadatas = "metadatas",
|
|
820
|
+
Distances = "distances",
|
|
821
|
+
Uris = "uris"
|
|
822
|
+
}
|
|
823
|
+
type Embedding = number[];
|
|
824
|
+
type Embeddings = Embedding[];
|
|
825
|
+
type Metadata = Record<string, string | number | boolean>;
|
|
826
|
+
type Metadatas = Metadata[];
|
|
827
|
+
type Document = string;
|
|
828
|
+
type Documents = Document[];
|
|
829
|
+
type ID = string;
|
|
830
|
+
type IDs = ID[];
|
|
831
|
+
type PositiveInteger = number;
|
|
832
|
+
type LiteralValue = string | number | boolean;
|
|
833
|
+
type ListLiteralValue = LiteralValue[];
|
|
834
|
+
type LiteralNumber = number;
|
|
835
|
+
type LogicalOperator = "$and" | "$or";
|
|
836
|
+
type InclusionOperator = "$in" | "$nin";
|
|
837
|
+
type WhereOperator = "$gt" | "$gte" | "$lt" | "$lte" | "$ne" | "$eq";
|
|
838
|
+
type OperatorExpression = {
|
|
839
|
+
[key in WhereOperator | InclusionOperator | LogicalOperator]?: LiteralValue | ListLiteralValue;
|
|
840
|
+
};
|
|
841
|
+
type BaseWhere = {
|
|
842
|
+
[key: string]: LiteralValue | OperatorExpression;
|
|
843
|
+
};
|
|
844
|
+
type LogicalWhere = {
|
|
845
|
+
[key in LogicalOperator]?: Where[];
|
|
846
|
+
};
|
|
847
|
+
type Where = BaseWhere | LogicalWhere;
|
|
848
|
+
type WhereDocumentOperator = "$contains" | "$not_contains" | LogicalOperator;
|
|
849
|
+
type WhereDocument = {
|
|
850
|
+
[key in WhereDocumentOperator]?: LiteralValue | LiteralNumber | WhereDocument[];
|
|
851
|
+
};
|
|
852
|
+
type MultiGetResponse = {
|
|
853
|
+
ids: IDs;
|
|
854
|
+
embeddings: Embeddings | null;
|
|
855
|
+
documents: (Document | null)[];
|
|
856
|
+
metadatas: (Metadata | null)[];
|
|
857
|
+
included: IncludeEnum[];
|
|
858
|
+
};
|
|
859
|
+
type GetResponse = MultiGetResponse;
|
|
860
|
+
type SingleQueryResponse = {
|
|
861
|
+
ids: IDs;
|
|
862
|
+
embeddings: Embeddings | null;
|
|
863
|
+
documents: (Document | null)[];
|
|
864
|
+
metadatas: (Metadata | null)[];
|
|
865
|
+
distances: number[] | null;
|
|
866
|
+
included: IncludeEnum[];
|
|
867
|
+
};
|
|
868
|
+
type MultiQueryResponse = {
|
|
869
|
+
ids: IDs[];
|
|
870
|
+
embeddings: Embeddings[] | null;
|
|
871
|
+
documents: (Document | null)[][];
|
|
872
|
+
metadatas: (Metadata | null)[][];
|
|
873
|
+
distances: number[][] | null;
|
|
874
|
+
included: IncludeEnum[];
|
|
875
|
+
};
|
|
876
|
+
type QueryResponse = SingleQueryResponse | MultiQueryResponse;
|
|
877
|
+
interface CollectionParams {
|
|
878
|
+
name: string;
|
|
879
|
+
id: string;
|
|
880
|
+
metadata: CollectionMetadata | undefined;
|
|
881
|
+
embeddingFunction: IEmbeddingFunction;
|
|
882
|
+
configuration: Api.CollectionConfiguration | undefined;
|
|
883
|
+
}
|
|
884
|
+
type CollectionMetadata = Record<string, boolean | number | string>;
|
|
885
|
+
type ConfigOptions = {
|
|
886
|
+
options?: RequestInit;
|
|
887
|
+
};
|
|
888
|
+
type BaseGetParams = {
|
|
889
|
+
ids?: ID | IDs;
|
|
890
|
+
where?: Where;
|
|
891
|
+
limit?: PositiveInteger;
|
|
892
|
+
offset?: PositiveInteger;
|
|
893
|
+
include?: IncludeEnum[];
|
|
894
|
+
whereDocument?: WhereDocument;
|
|
895
|
+
};
|
|
896
|
+
type SingleGetParams = BaseGetParams & {
|
|
897
|
+
ids: ID;
|
|
898
|
+
};
|
|
899
|
+
type MultiGetParams = BaseGetParams & {
|
|
900
|
+
ids?: IDs;
|
|
901
|
+
};
|
|
902
|
+
type GetParams = SingleGetParams | MultiGetParams;
|
|
903
|
+
type ListCollectionsParams = {
|
|
904
|
+
limit?: PositiveInteger;
|
|
905
|
+
offset?: PositiveInteger;
|
|
906
|
+
};
|
|
907
|
+
type ChromaClientParams = {
|
|
908
|
+
path?: string;
|
|
909
|
+
fetchOptions?: RequestInit;
|
|
910
|
+
auth?: AuthOptions;
|
|
911
|
+
tenant?: string;
|
|
912
|
+
database?: string;
|
|
913
|
+
};
|
|
914
|
+
type CreateCollectionParams = {
|
|
915
|
+
name: string;
|
|
916
|
+
metadata?: CollectionMetadata;
|
|
917
|
+
embeddingFunction?: IEmbeddingFunction;
|
|
918
|
+
configuration?: CreateCollectionConfiguration;
|
|
919
|
+
};
|
|
920
|
+
type GetOrCreateCollectionParams = CreateCollectionParams;
|
|
921
|
+
type GetCollectionParams = {
|
|
922
|
+
name: string;
|
|
923
|
+
embeddingFunction?: IEmbeddingFunction;
|
|
924
|
+
};
|
|
925
|
+
type DeleteCollectionParams = {
|
|
926
|
+
name: string;
|
|
927
|
+
};
|
|
928
|
+
type BaseRecordOperationParams = {
|
|
929
|
+
ids: ID | IDs;
|
|
930
|
+
embeddings?: Embedding | Embeddings;
|
|
931
|
+
metadatas?: Metadata | Metadatas;
|
|
932
|
+
documents?: Document | Documents;
|
|
933
|
+
};
|
|
934
|
+
type SingleRecordOperationParams = BaseRecordOperationParams & {
|
|
935
|
+
ids: ID;
|
|
936
|
+
embeddings?: Embedding;
|
|
937
|
+
metadatas?: Metadata;
|
|
938
|
+
documents?: Document;
|
|
939
|
+
};
|
|
940
|
+
type SingleEmbeddingRecordOperationParams = SingleRecordOperationParams & {
|
|
941
|
+
embeddings: Embedding;
|
|
942
|
+
};
|
|
943
|
+
type SingleContentRecordOperationParams = SingleRecordOperationParams & {
|
|
944
|
+
documents: Document;
|
|
945
|
+
};
|
|
946
|
+
type SingleAddRecordOperationParams = SingleEmbeddingRecordOperationParams | SingleContentRecordOperationParams;
|
|
947
|
+
type MultiRecordOperationParams = BaseRecordOperationParams & {
|
|
948
|
+
ids: IDs;
|
|
949
|
+
embeddings?: Embeddings;
|
|
950
|
+
metadatas?: Metadatas;
|
|
951
|
+
documents?: Documents;
|
|
952
|
+
};
|
|
953
|
+
type MultiEmbeddingRecordOperationParams = MultiRecordOperationParams & {
|
|
954
|
+
embeddings: Embeddings;
|
|
955
|
+
};
|
|
956
|
+
type MultiContentRecordOperationParams = MultiRecordOperationParams & {
|
|
957
|
+
documents: Documents;
|
|
958
|
+
};
|
|
959
|
+
type MultiAddRecordsOperationParams = MultiEmbeddingRecordOperationParams | MultiContentRecordOperationParams;
|
|
960
|
+
type AddRecordsParams = SingleAddRecordOperationParams | MultiAddRecordsOperationParams;
|
|
961
|
+
type UpsertRecordsParams = AddRecordsParams;
|
|
962
|
+
type UpdateRecordsParams = MultiRecordOperationParams | SingleRecordOperationParams;
|
|
963
|
+
type ModifyCollectionParams = {
|
|
964
|
+
name?: string;
|
|
965
|
+
metadata?: CollectionMetadata;
|
|
966
|
+
};
|
|
967
|
+
type ForkCollectionParams = {
|
|
968
|
+
newName: string;
|
|
969
|
+
};
|
|
970
|
+
type BaseQueryParams = {
|
|
971
|
+
nResults?: PositiveInteger;
|
|
972
|
+
where?: Where;
|
|
973
|
+
queryTexts?: string | string[];
|
|
974
|
+
queryEmbeddings?: Embedding | Embeddings;
|
|
975
|
+
whereDocument?: WhereDocument;
|
|
976
|
+
include?: IncludeEnum[];
|
|
977
|
+
};
|
|
978
|
+
type SingleTextQueryParams = BaseQueryParams & {
|
|
979
|
+
queryTexts: string;
|
|
980
|
+
queryEmbeddings?: never;
|
|
981
|
+
};
|
|
982
|
+
type SingleEmbeddingQueryParams = BaseQueryParams & {
|
|
983
|
+
queryTexts?: never;
|
|
984
|
+
queryEmbeddings: Embedding;
|
|
985
|
+
};
|
|
986
|
+
type MultiTextQueryParams = BaseQueryParams & {
|
|
987
|
+
queryTexts: string[];
|
|
988
|
+
queryEmbeddings?: never;
|
|
989
|
+
};
|
|
990
|
+
type MultiEmbeddingQueryParams = BaseQueryParams & {
|
|
991
|
+
queryTexts?: never;
|
|
992
|
+
queryEmbeddings: Embeddings;
|
|
993
|
+
};
|
|
994
|
+
type QueryRecordsParams = SingleTextQueryParams | SingleEmbeddingQueryParams | MultiTextQueryParams | MultiEmbeddingQueryParams;
|
|
995
|
+
type PeekParams = {
|
|
996
|
+
limit?: PositiveInteger;
|
|
997
|
+
};
|
|
998
|
+
type DeleteParams = {
|
|
999
|
+
ids?: ID | IDs;
|
|
1000
|
+
where?: Where;
|
|
1001
|
+
whereDocument?: WhereDocument;
|
|
1002
|
+
};
|
|
1003
|
+
|
|
1004
|
+
declare class Collection {
|
|
1005
|
+
name: string;
|
|
1006
|
+
id: string;
|
|
1007
|
+
metadata: CollectionMetadata | undefined;
|
|
1123
1008
|
/**
|
|
1124
|
-
* @
|
|
1125
|
-
* @param {RequestInit} [options] Override http request option.
|
|
1126
|
-
* @throws {RequiredError}
|
|
1009
|
+
* @ignore
|
|
1127
1010
|
*/
|
|
1128
|
-
|
|
1011
|
+
private client;
|
|
1129
1012
|
/**
|
|
1130
|
-
* @
|
|
1131
|
-
* @param {RequestInit} [options] Override http request option.
|
|
1132
|
-
* @throws {RequiredError}
|
|
1013
|
+
* @ignore
|
|
1133
1014
|
*/
|
|
1134
|
-
|
|
1015
|
+
embeddingFunction: IEmbeddingFunction;
|
|
1016
|
+
configuration: Api.CollectionConfiguration | undefined;
|
|
1135
1017
|
/**
|
|
1136
|
-
* @
|
|
1137
|
-
* @param {RequestInit} [options] Override http request option.
|
|
1138
|
-
* @throws {RequiredError}
|
|
1018
|
+
* @ignore
|
|
1139
1019
|
*/
|
|
1140
|
-
|
|
1020
|
+
constructor(name: string, id: string, client: ChromaClient, embeddingFunction: IEmbeddingFunction, metadata?: CollectionMetadata, configuration?: Api.CollectionConfiguration);
|
|
1141
1021
|
/**
|
|
1142
|
-
*
|
|
1143
|
-
* @param {
|
|
1144
|
-
* @
|
|
1022
|
+
* Add items to the collection
|
|
1023
|
+
* @param {Object} params - The parameters for the query.
|
|
1024
|
+
* @param {ID | IDs} [params.ids] - IDs of the items to add.
|
|
1025
|
+
* @param {Embedding | Embeddings} [params.embeddings] - Optional embeddings of the items to add.
|
|
1026
|
+
* @param {Metadata | Metadatas} [params.metadatas] - Optional metadata of the items to add.
|
|
1027
|
+
* @param {Document | Documents} [params.documents] - Optional documents of the items to add.
|
|
1028
|
+
* @returns {Promise<AddResponse>} - The response from the API. True if successful.
|
|
1029
|
+
*
|
|
1030
|
+
* @example
|
|
1031
|
+
* ```typescript
|
|
1032
|
+
* const response = await collection.add({
|
|
1033
|
+
* ids: ["id1", "id2"],
|
|
1034
|
+
* embeddings: [[1, 2, 3], [4, 5, 6]],
|
|
1035
|
+
* metadatas: [{ "key": "value" }, { "key": "value" }],
|
|
1036
|
+
* documents: ["document1", "document2"]
|
|
1037
|
+
* });
|
|
1038
|
+
* ```
|
|
1145
1039
|
*/
|
|
1146
|
-
|
|
1147
|
-
[name: string]: number;
|
|
1148
|
-
}>;
|
|
1040
|
+
add(params: AddRecordsParams): Promise<void>;
|
|
1149
1041
|
/**
|
|
1150
|
-
*
|
|
1151
|
-
* @param {
|
|
1152
|
-
* @
|
|
1042
|
+
* Upsert items to the collection
|
|
1043
|
+
* @param {Object} params - The parameters for the query.
|
|
1044
|
+
* @param {ID | IDs} [params.ids] - IDs of the items to add.
|
|
1045
|
+
* @param {Embedding | Embeddings} [params.embeddings] - Optional embeddings of the items to add.
|
|
1046
|
+
* @param {Metadata | Metadatas} [params.metadatas] - Optional metadata of the items to add.
|
|
1047
|
+
* @param {Document | Documents} [params.documents] - Optional documents of the items to add.
|
|
1048
|
+
* @returns {Promise<void>}
|
|
1049
|
+
*
|
|
1050
|
+
* @example
|
|
1051
|
+
* ```typescript
|
|
1052
|
+
* const response = await collection.upsert({
|
|
1053
|
+
* ids: ["id1", "id2"],
|
|
1054
|
+
* embeddings: [[1, 2, 3], [4, 5, 6]],
|
|
1055
|
+
* metadatas: [{ "key": "value" }, { "key": "value" }],
|
|
1056
|
+
* documents: ["document1", "document2"],
|
|
1057
|
+
* });
|
|
1058
|
+
* ```
|
|
1153
1059
|
*/
|
|
1154
|
-
|
|
1155
|
-
[name: string]: number;
|
|
1156
|
-
}>;
|
|
1060
|
+
upsert(params: UpsertRecordsParams): Promise<void>;
|
|
1157
1061
|
/**
|
|
1158
|
-
*
|
|
1159
|
-
* @
|
|
1160
|
-
*
|
|
1161
|
-
* @
|
|
1162
|
-
*
|
|
1062
|
+
* Count the number of items in the collection
|
|
1063
|
+
* @returns {Promise<number>} - The number of items in the collection.
|
|
1064
|
+
*
|
|
1065
|
+
* @example
|
|
1066
|
+
* ```typescript
|
|
1067
|
+
* const count = await collection.count();
|
|
1068
|
+
* ```
|
|
1163
1069
|
*/
|
|
1164
|
-
|
|
1070
|
+
count(): Promise<number>;
|
|
1165
1071
|
/**
|
|
1166
|
-
*
|
|
1167
|
-
* @param {
|
|
1168
|
-
* @param {
|
|
1169
|
-
* @param {
|
|
1170
|
-
* @param {
|
|
1171
|
-
* @param {
|
|
1172
|
-
* @
|
|
1072
|
+
* Get items from the collection
|
|
1073
|
+
* @param {Object} params - The parameters for the query.
|
|
1074
|
+
* @param {ID | IDs} [params.ids] - Optional IDs of the items to get.
|
|
1075
|
+
* @param {Where} [params.where] - Optional where clause to filter items by.
|
|
1076
|
+
* @param {PositiveInteger} [params.limit] - Optional limit on the number of items to get.
|
|
1077
|
+
* @param {PositiveInteger} [params.offset] - Optional offset on the items to get.
|
|
1078
|
+
* @param {IncludeEnum[]} [params.include] - Optional list of items to include in the response.
|
|
1079
|
+
* @param {WhereDocument} [params.whereDocument] - Optional where clause to filter items by.
|
|
1080
|
+
* @returns {Promise<GetResponse>} - The response from the server.
|
|
1081
|
+
*
|
|
1082
|
+
* @example
|
|
1083
|
+
* ```typescript
|
|
1084
|
+
* const response = await collection.get({
|
|
1085
|
+
* ids: ["id1", "id2"],
|
|
1086
|
+
* where: { "key": "value" },
|
|
1087
|
+
* limit: 10,
|
|
1088
|
+
* offset: 0,
|
|
1089
|
+
* include: ["embeddings", "metadatas", "documents"],
|
|
1090
|
+
* whereDocument: { "$contains": "value" },
|
|
1091
|
+
* });
|
|
1092
|
+
* ```
|
|
1173
1093
|
*/
|
|
1174
|
-
|
|
1094
|
+
get({ ids, where, limit, offset, include, whereDocument, }?: BaseGetParams): Promise<GetResponse>;
|
|
1175
1095
|
/**
|
|
1176
|
-
*
|
|
1177
|
-
* @param {
|
|
1178
|
-
* @param {
|
|
1179
|
-
* @param {
|
|
1180
|
-
* @
|
|
1096
|
+
* Update items in the collection
|
|
1097
|
+
* @param {Object} params - The parameters for the query.
|
|
1098
|
+
* @param {ID | IDs} [params.ids] - IDs of the items to add.
|
|
1099
|
+
* @param {Embedding | Embeddings} [params.embeddings] - Optional embeddings of the items to add.
|
|
1100
|
+
* @param {Metadata | Metadatas} [params.metadatas] - Optional metadata of the items to add.
|
|
1101
|
+
* @param {Document | Documents} [params.documents] - Optional documents of the items to add.
|
|
1102
|
+
* @returns {Promise<void>}
|
|
1103
|
+
*
|
|
1104
|
+
* @example
|
|
1105
|
+
* ```typescript
|
|
1106
|
+
* const response = await collection.update({
|
|
1107
|
+
* ids: ["id1", "id2"],
|
|
1108
|
+
* embeddings: [[1, 2, 3], [4, 5, 6]],
|
|
1109
|
+
* metadatas: [{ "key": "value" }, { "key": "value" }],
|
|
1110
|
+
* documents: ["document1", "document2"],
|
|
1111
|
+
* });
|
|
1112
|
+
* ```
|
|
1181
1113
|
*/
|
|
1182
|
-
|
|
1114
|
+
update(params: UpdateRecordsParams): Promise<void>;
|
|
1183
1115
|
/**
|
|
1184
|
-
*
|
|
1185
|
-
*
|
|
1186
|
-
* @param {
|
|
1187
|
-
* @param {
|
|
1188
|
-
* @param {
|
|
1189
|
-
* @param {
|
|
1190
|
-
* @
|
|
1116
|
+
* Performs a query on the collection using the specified parameters.
|
|
1117
|
+
*
|
|
1118
|
+
* @param {Object} params - The parameters for the query.
|
|
1119
|
+
* @param {Embedding | Embeddings} [params.queryEmbeddings] - Optional query embeddings to use for the search.
|
|
1120
|
+
* @param {PositiveInteger} [params.nResults] - Optional number of results to return (default is 10).
|
|
1121
|
+
* @param {Where} [params.where] - Optional query condition to filter results based on metadata values.
|
|
1122
|
+
* @param {string | string[]} [params.queryTexts] - Optional query text(s) to search for in the collection.
|
|
1123
|
+
* @param {WhereDocument} [params.whereDocument] - Optional query condition to filter results based on document content.
|
|
1124
|
+
* @param {IncludeEnum[]} [params.include] - Optional array of fields to include in the result, such as "metadata" and "document".
|
|
1125
|
+
*
|
|
1126
|
+
* @returns {Promise<QueryResponse>} A promise that resolves to the query results.
|
|
1127
|
+
* @throws {Error} If there is an issue executing the query.
|
|
1128
|
+
* @example
|
|
1129
|
+
* // Query the collection using embeddings
|
|
1130
|
+
* const results = await collection.query({
|
|
1131
|
+
* queryEmbeddings: [[0.1, 0.2, ...], ...],
|
|
1132
|
+
* nResults: 10,
|
|
1133
|
+
* where: {"name": {"$eq": "John Doe"}},
|
|
1134
|
+
* include: ["metadata", "document"]
|
|
1135
|
+
* });
|
|
1136
|
+
* @example
|
|
1137
|
+
* ```js
|
|
1138
|
+
* // Query the collection using query text
|
|
1139
|
+
* const results = await collection.query({
|
|
1140
|
+
* queryTexts: "some text",
|
|
1141
|
+
* nResults: 10,
|
|
1142
|
+
* where: {"name": {"$eq": "John Doe"}},
|
|
1143
|
+
* include: ["metadata", "document"]
|
|
1144
|
+
* });
|
|
1145
|
+
* ```
|
|
1146
|
+
*
|
|
1191
1147
|
*/
|
|
1192
|
-
|
|
1148
|
+
query({ nResults, where, whereDocument, include, queryTexts, queryEmbeddings, }: QueryRecordsParams): Promise<MultiQueryResponse>;
|
|
1193
1149
|
/**
|
|
1194
|
-
*
|
|
1195
|
-
* @param {
|
|
1196
|
-
* @param {
|
|
1197
|
-
* @param {
|
|
1198
|
-
* @
|
|
1150
|
+
* Modify the collection name or metadata
|
|
1151
|
+
* @param {Object} params - The parameters for the query.
|
|
1152
|
+
* @param {string} [params.name] - Optional new name for the collection.
|
|
1153
|
+
* @param {CollectionMetadata} [params.metadata] - Optional new metadata for the collection.
|
|
1154
|
+
* @returns {Promise<void>} - The response from the API.
|
|
1155
|
+
*
|
|
1156
|
+
* @example
|
|
1157
|
+
* ```typescript
|
|
1158
|
+
* const response = await client.updateCollection({
|
|
1159
|
+
* name: "new name",
|
|
1160
|
+
* metadata: { "key": "value" },
|
|
1161
|
+
* });
|
|
1162
|
+
* ```
|
|
1199
1163
|
*/
|
|
1200
|
-
|
|
1164
|
+
modify({ name, metadata, configuration, }: {
|
|
1165
|
+
name?: string;
|
|
1166
|
+
metadata?: CollectionMetadata;
|
|
1167
|
+
configuration?: UpdateCollectionConfiguration;
|
|
1168
|
+
}): Promise<CollectionParams>;
|
|
1201
1169
|
/**
|
|
1202
|
-
*
|
|
1203
|
-
* @param {
|
|
1204
|
-
* @param {
|
|
1205
|
-
* @
|
|
1206
|
-
* @
|
|
1207
|
-
*
|
|
1208
|
-
* @
|
|
1170
|
+
* Peek inside the collection
|
|
1171
|
+
* @param {Object} params - The parameters for the query.
|
|
1172
|
+
* @param {PositiveInteger} [params.limit] - Optional number of results to return (default is 10).
|
|
1173
|
+
* @returns {Promise<GetResponse>} A promise that resolves to the query results.
|
|
1174
|
+
* @throws {Error} If there is an issue executing the query.
|
|
1175
|
+
*
|
|
1176
|
+
* @example
|
|
1177
|
+
* ```typescript
|
|
1178
|
+
* const results = await collection.peek({
|
|
1179
|
+
* limit: 10
|
|
1180
|
+
* });
|
|
1181
|
+
* ```
|
|
1209
1182
|
*/
|
|
1210
|
-
|
|
1183
|
+
peek({ limit }?: PeekParams): Promise<MultiGetResponse>;
|
|
1211
1184
|
/**
|
|
1212
|
-
*
|
|
1213
|
-
* @param {
|
|
1214
|
-
* @
|
|
1185
|
+
* Deletes items from the collection.
|
|
1186
|
+
* @param {Object} params - The parameters for deleting items from the collection.
|
|
1187
|
+
* @param {ID | IDs} [params.ids] - Optional ID or array of IDs of items to delete.
|
|
1188
|
+
* @param {Where} [params.where] - Optional query condition to filter items to delete based on metadata values.
|
|
1189
|
+
* @param {WhereDocument} [params.whereDocument] - Optional query condition to filter items to delete based on document content.
|
|
1190
|
+
* @returns {Promise<string[]>} A promise that resolves to the IDs of the deleted items.
|
|
1191
|
+
* @throws {Error} If there is an issue deleting items from the collection.
|
|
1192
|
+
*
|
|
1193
|
+
* @example
|
|
1194
|
+
* ```typescript
|
|
1195
|
+
* const results = await collection.delete({
|
|
1196
|
+
* ids: "some_id",
|
|
1197
|
+
* where: {"name": {"$eq": "John Doe"}},
|
|
1198
|
+
* whereDocument: {"$contains":"search_string"}
|
|
1199
|
+
* });
|
|
1200
|
+
* ```
|
|
1215
1201
|
*/
|
|
1216
|
-
|
|
1202
|
+
delete({ ids, where, whereDocument, }?: DeleteParams): Promise<void>;
|
|
1217
1203
|
/**
|
|
1218
|
-
*
|
|
1219
|
-
*
|
|
1220
|
-
* @
|
|
1204
|
+
* Forks the collection into a new collection with a new name and configuration.
|
|
1205
|
+
*
|
|
1206
|
+
* @param {Object} params - The parameters for forking the collection.
|
|
1207
|
+
* @param {string} params.newName - The name for the new forked collection.
|
|
1208
|
+
*
|
|
1209
|
+
* @returns {Promise<Collection>} A promise that resolves to the new forked Collection object.
|
|
1210
|
+
* @throws {Error} If there is an issue forking the collection.
|
|
1211
|
+
*
|
|
1212
|
+
* @example
|
|
1213
|
+
* ```typescript
|
|
1214
|
+
* const newCollection = await collection.fork({
|
|
1215
|
+
* newName: "my_forked_collection",
|
|
1216
|
+
* });
|
|
1217
|
+
* ```
|
|
1221
1218
|
*/
|
|
1222
|
-
|
|
1219
|
+
fork({ newName }: ForkCollectionParams): Promise<Collection>;
|
|
1223
1220
|
}
|
|
1224
1221
|
|
|
1225
1222
|
declare class ChromaClient {
|
|
@@ -1328,7 +1325,7 @@ declare class ChromaClient {
|
|
|
1328
1325
|
* });
|
|
1329
1326
|
* ```
|
|
1330
1327
|
*/
|
|
1331
|
-
createCollection({ name, metadata, embeddingFunction, }: CreateCollectionParams): Promise<Collection>;
|
|
1328
|
+
createCollection({ name, metadata, embeddingFunction, configuration, }: CreateCollectionParams): Promise<Collection>;
|
|
1332
1329
|
/**
|
|
1333
1330
|
* Gets or creates a collection with the specified properties.
|
|
1334
1331
|
*
|
|
@@ -1350,7 +1347,7 @@ declare class ChromaClient {
|
|
|
1350
1347
|
* });
|
|
1351
1348
|
* ```
|
|
1352
1349
|
*/
|
|
1353
|
-
getOrCreateCollection({ name, metadata, embeddingFunction, }: GetOrCreateCollectionParams): Promise<Collection>;
|
|
1350
|
+
getOrCreateCollection({ name, metadata, embeddingFunction, configuration, }: GetOrCreateCollectionParams): Promise<Collection>;
|
|
1354
1351
|
/**
|
|
1355
1352
|
* Get all collection names.
|
|
1356
1353
|
*
|
|
@@ -1644,12 +1641,23 @@ declare class CohereEmbeddingFunction implements IEmbeddingFunction {
|
|
|
1644
1641
|
name: string;
|
|
1645
1642
|
private cohereAiApi?;
|
|
1646
1643
|
private model;
|
|
1644
|
+
private isImage;
|
|
1647
1645
|
private apiKey;
|
|
1648
1646
|
private apiKeyEnvVar;
|
|
1649
|
-
constructor({ cohere_api_key, model, cohere_api_key_env_var,
|
|
1647
|
+
constructor({ cohere_api_key, model, cohere_api_key_env_var,
|
|
1648
|
+
/**
|
|
1649
|
+
* If true, the input texts passed to `generate` are expected to be
|
|
1650
|
+
* base64 encoded PNG data URIs.
|
|
1651
|
+
*/
|
|
1652
|
+
isImage, }: {
|
|
1650
1653
|
cohere_api_key?: string;
|
|
1651
1654
|
model?: string;
|
|
1652
1655
|
cohere_api_key_env_var: string;
|
|
1656
|
+
/**
|
|
1657
|
+
* If true, the input texts passed to `generate` are expected to be
|
|
1658
|
+
* base64 encoded PNG data URIs.
|
|
1659
|
+
*/
|
|
1660
|
+
isImage?: boolean;
|
|
1653
1661
|
});
|
|
1654
1662
|
private initCohereClient;
|
|
1655
1663
|
generate(texts: string[]): Promise<number[][]>;
|
|
@@ -1749,6 +1757,12 @@ declare class HuggingFaceEmbeddingServerFunction implements IEmbeddingFunction {
|
|
|
1749
1757
|
type StoredConfig$4 = {
|
|
1750
1758
|
api_key_env_var: string;
|
|
1751
1759
|
model_name: string;
|
|
1760
|
+
task?: string;
|
|
1761
|
+
late_chunking?: boolean;
|
|
1762
|
+
truncate?: boolean;
|
|
1763
|
+
dimensions?: number;
|
|
1764
|
+
embedding_type?: string;
|
|
1765
|
+
normalized?: boolean;
|
|
1752
1766
|
};
|
|
1753
1767
|
declare class JinaEmbeddingFunction implements IEmbeddingFunction {
|
|
1754
1768
|
name: string;
|
|
@@ -1756,10 +1770,22 @@ declare class JinaEmbeddingFunction implements IEmbeddingFunction {
|
|
|
1756
1770
|
private model_name;
|
|
1757
1771
|
private api_url;
|
|
1758
1772
|
private headers;
|
|
1759
|
-
|
|
1773
|
+
private task;
|
|
1774
|
+
private late_chunking;
|
|
1775
|
+
private truncate;
|
|
1776
|
+
private dimensions;
|
|
1777
|
+
private embedding_type;
|
|
1778
|
+
private normalized;
|
|
1779
|
+
constructor({ jinaai_api_key, model_name, api_key_env_var, task, late_chunking, truncate, dimensions, embedding_type, normalized, }: {
|
|
1760
1780
|
jinaai_api_key?: string;
|
|
1761
1781
|
model_name?: string;
|
|
1762
1782
|
api_key_env_var: string;
|
|
1783
|
+
task?: string;
|
|
1784
|
+
late_chunking?: boolean;
|
|
1785
|
+
truncate?: boolean;
|
|
1786
|
+
dimensions?: number;
|
|
1787
|
+
embedding_type?: string;
|
|
1788
|
+
normalized?: boolean;
|
|
1763
1789
|
});
|
|
1764
1790
|
generate(texts: string[]): Promise<any[]>;
|
|
1765
1791
|
buildFromConfig(config: StoredConfig$4): JinaEmbeddingFunction;
|