chromadb 2.2.1 → 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 +626 -515
- package/dist/chromadb.legacy-esm.js +446 -31
- package/dist/chromadb.mjs +446 -31
- package/dist/chromadb.mjs.map +1 -1
- package/dist/cjs/chromadb.cjs +446 -31
- package/dist/cjs/chromadb.cjs.map +1 -1
- package/dist/cjs/chromadb.d.cts +626 -515
- package/dist/cjs/cli.cjs +5 -5
- package/dist/cjs/cli.cjs.map +1 -1
- package/dist/cli.mjs +5 -5
- package/dist/cli.mjs.map +1 -1
- package/package.json +2 -2
- package/src/bindings.ts +18 -16
- package/src/browser-entry.js +2 -3
- package/src/cli.ts +19 -22
- package/src/index.ts +1 -1
- package/src/punycode-shim.js +2 -2
package/dist/chromadb.d.ts
CHANGED
|
@@ -32,388 +32,6 @@ 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
|
-
Uris = "uris"
|
|
41
|
-
}
|
|
42
|
-
type Embedding = number[];
|
|
43
|
-
type Embeddings = Embedding[];
|
|
44
|
-
type Metadata = Record<string, string | number | boolean>;
|
|
45
|
-
type Metadatas = Metadata[];
|
|
46
|
-
type Document = string;
|
|
47
|
-
type Documents = Document[];
|
|
48
|
-
type ID = string;
|
|
49
|
-
type IDs = ID[];
|
|
50
|
-
type PositiveInteger = number;
|
|
51
|
-
type LiteralValue = string | number | boolean;
|
|
52
|
-
type ListLiteralValue = LiteralValue[];
|
|
53
|
-
type LiteralNumber = number;
|
|
54
|
-
type LogicalOperator = "$and" | "$or";
|
|
55
|
-
type InclusionOperator = "$in" | "$nin";
|
|
56
|
-
type WhereOperator = "$gt" | "$gte" | "$lt" | "$lte" | "$ne" | "$eq";
|
|
57
|
-
type OperatorExpression = {
|
|
58
|
-
[key in WhereOperator | InclusionOperator | LogicalOperator]?: LiteralValue | ListLiteralValue;
|
|
59
|
-
};
|
|
60
|
-
type BaseWhere = {
|
|
61
|
-
[key: string]: LiteralValue | OperatorExpression;
|
|
62
|
-
};
|
|
63
|
-
type LogicalWhere = {
|
|
64
|
-
[key in LogicalOperator]?: Where[];
|
|
65
|
-
};
|
|
66
|
-
type Where = BaseWhere | LogicalWhere;
|
|
67
|
-
type WhereDocumentOperator = "$contains" | "$not_contains" | LogicalOperator;
|
|
68
|
-
type WhereDocument = {
|
|
69
|
-
[key in WhereDocumentOperator]?: LiteralValue | LiteralNumber | WhereDocument[];
|
|
70
|
-
};
|
|
71
|
-
type MultiGetResponse = {
|
|
72
|
-
ids: IDs;
|
|
73
|
-
embeddings: Embeddings | null;
|
|
74
|
-
documents: (Document | null)[];
|
|
75
|
-
metadatas: (Metadata | null)[];
|
|
76
|
-
included: IncludeEnum[];
|
|
77
|
-
};
|
|
78
|
-
type GetResponse = MultiGetResponse;
|
|
79
|
-
type SingleQueryResponse = {
|
|
80
|
-
ids: IDs;
|
|
81
|
-
embeddings: Embeddings | null;
|
|
82
|
-
documents: (Document | null)[];
|
|
83
|
-
metadatas: (Metadata | null)[];
|
|
84
|
-
distances: number[] | null;
|
|
85
|
-
included: IncludeEnum[];
|
|
86
|
-
};
|
|
87
|
-
type MultiQueryResponse = {
|
|
88
|
-
ids: IDs[];
|
|
89
|
-
embeddings: Embeddings[] | null;
|
|
90
|
-
documents: (Document | null)[][];
|
|
91
|
-
metadatas: (Metadata | null)[][];
|
|
92
|
-
distances: number[][] | null;
|
|
93
|
-
included: IncludeEnum[];
|
|
94
|
-
};
|
|
95
|
-
type QueryResponse = SingleQueryResponse | MultiQueryResponse;
|
|
96
|
-
interface CollectionParams {
|
|
97
|
-
name: string;
|
|
98
|
-
id: string;
|
|
99
|
-
metadata: CollectionMetadata | undefined;
|
|
100
|
-
embeddingFunction: IEmbeddingFunction;
|
|
101
|
-
}
|
|
102
|
-
type CollectionMetadata = Record<string, boolean | number | string>;
|
|
103
|
-
type ConfigOptions = {
|
|
104
|
-
options?: RequestInit;
|
|
105
|
-
};
|
|
106
|
-
type BaseGetParams = {
|
|
107
|
-
ids?: ID | IDs;
|
|
108
|
-
where?: Where;
|
|
109
|
-
limit?: PositiveInteger;
|
|
110
|
-
offset?: PositiveInteger;
|
|
111
|
-
include?: IncludeEnum[];
|
|
112
|
-
whereDocument?: WhereDocument;
|
|
113
|
-
};
|
|
114
|
-
type SingleGetParams = BaseGetParams & {
|
|
115
|
-
ids: ID;
|
|
116
|
-
};
|
|
117
|
-
type MultiGetParams = BaseGetParams & {
|
|
118
|
-
ids?: IDs;
|
|
119
|
-
};
|
|
120
|
-
type GetParams = SingleGetParams | MultiGetParams;
|
|
121
|
-
type ListCollectionsParams = {
|
|
122
|
-
limit?: PositiveInteger;
|
|
123
|
-
offset?: PositiveInteger;
|
|
124
|
-
};
|
|
125
|
-
type ChromaClientParams = {
|
|
126
|
-
path?: string;
|
|
127
|
-
fetchOptions?: RequestInit;
|
|
128
|
-
auth?: AuthOptions;
|
|
129
|
-
tenant?: string;
|
|
130
|
-
database?: string;
|
|
131
|
-
};
|
|
132
|
-
type CreateCollectionParams = {
|
|
133
|
-
name: string;
|
|
134
|
-
metadata?: CollectionMetadata;
|
|
135
|
-
embeddingFunction?: IEmbeddingFunction;
|
|
136
|
-
};
|
|
137
|
-
type GetOrCreateCollectionParams = CreateCollectionParams;
|
|
138
|
-
type GetCollectionParams = {
|
|
139
|
-
name: string;
|
|
140
|
-
embeddingFunction: IEmbeddingFunction;
|
|
141
|
-
};
|
|
142
|
-
type DeleteCollectionParams = {
|
|
143
|
-
name: string;
|
|
144
|
-
};
|
|
145
|
-
type BaseRecordOperationParams = {
|
|
146
|
-
ids: ID | IDs;
|
|
147
|
-
embeddings?: Embedding | Embeddings;
|
|
148
|
-
metadatas?: Metadata | Metadatas;
|
|
149
|
-
documents?: Document | Documents;
|
|
150
|
-
};
|
|
151
|
-
type SingleRecordOperationParams = BaseRecordOperationParams & {
|
|
152
|
-
ids: ID;
|
|
153
|
-
embeddings?: Embedding;
|
|
154
|
-
metadatas?: Metadata;
|
|
155
|
-
documents?: Document;
|
|
156
|
-
};
|
|
157
|
-
type SingleEmbeddingRecordOperationParams = SingleRecordOperationParams & {
|
|
158
|
-
embeddings: Embedding;
|
|
159
|
-
};
|
|
160
|
-
type SingleContentRecordOperationParams = SingleRecordOperationParams & {
|
|
161
|
-
documents: Document;
|
|
162
|
-
};
|
|
163
|
-
type SingleAddRecordOperationParams = SingleEmbeddingRecordOperationParams | SingleContentRecordOperationParams;
|
|
164
|
-
type MultiRecordOperationParams = BaseRecordOperationParams & {
|
|
165
|
-
ids: IDs;
|
|
166
|
-
embeddings?: Embeddings;
|
|
167
|
-
metadatas?: Metadatas;
|
|
168
|
-
documents?: Documents;
|
|
169
|
-
};
|
|
170
|
-
type MultiEmbeddingRecordOperationParams = MultiRecordOperationParams & {
|
|
171
|
-
embeddings: Embeddings;
|
|
172
|
-
};
|
|
173
|
-
type MultiContentRecordOperationParams = MultiRecordOperationParams & {
|
|
174
|
-
documents: Documents;
|
|
175
|
-
};
|
|
176
|
-
type MultiAddRecordsOperationParams = MultiEmbeddingRecordOperationParams | MultiContentRecordOperationParams;
|
|
177
|
-
type AddRecordsParams = SingleAddRecordOperationParams | MultiAddRecordsOperationParams;
|
|
178
|
-
type UpsertRecordsParams = AddRecordsParams;
|
|
179
|
-
type UpdateRecordsParams = MultiRecordOperationParams | SingleRecordOperationParams;
|
|
180
|
-
type ModifyCollectionParams = {
|
|
181
|
-
name?: string;
|
|
182
|
-
metadata?: CollectionMetadata;
|
|
183
|
-
};
|
|
184
|
-
type BaseQueryParams = {
|
|
185
|
-
nResults?: PositiveInteger;
|
|
186
|
-
where?: Where;
|
|
187
|
-
queryTexts?: string | string[];
|
|
188
|
-
queryEmbeddings?: Embedding | Embeddings;
|
|
189
|
-
whereDocument?: WhereDocument;
|
|
190
|
-
include?: IncludeEnum[];
|
|
191
|
-
};
|
|
192
|
-
type SingleTextQueryParams = BaseQueryParams & {
|
|
193
|
-
queryTexts: string;
|
|
194
|
-
queryEmbeddings?: never;
|
|
195
|
-
};
|
|
196
|
-
type SingleEmbeddingQueryParams = BaseQueryParams & {
|
|
197
|
-
queryTexts?: never;
|
|
198
|
-
queryEmbeddings: Embedding;
|
|
199
|
-
};
|
|
200
|
-
type MultiTextQueryParams = BaseQueryParams & {
|
|
201
|
-
queryTexts: string[];
|
|
202
|
-
queryEmbeddings?: never;
|
|
203
|
-
};
|
|
204
|
-
type MultiEmbeddingQueryParams = BaseQueryParams & {
|
|
205
|
-
queryTexts?: never;
|
|
206
|
-
queryEmbeddings: Embeddings;
|
|
207
|
-
};
|
|
208
|
-
type QueryRecordsParams = SingleTextQueryParams | SingleEmbeddingQueryParams | MultiTextQueryParams | MultiEmbeddingQueryParams;
|
|
209
|
-
type PeekParams = {
|
|
210
|
-
limit?: PositiveInteger;
|
|
211
|
-
};
|
|
212
|
-
type DeleteParams = {
|
|
213
|
-
ids?: ID | IDs;
|
|
214
|
-
where?: Where;
|
|
215
|
-
whereDocument?: WhereDocument;
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
declare class Collection {
|
|
219
|
-
name: string;
|
|
220
|
-
id: string;
|
|
221
|
-
metadata: CollectionMetadata | undefined;
|
|
222
|
-
/**
|
|
223
|
-
* @ignore
|
|
224
|
-
*/
|
|
225
|
-
private client;
|
|
226
|
-
/**
|
|
227
|
-
* @ignore
|
|
228
|
-
*/
|
|
229
|
-
embeddingFunction: IEmbeddingFunction;
|
|
230
|
-
/**
|
|
231
|
-
* @ignore
|
|
232
|
-
*/
|
|
233
|
-
constructor(name: string, id: string, client: ChromaClient, embeddingFunction: IEmbeddingFunction, metadata?: CollectionMetadata);
|
|
234
|
-
/**
|
|
235
|
-
* Add items to the collection
|
|
236
|
-
* @param {Object} params - The parameters for the query.
|
|
237
|
-
* @param {ID | IDs} [params.ids] - IDs of the items to add.
|
|
238
|
-
* @param {Embedding | Embeddings} [params.embeddings] - Optional embeddings of the items to add.
|
|
239
|
-
* @param {Metadata | Metadatas} [params.metadatas] - Optional metadata of the items to add.
|
|
240
|
-
* @param {Document | Documents} [params.documents] - Optional documents of the items to add.
|
|
241
|
-
* @returns {Promise<AddResponse>} - The response from the API. True if successful.
|
|
242
|
-
*
|
|
243
|
-
* @example
|
|
244
|
-
* ```typescript
|
|
245
|
-
* const response = await collection.add({
|
|
246
|
-
* ids: ["id1", "id2"],
|
|
247
|
-
* embeddings: [[1, 2, 3], [4, 5, 6]],
|
|
248
|
-
* metadatas: [{ "key": "value" }, { "key": "value" }],
|
|
249
|
-
* documents: ["document1", "document2"]
|
|
250
|
-
* });
|
|
251
|
-
* ```
|
|
252
|
-
*/
|
|
253
|
-
add(params: AddRecordsParams): Promise<void>;
|
|
254
|
-
/**
|
|
255
|
-
* Upsert items to the collection
|
|
256
|
-
* @param {Object} params - The parameters for the query.
|
|
257
|
-
* @param {ID | IDs} [params.ids] - IDs of the items to add.
|
|
258
|
-
* @param {Embedding | Embeddings} [params.embeddings] - Optional embeddings of the items to add.
|
|
259
|
-
* @param {Metadata | Metadatas} [params.metadatas] - Optional metadata of the items to add.
|
|
260
|
-
* @param {Document | Documents} [params.documents] - Optional documents of the items to add.
|
|
261
|
-
* @returns {Promise<void>}
|
|
262
|
-
*
|
|
263
|
-
* @example
|
|
264
|
-
* ```typescript
|
|
265
|
-
* const response = await collection.upsert({
|
|
266
|
-
* ids: ["id1", "id2"],
|
|
267
|
-
* embeddings: [[1, 2, 3], [4, 5, 6]],
|
|
268
|
-
* metadatas: [{ "key": "value" }, { "key": "value" }],
|
|
269
|
-
* documents: ["document1", "document2"],
|
|
270
|
-
* });
|
|
271
|
-
* ```
|
|
272
|
-
*/
|
|
273
|
-
upsert(params: UpsertRecordsParams): Promise<void>;
|
|
274
|
-
/**
|
|
275
|
-
* Count the number of items in the collection
|
|
276
|
-
* @returns {Promise<number>} - The number of items in the collection.
|
|
277
|
-
*
|
|
278
|
-
* @example
|
|
279
|
-
* ```typescript
|
|
280
|
-
* const count = await collection.count();
|
|
281
|
-
* ```
|
|
282
|
-
*/
|
|
283
|
-
count(): Promise<number>;
|
|
284
|
-
/**
|
|
285
|
-
* Get items from the collection
|
|
286
|
-
* @param {Object} params - The parameters for the query.
|
|
287
|
-
* @param {ID | IDs} [params.ids] - Optional IDs of the items to get.
|
|
288
|
-
* @param {Where} [params.where] - Optional where clause to filter items by.
|
|
289
|
-
* @param {PositiveInteger} [params.limit] - Optional limit on the number of items to get.
|
|
290
|
-
* @param {PositiveInteger} [params.offset] - Optional offset on the items to get.
|
|
291
|
-
* @param {IncludeEnum[]} [params.include] - Optional list of items to include in the response.
|
|
292
|
-
* @param {WhereDocument} [params.whereDocument] - Optional where clause to filter items by.
|
|
293
|
-
* @returns {Promise<GetResponse>} - The response from the server.
|
|
294
|
-
*
|
|
295
|
-
* @example
|
|
296
|
-
* ```typescript
|
|
297
|
-
* const response = await collection.get({
|
|
298
|
-
* ids: ["id1", "id2"],
|
|
299
|
-
* where: { "key": "value" },
|
|
300
|
-
* limit: 10,
|
|
301
|
-
* offset: 0,
|
|
302
|
-
* include: ["embeddings", "metadatas", "documents"],
|
|
303
|
-
* whereDocument: { "$contains": "value" },
|
|
304
|
-
* });
|
|
305
|
-
* ```
|
|
306
|
-
*/
|
|
307
|
-
get({ ids, where, limit, offset, include, whereDocument, }?: BaseGetParams): Promise<GetResponse>;
|
|
308
|
-
/**
|
|
309
|
-
* Update items in the collection
|
|
310
|
-
* @param {Object} params - The parameters for the query.
|
|
311
|
-
* @param {ID | IDs} [params.ids] - IDs of the items to add.
|
|
312
|
-
* @param {Embedding | Embeddings} [params.embeddings] - Optional embeddings of the items to add.
|
|
313
|
-
* @param {Metadata | Metadatas} [params.metadatas] - Optional metadata of the items to add.
|
|
314
|
-
* @param {Document | Documents} [params.documents] - Optional documents of the items to add.
|
|
315
|
-
* @returns {Promise<void>}
|
|
316
|
-
*
|
|
317
|
-
* @example
|
|
318
|
-
* ```typescript
|
|
319
|
-
* const response = await collection.update({
|
|
320
|
-
* ids: ["id1", "id2"],
|
|
321
|
-
* embeddings: [[1, 2, 3], [4, 5, 6]],
|
|
322
|
-
* metadatas: [{ "key": "value" }, { "key": "value" }],
|
|
323
|
-
* documents: ["document1", "document2"],
|
|
324
|
-
* });
|
|
325
|
-
* ```
|
|
326
|
-
*/
|
|
327
|
-
update(params: UpdateRecordsParams): Promise<void>;
|
|
328
|
-
/**
|
|
329
|
-
* Performs a query on the collection using the specified parameters.
|
|
330
|
-
*
|
|
331
|
-
* @param {Object} params - The parameters for the query.
|
|
332
|
-
* @param {Embedding | Embeddings} [params.queryEmbeddings] - Optional query embeddings to use for the search.
|
|
333
|
-
* @param {PositiveInteger} [params.nResults] - Optional number of results to return (default is 10).
|
|
334
|
-
* @param {Where} [params.where] - Optional query condition to filter results based on metadata values.
|
|
335
|
-
* @param {string | string[]} [params.queryTexts] - Optional query text(s) to search for in the collection.
|
|
336
|
-
* @param {WhereDocument} [params.whereDocument] - Optional query condition to filter results based on document content.
|
|
337
|
-
* @param {IncludeEnum[]} [params.include] - Optional array of fields to include in the result, such as "metadata" and "document".
|
|
338
|
-
*
|
|
339
|
-
* @returns {Promise<QueryResponse>} A promise that resolves to the query results.
|
|
340
|
-
* @throws {Error} If there is an issue executing the query.
|
|
341
|
-
* @example
|
|
342
|
-
* // Query the collection using embeddings
|
|
343
|
-
* const results = await collection.query({
|
|
344
|
-
* queryEmbeddings: [[0.1, 0.2, ...], ...],
|
|
345
|
-
* nResults: 10,
|
|
346
|
-
* where: {"name": {"$eq": "John Doe"}},
|
|
347
|
-
* include: ["metadata", "document"]
|
|
348
|
-
* });
|
|
349
|
-
* @example
|
|
350
|
-
* ```js
|
|
351
|
-
* // Query the collection using query text
|
|
352
|
-
* const results = await collection.query({
|
|
353
|
-
* queryTexts: "some text",
|
|
354
|
-
* nResults: 10,
|
|
355
|
-
* where: {"name": {"$eq": "John Doe"}},
|
|
356
|
-
* include: ["metadata", "document"]
|
|
357
|
-
* });
|
|
358
|
-
* ```
|
|
359
|
-
*
|
|
360
|
-
*/
|
|
361
|
-
query({ nResults, where, whereDocument, include, queryTexts, queryEmbeddings, }: QueryRecordsParams): Promise<MultiQueryResponse>;
|
|
362
|
-
/**
|
|
363
|
-
* Modify the collection name or metadata
|
|
364
|
-
* @param {Object} params - The parameters for the query.
|
|
365
|
-
* @param {string} [params.name] - Optional new name for the collection.
|
|
366
|
-
* @param {CollectionMetadata} [params.metadata] - Optional new metadata for the collection.
|
|
367
|
-
* @returns {Promise<void>} - The response from the API.
|
|
368
|
-
*
|
|
369
|
-
* @example
|
|
370
|
-
* ```typescript
|
|
371
|
-
* const response = await client.updateCollection({
|
|
372
|
-
* name: "new name",
|
|
373
|
-
* metadata: { "key": "value" },
|
|
374
|
-
* });
|
|
375
|
-
* ```
|
|
376
|
-
*/
|
|
377
|
-
modify({ name, metadata, }: {
|
|
378
|
-
name?: string;
|
|
379
|
-
metadata?: CollectionMetadata;
|
|
380
|
-
}): Promise<CollectionParams>;
|
|
381
|
-
/**
|
|
382
|
-
* Peek inside the collection
|
|
383
|
-
* @param {Object} params - The parameters for the query.
|
|
384
|
-
* @param {PositiveInteger} [params.limit] - Optional number of results to return (default is 10).
|
|
385
|
-
* @returns {Promise<GetResponse>} A promise that resolves to the query results.
|
|
386
|
-
* @throws {Error} If there is an issue executing the query.
|
|
387
|
-
*
|
|
388
|
-
* @example
|
|
389
|
-
* ```typescript
|
|
390
|
-
* const results = await collection.peek({
|
|
391
|
-
* limit: 10
|
|
392
|
-
* });
|
|
393
|
-
* ```
|
|
394
|
-
*/
|
|
395
|
-
peek({ limit }?: PeekParams): Promise<MultiGetResponse>;
|
|
396
|
-
/**
|
|
397
|
-
* Deletes items from the collection.
|
|
398
|
-
* @param {Object} params - The parameters for deleting items from the collection.
|
|
399
|
-
* @param {ID | IDs} [params.ids] - Optional ID or array of IDs of items to delete.
|
|
400
|
-
* @param {Where} [params.where] - Optional query condition to filter items to delete based on metadata values.
|
|
401
|
-
* @param {WhereDocument} [params.whereDocument] - Optional query condition to filter items to delete based on document content.
|
|
402
|
-
* @returns {Promise<string[]>} A promise that resolves to the IDs of the deleted items.
|
|
403
|
-
* @throws {Error} If there is an issue deleting items from the collection.
|
|
404
|
-
*
|
|
405
|
-
* @example
|
|
406
|
-
* ```typescript
|
|
407
|
-
* const results = await collection.delete({
|
|
408
|
-
* ids: "some_id",
|
|
409
|
-
* where: {"name": {"$eq": "John Doe"}},
|
|
410
|
-
* whereDocument: {"$contains":"search_string"}
|
|
411
|
-
* });
|
|
412
|
-
* ```
|
|
413
|
-
*/
|
|
414
|
-
delete({ ids, where, whereDocument, }?: DeleteParams): Promise<void>;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
35
|
/**
|
|
418
36
|
* chroma-frontend
|
|
419
37
|
*
|
|
@@ -533,6 +151,7 @@ declare namespace Api {
|
|
|
533
151
|
max_batch_size: number;
|
|
534
152
|
}
|
|
535
153
|
interface Collection {
|
|
154
|
+
configuration_json: Api.CollectionConfiguration;
|
|
536
155
|
database: string;
|
|
537
156
|
/**
|
|
538
157
|
* @type {number | null}
|
|
@@ -635,6 +254,9 @@ declare namespace Api {
|
|
|
635
254
|
error: string;
|
|
636
255
|
message: string;
|
|
637
256
|
}
|
|
257
|
+
interface ForkCollectionPayload {
|
|
258
|
+
new_name: string;
|
|
259
|
+
}
|
|
638
260
|
interface GetRequestPayload extends Api.RawWhereFields {
|
|
639
261
|
ids?: string[] | null;
|
|
640
262
|
include?: Api.Include[];
|
|
@@ -678,12 +300,6 @@ declare namespace Api {
|
|
|
678
300
|
"nanosecond heartbeat": number;
|
|
679
301
|
}
|
|
680
302
|
interface HnswConfiguration {
|
|
681
|
-
/**
|
|
682
|
-
* @type {number}
|
|
683
|
-
* @memberof HnswConfiguration
|
|
684
|
-
* minimum: 0
|
|
685
|
-
*/
|
|
686
|
-
batch_size?: number;
|
|
687
303
|
/**
|
|
688
304
|
* @type {number}
|
|
689
305
|
* @memberof HnswConfiguration
|
|
@@ -702,12 +318,6 @@ declare namespace Api {
|
|
|
702
318
|
* minimum: 0
|
|
703
319
|
*/
|
|
704
320
|
max_neighbors?: number;
|
|
705
|
-
/**
|
|
706
|
-
* @type {number}
|
|
707
|
-
* @memberof HnswConfiguration
|
|
708
|
-
* minimum: 0
|
|
709
|
-
*/
|
|
710
|
-
num_threads?: number;
|
|
711
321
|
/**
|
|
712
322
|
* @type {number}
|
|
713
323
|
* @memberof HnswConfiguration
|
|
@@ -765,32 +375,50 @@ declare namespace Api {
|
|
|
765
375
|
* @memberof SpannConfiguration
|
|
766
376
|
* minimum: 0
|
|
767
377
|
*/
|
|
768
|
-
|
|
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;
|
|
769
397
|
/**
|
|
770
398
|
* @type {number}
|
|
771
399
|
* @memberof SpannConfiguration
|
|
772
400
|
* minimum: 0
|
|
773
401
|
*/
|
|
774
|
-
|
|
402
|
+
reassign_neighbor_count?: number;
|
|
775
403
|
/**
|
|
776
404
|
* @type {number}
|
|
777
405
|
* @memberof SpannConfiguration
|
|
778
406
|
* minimum: 0
|
|
779
407
|
*/
|
|
780
|
-
|
|
408
|
+
search_nprobe?: number;
|
|
409
|
+
space?: Api.HnswSpace;
|
|
781
410
|
/**
|
|
782
411
|
* @type {number}
|
|
783
412
|
* @memberof SpannConfiguration
|
|
784
413
|
* minimum: 0
|
|
785
414
|
*/
|
|
786
|
-
|
|
787
|
-
space: Api.HnswSpace;
|
|
415
|
+
split_threshold?: number;
|
|
788
416
|
/**
|
|
789
417
|
* @type {number}
|
|
790
418
|
* @memberof SpannConfiguration
|
|
791
419
|
* minimum: 0
|
|
792
420
|
*/
|
|
793
|
-
write_nprobe
|
|
421
|
+
write_nprobe?: number;
|
|
794
422
|
}
|
|
795
423
|
interface UpdateCollectionConfiguration {
|
|
796
424
|
embedding_function?: Api.EmbeddingFunctionConfiguration | null;
|
|
@@ -866,6 +494,7 @@ declare namespace Api {
|
|
|
866
494
|
interface UpsertCollectionRecordsResponse {
|
|
867
495
|
}
|
|
868
496
|
interface Vec2 {
|
|
497
|
+
configuration_json: Api.CollectionConfiguration;
|
|
869
498
|
database: string;
|
|
870
499
|
/**
|
|
871
500
|
* @type {number | null}
|
|
@@ -953,177 +582,641 @@ declare class ApiApi extends BaseAPI {
|
|
|
953
582
|
* @param {RequestInit} [options] Override http request option.
|
|
954
583
|
* @throws {RequiredError}
|
|
955
584
|
*/
|
|
956
|
-
collectionGet(tenant: string, database: string, collectionId: string, request: Api.GetRequestPayload, options?: RequestInit): Promise<Api.GetResponse>;
|
|
585
|
+
collectionGet(tenant: string, database: string, collectionId: string, request: Api.GetRequestPayload, options?: RequestInit): Promise<Api.GetResponse>;
|
|
586
|
+
/**
|
|
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
|
|
594
|
+
* @param {RequestInit} [options] Override http request option.
|
|
595
|
+
* @throws {RequiredError}
|
|
596
|
+
*/
|
|
597
|
+
collectionQuery(tenant: string, database: string, collectionId: string, limit: number | undefined, offset: number | undefined, request: Api.QueryRequestPayload, options?: RequestInit): Promise<Api.QueryResponse>;
|
|
598
|
+
/**
|
|
599
|
+
* @summary Updates records in a collection by ID.
|
|
600
|
+
* @param {string} tenant
|
|
601
|
+
* @param {string} database
|
|
602
|
+
* @param {string} collectionId
|
|
603
|
+
* @param {Api.UpdateCollectionRecordsPayload} request
|
|
604
|
+
* @param {RequestInit} [options] Override http request option.
|
|
605
|
+
* @throws {RequiredError}
|
|
606
|
+
*/
|
|
607
|
+
collectionUpdate(tenant: string, database: string, collectionId: string, request: Api.UpdateCollectionRecordsPayload, options?: RequestInit): Promise<Api.UpdateCollectionRecordsResponse>;
|
|
608
|
+
/**
|
|
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
|
|
614
|
+
* @param {RequestInit} [options] Override http request option.
|
|
615
|
+
* @throws {RequiredError}
|
|
616
|
+
*/
|
|
617
|
+
collectionUpsert(tenant: string, database: string, collectionId: string, request: Api.UpsertCollectionRecordsPayload, options?: RequestInit): Promise<Api.UpsertCollectionRecordsResponse>;
|
|
618
|
+
/**
|
|
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>
|
|
622
|
+
* @param {RequestInit} [options] Override http request option.
|
|
623
|
+
* @throws {RequiredError}
|
|
624
|
+
*/
|
|
625
|
+
countCollections(tenant: string, database: string, options?: RequestInit): Promise<number>;
|
|
626
|
+
/**
|
|
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
|
|
631
|
+
* @param {RequestInit} [options] Override http request option.
|
|
632
|
+
* @throws {RequiredError}
|
|
633
|
+
*/
|
|
634
|
+
createCollection(tenant: string, database: string, request: Api.CreateCollectionPayload, options?: RequestInit): Promise<Api.Collection>;
|
|
635
|
+
/**
|
|
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
|
|
639
|
+
* @param {RequestInit} [options] Override http request option.
|
|
640
|
+
* @throws {RequiredError}
|
|
641
|
+
*/
|
|
642
|
+
createDatabase(tenant: string, request: Api.CreateDatabasePayload, options?: RequestInit): Promise<Api.CreateDatabaseResponse>;
|
|
643
|
+
/**
|
|
644
|
+
* @summary Creates a new tenant.
|
|
645
|
+
* @param {Api.CreateTenantPayload} request
|
|
646
|
+
* @param {RequestInit} [options] Override http request option.
|
|
647
|
+
* @throws {RequiredError}
|
|
648
|
+
*/
|
|
649
|
+
createTenant(request: Api.CreateTenantPayload, options?: RequestInit): Promise<Api.CreateTenantResponse>;
|
|
650
|
+
/**
|
|
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>
|
|
655
|
+
* @param {RequestInit} [options] Override http request option.
|
|
656
|
+
* @throws {RequiredError}
|
|
657
|
+
*/
|
|
658
|
+
deleteCollection(tenant: string, database: string, collectionId: string, options?: RequestInit): Promise<Api.UpdateCollectionResponse>;
|
|
659
|
+
/**
|
|
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>
|
|
663
|
+
* @param {RequestInit} [options] Override http request option.
|
|
664
|
+
* @throws {RequiredError}
|
|
665
|
+
*/
|
|
666
|
+
deleteDatabase(tenant: string, database: string, options?: RequestInit): Promise<Api.DeleteDatabaseResponse>;
|
|
667
|
+
/**
|
|
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
|
|
673
|
+
* @param {RequestInit} [options] Override http request option.
|
|
674
|
+
* @throws {RequiredError}
|
|
675
|
+
*/
|
|
676
|
+
forkCollection(tenant: string, database: string, collectionId: string, request: Api.ForkCollectionPayload, options?: RequestInit): Promise<Api.Collection>;
|
|
677
|
+
/**
|
|
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>
|
|
682
|
+
* @param {RequestInit} [options] Override http request option.
|
|
683
|
+
* @throws {RequiredError}
|
|
684
|
+
*/
|
|
685
|
+
getCollection(tenant: string, database: string, collectionId: string, options?: RequestInit): Promise<Api.Collection>;
|
|
686
|
+
/**
|
|
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>
|
|
690
|
+
* @param {RequestInit} [options] Override http request option.
|
|
691
|
+
* @throws {RequiredError}
|
|
692
|
+
*/
|
|
693
|
+
getDatabase(tenant: string, database: string, options?: RequestInit): Promise<Api.Database>;
|
|
694
|
+
/**
|
|
695
|
+
* @summary Returns an existing tenant by name.
|
|
696
|
+
* @param {string} tenantName <p>Tenant name or ID to retrieve</p>
|
|
697
|
+
* @param {RequestInit} [options] Override http request option.
|
|
698
|
+
* @throws {RequiredError}
|
|
699
|
+
*/
|
|
700
|
+
getTenant(tenantName: string, options?: RequestInit): Promise<Api.GetTenantResponse>;
|
|
701
|
+
/**
|
|
702
|
+
* @summary Retrieves the current user's identity, tenant, and databases.
|
|
703
|
+
* @param {RequestInit} [options] Override http request option.
|
|
704
|
+
* @throws {RequiredError}
|
|
705
|
+
*/
|
|
706
|
+
getUserIdentity(options?: RequestInit): Promise<Api.GetUserIdentityResponse>;
|
|
957
707
|
/**
|
|
958
|
-
* @summary
|
|
959
|
-
* @param {string} tenant <p>Tenant ID</p>
|
|
960
|
-
* @param {string} database <p>Database name containing the collection</p>
|
|
961
|
-
* @param {string} collectionId <p>Collection ID to query</p>
|
|
962
|
-
* @param {number} [limit] <p>Limit for pagination</p>
|
|
963
|
-
* @param {number} [offset] <p>Offset for pagination</p>
|
|
964
|
-
* @param {Api.QueryRequestPayload} request
|
|
708
|
+
* @summary Health check endpoint that returns 200 if the server and executor are ready
|
|
965
709
|
* @param {RequestInit} [options] Override http request option.
|
|
966
710
|
* @throws {RequiredError}
|
|
967
711
|
*/
|
|
968
|
-
|
|
712
|
+
healthcheck(options?: RequestInit): Promise<string>;
|
|
969
713
|
/**
|
|
970
|
-
* @summary
|
|
971
|
-
* @param {string} tenant
|
|
972
|
-
* @param {string} database
|
|
973
|
-
* @param {string} collectionId
|
|
974
|
-
* @param {Api.UpdateCollectionRecordsPayload} request
|
|
714
|
+
* @summary Heartbeat endpoint that returns a nanosecond timestamp of the current time.
|
|
975
715
|
* @param {RequestInit} [options] Override http request option.
|
|
976
716
|
* @throws {RequiredError}
|
|
977
717
|
*/
|
|
978
|
-
|
|
718
|
+
heartbeat(options?: RequestInit): Promise<Api.HeartbeatResponse>;
|
|
979
719
|
/**
|
|
980
|
-
* @summary
|
|
720
|
+
* @summary Lists all collections in the specified database.
|
|
981
721
|
* @param {string} tenant <p>Tenant ID</p>
|
|
982
|
-
* @param {string} database <p>Database name</p>
|
|
983
|
-
* @param {
|
|
984
|
-
* @param {
|
|
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>
|
|
985
725
|
* @param {RequestInit} [options] Override http request option.
|
|
986
726
|
* @throws {RequiredError}
|
|
987
727
|
*/
|
|
988
|
-
|
|
728
|
+
listCollections(tenant: string, database: string, limit: number | undefined, offset: number | undefined, options?: RequestInit): Promise<Api.Vec2[]>;
|
|
989
729
|
/**
|
|
990
|
-
* @summary
|
|
991
|
-
* @param {string} tenant <p>Tenant ID</p>
|
|
992
|
-
* @param {
|
|
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>
|
|
993
734
|
* @param {RequestInit} [options] Override http request option.
|
|
994
735
|
* @throws {RequiredError}
|
|
995
736
|
*/
|
|
996
|
-
|
|
737
|
+
listDatabases(tenant: string, limit: number | undefined, offset: number | undefined, options?: RequestInit): Promise<Api.Vec2[]>;
|
|
997
738
|
/**
|
|
998
|
-
* @summary
|
|
999
|
-
* @param {string} tenant <p>Tenant ID</p>
|
|
1000
|
-
* @param {string} database <p>Database name containing the new collection</p>
|
|
1001
|
-
* @param {Api.CreateCollectionPayload} request
|
|
739
|
+
* @summary Pre-flight checks endpoint reporting basic readiness info.
|
|
1002
740
|
* @param {RequestInit} [options] Override http request option.
|
|
1003
741
|
* @throws {RequiredError}
|
|
1004
742
|
*/
|
|
1005
|
-
|
|
743
|
+
preFlightChecks(options?: RequestInit): Promise<Api.ChecklistResponse>;
|
|
1006
744
|
/**
|
|
1007
|
-
* @summary
|
|
1008
|
-
* @param {string} tenant <p>Tenant ID to associate with the new database</p>
|
|
1009
|
-
* @param {Api.CreateDatabasePayload} request
|
|
745
|
+
* @summary Reset endpoint allowing authorized users to reset the database.
|
|
1010
746
|
* @param {RequestInit} [options] Override http request option.
|
|
1011
747
|
* @throws {RequiredError}
|
|
1012
748
|
*/
|
|
1013
|
-
|
|
749
|
+
reset(options?: RequestInit): Promise<boolean>;
|
|
1014
750
|
/**
|
|
1015
|
-
* @summary
|
|
1016
|
-
* @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
|
|
1017
756
|
* @param {RequestInit} [options] Override http request option.
|
|
1018
757
|
* @throws {RequiredError}
|
|
1019
758
|
*/
|
|
1020
|
-
|
|
759
|
+
updateCollection(tenant: string, database: string, collectionId: string, request: Api.UpdateCollectionPayload, options?: RequestInit): Promise<Api.UpdateCollectionResponse>;
|
|
1021
760
|
/**
|
|
1022
|
-
* @summary
|
|
1023
|
-
* @param {string} tenant <p>Tenant ID</p>
|
|
1024
|
-
* @param {string} database <p>Database name</p>
|
|
1025
|
-
* @param {string} collectionId <p>UUID of the collection to delete</p>
|
|
761
|
+
* @summary Returns the version of the server.
|
|
1026
762
|
* @param {RequestInit} [options] Override http request option.
|
|
1027
763
|
* @throws {RequiredError}
|
|
1028
764
|
*/
|
|
1029
|
-
|
|
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;
|
|
1030
1008
|
/**
|
|
1031
|
-
* @
|
|
1032
|
-
* @param {string} tenant <p>Tenant ID</p>
|
|
1033
|
-
* @param {string} database <p>Name of the database to delete</p>
|
|
1034
|
-
* @param {RequestInit} [options] Override http request option.
|
|
1035
|
-
* @throws {RequiredError}
|
|
1009
|
+
* @ignore
|
|
1036
1010
|
*/
|
|
1037
|
-
|
|
1011
|
+
private client;
|
|
1038
1012
|
/**
|
|
1039
|
-
* @
|
|
1040
|
-
* @param {string} tenant <p>Tenant ID</p>
|
|
1041
|
-
* @param {string} database <p>Database name</p>
|
|
1042
|
-
* @param {string} collectionId <p>UUID of the collection</p>
|
|
1043
|
-
* @param {RequestInit} [options] Override http request option.
|
|
1044
|
-
* @throws {RequiredError}
|
|
1013
|
+
* @ignore
|
|
1045
1014
|
*/
|
|
1046
|
-
|
|
1015
|
+
embeddingFunction: IEmbeddingFunction;
|
|
1016
|
+
configuration: Api.CollectionConfiguration | undefined;
|
|
1047
1017
|
/**
|
|
1048
|
-
* @
|
|
1049
|
-
* @param {string} tenant <p>Tenant ID</p>
|
|
1050
|
-
* @param {string} database <p>Name of the database to retrieve</p>
|
|
1051
|
-
* @param {RequestInit} [options] Override http request option.
|
|
1052
|
-
* @throws {RequiredError}
|
|
1018
|
+
* @ignore
|
|
1053
1019
|
*/
|
|
1054
|
-
|
|
1020
|
+
constructor(name: string, id: string, client: ChromaClient, embeddingFunction: IEmbeddingFunction, metadata?: CollectionMetadata, configuration?: Api.CollectionConfiguration);
|
|
1055
1021
|
/**
|
|
1056
|
-
*
|
|
1057
|
-
* @param {
|
|
1058
|
-
* @param {
|
|
1059
|
-
* @
|
|
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
|
+
* ```
|
|
1060
1039
|
*/
|
|
1061
|
-
|
|
1040
|
+
add(params: AddRecordsParams): Promise<void>;
|
|
1062
1041
|
/**
|
|
1063
|
-
*
|
|
1064
|
-
* @param {
|
|
1065
|
-
* @
|
|
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
|
+
* ```
|
|
1066
1059
|
*/
|
|
1067
|
-
|
|
1060
|
+
upsert(params: UpsertRecordsParams): Promise<void>;
|
|
1068
1061
|
/**
|
|
1069
|
-
*
|
|
1070
|
-
* @
|
|
1071
|
-
*
|
|
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
|
+
* ```
|
|
1072
1069
|
*/
|
|
1073
|
-
|
|
1070
|
+
count(): Promise<number>;
|
|
1074
1071
|
/**
|
|
1075
|
-
*
|
|
1076
|
-
* @param {
|
|
1077
|
-
* @
|
|
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
|
+
* ```
|
|
1078
1093
|
*/
|
|
1079
|
-
|
|
1094
|
+
get({ ids, where, limit, offset, include, whereDocument, }?: BaseGetParams): Promise<GetResponse>;
|
|
1080
1095
|
/**
|
|
1081
|
-
*
|
|
1082
|
-
* @param {
|
|
1083
|
-
* @param {
|
|
1084
|
-
* @param {
|
|
1085
|
-
* @param {
|
|
1086
|
-
* @param {
|
|
1087
|
-
* @
|
|
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
|
+
* ```
|
|
1088
1113
|
*/
|
|
1089
|
-
|
|
1114
|
+
update(params: UpdateRecordsParams): Promise<void>;
|
|
1090
1115
|
/**
|
|
1091
|
-
*
|
|
1092
|
-
*
|
|
1093
|
-
* @param {
|
|
1094
|
-
* @param {
|
|
1095
|
-
* @param {
|
|
1096
|
-
* @
|
|
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
|
+
*
|
|
1097
1147
|
*/
|
|
1098
|
-
|
|
1148
|
+
query({ nResults, where, whereDocument, include, queryTexts, queryEmbeddings, }: QueryRecordsParams): Promise<MultiQueryResponse>;
|
|
1099
1149
|
/**
|
|
1100
|
-
*
|
|
1101
|
-
* @param {
|
|
1102
|
-
* @
|
|
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
|
+
* ```
|
|
1103
1163
|
*/
|
|
1104
|
-
|
|
1164
|
+
modify({ name, metadata, configuration, }: {
|
|
1165
|
+
name?: string;
|
|
1166
|
+
metadata?: CollectionMetadata;
|
|
1167
|
+
configuration?: UpdateCollectionConfiguration;
|
|
1168
|
+
}): Promise<CollectionParams>;
|
|
1105
1169
|
/**
|
|
1106
|
-
*
|
|
1107
|
-
* @param {
|
|
1108
|
-
* @
|
|
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
|
+
* ```
|
|
1109
1182
|
*/
|
|
1110
|
-
|
|
1183
|
+
peek({ limit }?: PeekParams): Promise<MultiGetResponse>;
|
|
1111
1184
|
/**
|
|
1112
|
-
*
|
|
1113
|
-
* @param {
|
|
1114
|
-
* @param {
|
|
1115
|
-
* @param {
|
|
1116
|
-
* @param {
|
|
1117
|
-
* @
|
|
1118
|
-
* @throws {
|
|
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
|
+
* ```
|
|
1119
1201
|
*/
|
|
1120
|
-
|
|
1202
|
+
delete({ ids, where, whereDocument, }?: DeleteParams): Promise<void>;
|
|
1121
1203
|
/**
|
|
1122
|
-
*
|
|
1123
|
-
*
|
|
1124
|
-
* @
|
|
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
|
+
* ```
|
|
1125
1218
|
*/
|
|
1126
|
-
|
|
1219
|
+
fork({ newName }: ForkCollectionParams): Promise<Collection>;
|
|
1127
1220
|
}
|
|
1128
1221
|
|
|
1129
1222
|
declare class ChromaClient {
|
|
@@ -1232,7 +1325,7 @@ declare class ChromaClient {
|
|
|
1232
1325
|
* });
|
|
1233
1326
|
* ```
|
|
1234
1327
|
*/
|
|
1235
|
-
createCollection({ name, metadata, embeddingFunction, }: CreateCollectionParams): Promise<Collection>;
|
|
1328
|
+
createCollection({ name, metadata, embeddingFunction, configuration, }: CreateCollectionParams): Promise<Collection>;
|
|
1236
1329
|
/**
|
|
1237
1330
|
* Gets or creates a collection with the specified properties.
|
|
1238
1331
|
*
|
|
@@ -1254,7 +1347,7 @@ declare class ChromaClient {
|
|
|
1254
1347
|
* });
|
|
1255
1348
|
* ```
|
|
1256
1349
|
*/
|
|
1257
|
-
getOrCreateCollection({ name, metadata, embeddingFunction, }: GetOrCreateCollectionParams): Promise<Collection>;
|
|
1350
|
+
getOrCreateCollection({ name, metadata, embeddingFunction, configuration, }: GetOrCreateCollectionParams): Promise<Collection>;
|
|
1258
1351
|
/**
|
|
1259
1352
|
* Get all collection names.
|
|
1260
1353
|
*
|
|
@@ -1664,6 +1757,12 @@ declare class HuggingFaceEmbeddingServerFunction implements IEmbeddingFunction {
|
|
|
1664
1757
|
type StoredConfig$4 = {
|
|
1665
1758
|
api_key_env_var: string;
|
|
1666
1759
|
model_name: string;
|
|
1760
|
+
task?: string;
|
|
1761
|
+
late_chunking?: boolean;
|
|
1762
|
+
truncate?: boolean;
|
|
1763
|
+
dimensions?: number;
|
|
1764
|
+
embedding_type?: string;
|
|
1765
|
+
normalized?: boolean;
|
|
1667
1766
|
};
|
|
1668
1767
|
declare class JinaEmbeddingFunction implements IEmbeddingFunction {
|
|
1669
1768
|
name: string;
|
|
@@ -1671,10 +1770,22 @@ declare class JinaEmbeddingFunction implements IEmbeddingFunction {
|
|
|
1671
1770
|
private model_name;
|
|
1672
1771
|
private api_url;
|
|
1673
1772
|
private headers;
|
|
1674
|
-
|
|
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, }: {
|
|
1675
1780
|
jinaai_api_key?: string;
|
|
1676
1781
|
model_name?: string;
|
|
1677
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;
|
|
1678
1789
|
});
|
|
1679
1790
|
generate(texts: string[]): Promise<any[]>;
|
|
1680
1791
|
buildFromConfig(config: StoredConfig$4): JinaEmbeddingFunction;
|