chromadb 3.2.2 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chromadb.d.ts +45 -8
- package/dist/chromadb.legacy-esm.js +404 -177
- package/dist/chromadb.mjs +404 -177
- package/dist/chromadb.mjs.map +1 -1
- package/dist/cjs/chromadb.cjs +404 -177
- package/dist/cjs/chromadb.cjs.map +1 -1
- package/dist/cjs/chromadb.d.cts +45 -8
- package/package.json +6 -6
- package/src/admin-client.ts +7 -7
- package/src/api/sdk.gen.ts +360 -135
- package/src/api/types.gen.ts +157 -58
- package/src/chroma-client.ts +18 -13
- package/src/collection.ts +18 -18
- package/src/execution/expression/key.ts +27 -6
- package/src/schema.ts +81 -56
- package/src/types.ts +28 -5
- package/src/utils.ts +72 -17
package/src/api/sdk.gen.ts
CHANGED
|
@@ -18,29 +18,181 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
|
|
|
18
18
|
meta?: Record<string, unknown>;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
export class
|
|
21
|
+
export class AuthenticationService {
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Get user identity
|
|
24
|
+
* Returns the current user's identity, tenant, and databases.
|
|
24
25
|
*/
|
|
25
26
|
public static getUserIdentity<ThrowOnError extends boolean = true>(options?: Options<GetUserIdentityData, ThrowOnError>) {
|
|
26
27
|
return (options?.client ?? _heyApiClient).get<GetUserIdentityResponse2, GetUserIdentityError, ThrowOnError>({
|
|
28
|
+
security: [
|
|
29
|
+
{
|
|
30
|
+
name: 'x-chroma-token',
|
|
31
|
+
type: 'apiKey'
|
|
32
|
+
}
|
|
33
|
+
],
|
|
27
34
|
url: '/api/v2/auth/identity',
|
|
28
35
|
...options
|
|
29
36
|
});
|
|
30
37
|
}
|
|
31
38
|
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export class CollectionService {
|
|
32
42
|
/**
|
|
33
|
-
*
|
|
43
|
+
* Get collection by CRN
|
|
44
|
+
* Returns a collection by Chroma Resource Name.
|
|
34
45
|
*/
|
|
35
46
|
public static getCollectionByCrn<ThrowOnError extends boolean = true>(options: Options<GetCollectionByCrnData, ThrowOnError>) {
|
|
36
47
|
return (options.client ?? _heyApiClient).get<GetCollectionByCrnResponse, GetCollectionByCrnError, ThrowOnError>({
|
|
48
|
+
security: [
|
|
49
|
+
{
|
|
50
|
+
name: 'x-chroma-token',
|
|
51
|
+
type: 'apiKey'
|
|
52
|
+
}
|
|
53
|
+
],
|
|
37
54
|
url: '/api/v2/collections/{crn}',
|
|
38
55
|
...options
|
|
39
56
|
});
|
|
40
57
|
}
|
|
41
58
|
|
|
42
59
|
/**
|
|
43
|
-
*
|
|
60
|
+
* List collections
|
|
61
|
+
* Lists all collections in a database.
|
|
62
|
+
*/
|
|
63
|
+
public static listCollections<ThrowOnError extends boolean = true>(options: Options<ListCollectionsData, ThrowOnError>) {
|
|
64
|
+
return (options.client ?? _heyApiClient).get<ListCollectionsResponse, ListCollectionsError, ThrowOnError>({
|
|
65
|
+
security: [
|
|
66
|
+
{
|
|
67
|
+
name: 'x-chroma-token',
|
|
68
|
+
type: 'apiKey'
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
url: '/api/v2/tenants/{tenant}/databases/{database}/collections',
|
|
72
|
+
...options
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Create collection
|
|
78
|
+
* Creates a new collection in a database.
|
|
79
|
+
*/
|
|
80
|
+
public static createCollection<ThrowOnError extends boolean = true>(options: Options<CreateCollectionData, ThrowOnError>) {
|
|
81
|
+
return (options.client ?? _heyApiClient).post<CreateCollectionResponse, CreateCollectionError, ThrowOnError>({
|
|
82
|
+
security: [
|
|
83
|
+
{
|
|
84
|
+
name: 'x-chroma-token',
|
|
85
|
+
type: 'apiKey'
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
url: '/api/v2/tenants/{tenant}/databases/{database}/collections',
|
|
89
|
+
...options,
|
|
90
|
+
headers: {
|
|
91
|
+
'Content-Type': 'application/json',
|
|
92
|
+
...options?.headers
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Delete collection
|
|
99
|
+
* Deletes a collection in a database.
|
|
100
|
+
*/
|
|
101
|
+
public static deleteCollection<ThrowOnError extends boolean = true>(options: Options<DeleteCollectionData, ThrowOnError>) {
|
|
102
|
+
return (options.client ?? _heyApiClient).delete<DeleteCollectionResponse, DeleteCollectionError, ThrowOnError>({
|
|
103
|
+
security: [
|
|
104
|
+
{
|
|
105
|
+
name: 'x-chroma-token',
|
|
106
|
+
type: 'apiKey'
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}',
|
|
110
|
+
...options
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Get collection
|
|
116
|
+
* Returns a collection by ID or name.
|
|
117
|
+
*/
|
|
118
|
+
public static getCollection<ThrowOnError extends boolean = true>(options: Options<GetCollectionData, ThrowOnError>) {
|
|
119
|
+
return (options.client ?? _heyApiClient).get<GetCollectionResponse, GetCollectionError, ThrowOnError>({
|
|
120
|
+
security: [
|
|
121
|
+
{
|
|
122
|
+
name: 'x-chroma-token',
|
|
123
|
+
type: 'apiKey'
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}',
|
|
127
|
+
...options
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Update collection
|
|
133
|
+
* Updates an existing collection's name or metadata.
|
|
134
|
+
*/
|
|
135
|
+
public static updateCollection<ThrowOnError extends boolean = true>(options: Options<UpdateCollectionData, ThrowOnError>) {
|
|
136
|
+
return (options.client ?? _heyApiClient).put<UpdateCollectionResponse2, UpdateCollectionError, ThrowOnError>({
|
|
137
|
+
security: [
|
|
138
|
+
{
|
|
139
|
+
name: 'x-chroma-token',
|
|
140
|
+
type: 'apiKey'
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}',
|
|
144
|
+
...options,
|
|
145
|
+
headers: {
|
|
146
|
+
'Content-Type': 'application/json',
|
|
147
|
+
...options?.headers
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Fork collection
|
|
154
|
+
* Creates a fork of an existing collection.
|
|
155
|
+
*/
|
|
156
|
+
public static forkCollection<ThrowOnError extends boolean = true>(options: Options<ForkCollectionData, ThrowOnError>) {
|
|
157
|
+
return (options.client ?? _heyApiClient).post<ForkCollectionResponse, ForkCollectionError, ThrowOnError>({
|
|
158
|
+
security: [
|
|
159
|
+
{
|
|
160
|
+
name: 'x-chroma-token',
|
|
161
|
+
type: 'apiKey'
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/fork',
|
|
165
|
+
...options,
|
|
166
|
+
headers: {
|
|
167
|
+
'Content-Type': 'application/json',
|
|
168
|
+
...options?.headers
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Get number of collections
|
|
175
|
+
* Returns the total number of collections in a database.
|
|
176
|
+
*/
|
|
177
|
+
public static countCollections<ThrowOnError extends boolean = true>(options: Options<CountCollectionsData, ThrowOnError>) {
|
|
178
|
+
return (options.client ?? _heyApiClient).get<CountCollectionsResponse, CountCollectionsError, ThrowOnError>({
|
|
179
|
+
security: [
|
|
180
|
+
{
|
|
181
|
+
name: 'x-chroma-token',
|
|
182
|
+
type: 'apiKey'
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
url: '/api/v2/tenants/{tenant}/databases/{database}/collections_count',
|
|
186
|
+
...options
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export class SystemService {
|
|
193
|
+
/**
|
|
194
|
+
* Healthcheck
|
|
195
|
+
* Returns the health status of the service.
|
|
44
196
|
*/
|
|
45
197
|
public static healthcheck<ThrowOnError extends boolean = true>(options?: Options<HealthcheckData, ThrowOnError>) {
|
|
46
198
|
return (options?.client ?? _heyApiClient).get<HealthcheckResponse, HealthcheckError, ThrowOnError>({
|
|
@@ -50,7 +202,8 @@ export class DefaultService {
|
|
|
50
202
|
}
|
|
51
203
|
|
|
52
204
|
/**
|
|
53
|
-
* Heartbeat
|
|
205
|
+
* Heartbeat
|
|
206
|
+
* Returns a nanosecond timestamp of the current time.
|
|
54
207
|
*/
|
|
55
208
|
public static heartbeat<ThrowOnError extends boolean = true>(options?: Options<HeartbeatData, ThrowOnError>) {
|
|
56
209
|
return (options?.client ?? _heyApiClient).get<HeartbeatResponse2, HeartbeatError, ThrowOnError>({
|
|
@@ -60,7 +213,8 @@ export class DefaultService {
|
|
|
60
213
|
}
|
|
61
214
|
|
|
62
215
|
/**
|
|
63
|
-
* Pre-flight checks
|
|
216
|
+
* Pre-flight checks
|
|
217
|
+
* Returns basic readiness information.
|
|
64
218
|
*/
|
|
65
219
|
public static preFlightChecks<ThrowOnError extends boolean = true>(options?: Options<PreFlightChecksData, ThrowOnError>) {
|
|
66
220
|
return (options?.client ?? _heyApiClient).get<PreFlightChecksResponse, PreFlightChecksError, ThrowOnError>({
|
|
@@ -70,20 +224,48 @@ export class DefaultService {
|
|
|
70
224
|
}
|
|
71
225
|
|
|
72
226
|
/**
|
|
73
|
-
* Reset
|
|
227
|
+
* Reset database
|
|
228
|
+
* Resets the database. Requires authorization.
|
|
74
229
|
*/
|
|
75
230
|
public static reset<ThrowOnError extends boolean = true>(options?: Options<ResetData, ThrowOnError>) {
|
|
76
231
|
return (options?.client ?? _heyApiClient).post<ResetResponse, ResetError, ThrowOnError>({
|
|
232
|
+
security: [
|
|
233
|
+
{
|
|
234
|
+
name: 'x-chroma-token',
|
|
235
|
+
type: 'apiKey'
|
|
236
|
+
}
|
|
237
|
+
],
|
|
77
238
|
url: '/api/v2/reset',
|
|
78
239
|
...options
|
|
79
240
|
});
|
|
80
241
|
}
|
|
81
242
|
|
|
82
243
|
/**
|
|
244
|
+
* Get version
|
|
245
|
+
* Returns the version of the server.
|
|
246
|
+
*/
|
|
247
|
+
public static version<ThrowOnError extends boolean = true>(options?: Options<VersionData, ThrowOnError>) {
|
|
248
|
+
return (options?.client ?? _heyApiClient).get<VersionResponse, unknown, ThrowOnError>({
|
|
249
|
+
url: '/api/v2/version',
|
|
250
|
+
...options
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export class TenantService {
|
|
257
|
+
/**
|
|
258
|
+
* Create tenant
|
|
83
259
|
* Creates a new tenant.
|
|
84
260
|
*/
|
|
85
261
|
public static createTenant<ThrowOnError extends boolean = true>(options: Options<CreateTenantData, ThrowOnError>) {
|
|
86
262
|
return (options.client ?? _heyApiClient).post<CreateTenantResponse2, CreateTenantError, ThrowOnError>({
|
|
263
|
+
security: [
|
|
264
|
+
{
|
|
265
|
+
name: 'x-chroma-token',
|
|
266
|
+
type: 'apiKey'
|
|
267
|
+
}
|
|
268
|
+
],
|
|
87
269
|
url: '/api/v2/tenants',
|
|
88
270
|
...options,
|
|
89
271
|
headers: {
|
|
@@ -94,20 +276,34 @@ export class DefaultService {
|
|
|
94
276
|
}
|
|
95
277
|
|
|
96
278
|
/**
|
|
279
|
+
* Get tenant
|
|
97
280
|
* Returns an existing tenant by name.
|
|
98
281
|
*/
|
|
99
282
|
public static getTenant<ThrowOnError extends boolean = true>(options: Options<GetTenantData, ThrowOnError>) {
|
|
100
283
|
return (options.client ?? _heyApiClient).get<GetTenantResponse2, GetTenantError, ThrowOnError>({
|
|
284
|
+
security: [
|
|
285
|
+
{
|
|
286
|
+
name: 'x-chroma-token',
|
|
287
|
+
type: 'apiKey'
|
|
288
|
+
}
|
|
289
|
+
],
|
|
101
290
|
url: '/api/v2/tenants/{tenant_name}',
|
|
102
291
|
...options
|
|
103
292
|
});
|
|
104
293
|
}
|
|
105
294
|
|
|
106
295
|
/**
|
|
296
|
+
* Update tenant
|
|
107
297
|
* Updates an existing tenant by name.
|
|
108
298
|
*/
|
|
109
299
|
public static updateTenant<ThrowOnError extends boolean = true>(options: Options<UpdateTenantData, ThrowOnError>) {
|
|
110
300
|
return (options.client ?? _heyApiClient).patch<UpdateTenantResponse2, UpdateTenantError, ThrowOnError>({
|
|
301
|
+
security: [
|
|
302
|
+
{
|
|
303
|
+
name: 'x-chroma-token',
|
|
304
|
+
type: 'apiKey'
|
|
305
|
+
}
|
|
306
|
+
],
|
|
111
307
|
url: '/api/v2/tenants/{tenant_name}',
|
|
112
308
|
...options,
|
|
113
309
|
headers: {
|
|
@@ -117,21 +313,38 @@ export class DefaultService {
|
|
|
117
313
|
});
|
|
118
314
|
}
|
|
119
315
|
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export class DatabaseService {
|
|
120
319
|
/**
|
|
121
|
-
*
|
|
320
|
+
* List databases
|
|
321
|
+
* Lists all databases for a tenant.
|
|
122
322
|
*/
|
|
123
323
|
public static listDatabases<ThrowOnError extends boolean = true>(options: Options<ListDatabasesData, ThrowOnError>) {
|
|
124
324
|
return (options.client ?? _heyApiClient).get<ListDatabasesResponse, ListDatabasesError, ThrowOnError>({
|
|
325
|
+
security: [
|
|
326
|
+
{
|
|
327
|
+
name: 'x-chroma-token',
|
|
328
|
+
type: 'apiKey'
|
|
329
|
+
}
|
|
330
|
+
],
|
|
125
331
|
url: '/api/v2/tenants/{tenant}/databases',
|
|
126
332
|
...options
|
|
127
333
|
});
|
|
128
334
|
}
|
|
129
335
|
|
|
130
336
|
/**
|
|
131
|
-
*
|
|
337
|
+
* Create database
|
|
338
|
+
* Creates a new database for a tenant.
|
|
132
339
|
*/
|
|
133
340
|
public static createDatabase<ThrowOnError extends boolean = true>(options: Options<CreateDatabaseData, ThrowOnError>) {
|
|
134
341
|
return (options.client ?? _heyApiClient).post<CreateDatabaseResponse2, CreateDatabaseError, ThrowOnError>({
|
|
342
|
+
security: [
|
|
343
|
+
{
|
|
344
|
+
name: 'x-chroma-token',
|
|
345
|
+
type: 'apiKey'
|
|
346
|
+
}
|
|
347
|
+
],
|
|
135
348
|
url: '/api/v2/tenants/{tenant}/databases',
|
|
136
349
|
...options,
|
|
137
350
|
headers: {
|
|
@@ -142,88 +355,54 @@ export class DefaultService {
|
|
|
142
355
|
}
|
|
143
356
|
|
|
144
357
|
/**
|
|
145
|
-
*
|
|
358
|
+
* Delete database
|
|
359
|
+
* Deletes a database by name.
|
|
146
360
|
*/
|
|
147
361
|
public static deleteDatabase<ThrowOnError extends boolean = true>(options: Options<DeleteDatabaseData, ThrowOnError>) {
|
|
148
362
|
return (options.client ?? _heyApiClient).delete<DeleteDatabaseResponse2, DeleteDatabaseError, ThrowOnError>({
|
|
363
|
+
security: [
|
|
364
|
+
{
|
|
365
|
+
name: 'x-chroma-token',
|
|
366
|
+
type: 'apiKey'
|
|
367
|
+
}
|
|
368
|
+
],
|
|
149
369
|
url: '/api/v2/tenants/{tenant}/databases/{database}',
|
|
150
370
|
...options
|
|
151
371
|
});
|
|
152
372
|
}
|
|
153
373
|
|
|
154
374
|
/**
|
|
155
|
-
*
|
|
375
|
+
* Get database
|
|
376
|
+
* Returns a database by name.
|
|
156
377
|
*/
|
|
157
378
|
public static getDatabase<ThrowOnError extends boolean = true>(options: Options<GetDatabaseData, ThrowOnError>) {
|
|
158
379
|
return (options.client ?? _heyApiClient).get<GetDatabaseResponse, GetDatabaseError, ThrowOnError>({
|
|
380
|
+
security: [
|
|
381
|
+
{
|
|
382
|
+
name: 'x-chroma-token',
|
|
383
|
+
type: 'apiKey'
|
|
384
|
+
}
|
|
385
|
+
],
|
|
159
386
|
url: '/api/v2/tenants/{tenant}/databases/{database}',
|
|
160
387
|
...options
|
|
161
388
|
});
|
|
162
389
|
}
|
|
163
390
|
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export class RecordService {
|
|
164
394
|
/**
|
|
165
|
-
*
|
|
166
|
-
*/
|
|
167
|
-
public static listCollections<ThrowOnError extends boolean = true>(options: Options<ListCollectionsData, ThrowOnError>) {
|
|
168
|
-
return (options.client ?? _heyApiClient).get<ListCollectionsResponse, ListCollectionsError, ThrowOnError>({
|
|
169
|
-
url: '/api/v2/tenants/{tenant}/databases/{database}/collections',
|
|
170
|
-
...options
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Creates a new collection under the specified database.
|
|
176
|
-
*/
|
|
177
|
-
public static createCollection<ThrowOnError extends boolean = true>(options: Options<CreateCollectionData, ThrowOnError>) {
|
|
178
|
-
return (options.client ?? _heyApiClient).post<CreateCollectionResponse, CreateCollectionError, ThrowOnError>({
|
|
179
|
-
url: '/api/v2/tenants/{tenant}/databases/{database}/collections',
|
|
180
|
-
...options,
|
|
181
|
-
headers: {
|
|
182
|
-
'Content-Type': 'application/json',
|
|
183
|
-
...options?.headers
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Deletes a collection in a given database.
|
|
190
|
-
*/
|
|
191
|
-
public static deleteCollection<ThrowOnError extends boolean = true>(options: Options<DeleteCollectionData, ThrowOnError>) {
|
|
192
|
-
return (options.client ?? _heyApiClient).delete<DeleteCollectionResponse, DeleteCollectionError, ThrowOnError>({
|
|
193
|
-
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}',
|
|
194
|
-
...options
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* Retrieves a collection by ID or name.
|
|
200
|
-
*/
|
|
201
|
-
public static getCollection<ThrowOnError extends boolean = true>(options: Options<GetCollectionData, ThrowOnError>) {
|
|
202
|
-
return (options.client ?? _heyApiClient).get<GetCollectionResponse, GetCollectionError, ThrowOnError>({
|
|
203
|
-
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}',
|
|
204
|
-
...options
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Updates an existing collection's name or metadata.
|
|
210
|
-
*/
|
|
211
|
-
public static updateCollection<ThrowOnError extends boolean = true>(options: Options<UpdateCollectionData, ThrowOnError>) {
|
|
212
|
-
return (options.client ?? _heyApiClient).put<UpdateCollectionResponse2, UpdateCollectionError, ThrowOnError>({
|
|
213
|
-
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}',
|
|
214
|
-
...options,
|
|
215
|
-
headers: {
|
|
216
|
-
'Content-Type': 'application/json',
|
|
217
|
-
...options?.headers
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/**
|
|
395
|
+
* Add records
|
|
223
396
|
* Adds records to a collection.
|
|
224
397
|
*/
|
|
225
398
|
public static collectionAdd<ThrowOnError extends boolean = true>(options: Options<CollectionAddData, ThrowOnError>) {
|
|
226
399
|
return (options.client ?? _heyApiClient).post<CollectionAddResponse, unknown, ThrowOnError>({
|
|
400
|
+
security: [
|
|
401
|
+
{
|
|
402
|
+
name: 'x-chroma-token',
|
|
403
|
+
type: 'apiKey'
|
|
404
|
+
}
|
|
405
|
+
],
|
|
227
406
|
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/add',
|
|
228
407
|
...options,
|
|
229
408
|
headers: {
|
|
@@ -234,34 +413,34 @@ export class DefaultService {
|
|
|
234
413
|
}
|
|
235
414
|
|
|
236
415
|
/**
|
|
237
|
-
*
|
|
238
|
-
|
|
239
|
-
public static detachFunction<ThrowOnError extends boolean = true>(options: Options<DetachFunctionData, ThrowOnError>) {
|
|
240
|
-
return (options.client ?? _heyApiClient).post<DetachFunctionResponse2, DetachFunctionError, ThrowOnError>({
|
|
241
|
-
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/attached_functions/{name}/detach',
|
|
242
|
-
...options,
|
|
243
|
-
headers: {
|
|
244
|
-
'Content-Type': 'application/json',
|
|
245
|
-
...options?.headers
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* Retrieves the number of records in a collection.
|
|
416
|
+
* Get number of records
|
|
417
|
+
* Returns the number of records in a collection.
|
|
252
418
|
*/
|
|
253
419
|
public static collectionCount<ThrowOnError extends boolean = true>(options: Options<CollectionCountData, ThrowOnError>) {
|
|
254
420
|
return (options.client ?? _heyApiClient).get<CollectionCountResponse, CollectionCountError, ThrowOnError>({
|
|
421
|
+
security: [
|
|
422
|
+
{
|
|
423
|
+
name: 'x-chroma-token',
|
|
424
|
+
type: 'apiKey'
|
|
425
|
+
}
|
|
426
|
+
],
|
|
255
427
|
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/count',
|
|
256
428
|
...options
|
|
257
429
|
});
|
|
258
430
|
}
|
|
259
431
|
|
|
260
432
|
/**
|
|
433
|
+
* Delete records
|
|
261
434
|
* Deletes records in a collection. Can filter by IDs or metadata.
|
|
262
435
|
*/
|
|
263
436
|
public static collectionDelete<ThrowOnError extends boolean = true>(options: Options<CollectionDeleteData, ThrowOnError>) {
|
|
264
437
|
return (options.client ?? _heyApiClient).post<CollectionDeleteResponse, CollectionDeleteError, ThrowOnError>({
|
|
438
|
+
security: [
|
|
439
|
+
{
|
|
440
|
+
name: 'x-chroma-token',
|
|
441
|
+
type: 'apiKey'
|
|
442
|
+
}
|
|
443
|
+
],
|
|
265
444
|
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/delete',
|
|
266
445
|
...options,
|
|
267
446
|
headers: {
|
|
@@ -272,48 +451,17 @@ export class DefaultService {
|
|
|
272
451
|
}
|
|
273
452
|
|
|
274
453
|
/**
|
|
275
|
-
*
|
|
276
|
-
|
|
277
|
-
public static forkCollection<ThrowOnError extends boolean = true>(options: Options<ForkCollectionData, ThrowOnError>) {
|
|
278
|
-
return (options.client ?? _heyApiClient).post<ForkCollectionResponse, ForkCollectionError, ThrowOnError>({
|
|
279
|
-
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/fork',
|
|
280
|
-
...options,
|
|
281
|
-
headers: {
|
|
282
|
-
'Content-Type': 'application/json',
|
|
283
|
-
...options?.headers
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* Attach a function to a collection
|
|
290
|
-
*/
|
|
291
|
-
public static attachFunction<ThrowOnError extends boolean = true>(options: Options<AttachFunctionData, ThrowOnError>) {
|
|
292
|
-
return (options.client ?? _heyApiClient).post<AttachFunctionResponse2, AttachFunctionError, ThrowOnError>({
|
|
293
|
-
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/functions/attach',
|
|
294
|
-
...options,
|
|
295
|
-
headers: {
|
|
296
|
-
'Content-Type': 'application/json',
|
|
297
|
-
...options?.headers
|
|
298
|
-
}
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* Get an attached function by name
|
|
304
|
-
*/
|
|
305
|
-
public static getAttachedFunction<ThrowOnError extends boolean = true>(options: Options<GetAttachedFunctionData, ThrowOnError>) {
|
|
306
|
-
return (options.client ?? _heyApiClient).get<GetAttachedFunctionResponse2, GetAttachedFunctionError, ThrowOnError>({
|
|
307
|
-
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/functions/{function_name}',
|
|
308
|
-
...options
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* Retrieves records from a collection by ID or metadata filter.
|
|
454
|
+
* Get records
|
|
455
|
+
* Returns records from a collection by ID or metadata filter.
|
|
314
456
|
*/
|
|
315
457
|
public static collectionGet<ThrowOnError extends boolean = true>(options: Options<CollectionGetData, ThrowOnError>) {
|
|
316
458
|
return (options.client ?? _heyApiClient).post<CollectionGetResponse, CollectionGetError, ThrowOnError>({
|
|
459
|
+
security: [
|
|
460
|
+
{
|
|
461
|
+
name: 'x-chroma-token',
|
|
462
|
+
type: 'apiKey'
|
|
463
|
+
}
|
|
464
|
+
],
|
|
317
465
|
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/get',
|
|
318
466
|
...options,
|
|
319
467
|
headers: {
|
|
@@ -324,20 +472,34 @@ export class DefaultService {
|
|
|
324
472
|
}
|
|
325
473
|
|
|
326
474
|
/**
|
|
327
|
-
*
|
|
475
|
+
* Get indexing status
|
|
476
|
+
* Returns the indexing status of a collection.
|
|
328
477
|
*/
|
|
329
478
|
public static indexingStatus<ThrowOnError extends boolean = true>(options: Options<IndexingStatusData, ThrowOnError>) {
|
|
330
479
|
return (options.client ?? _heyApiClient).get<IndexingStatusResponse, IndexingStatusError, ThrowOnError>({
|
|
480
|
+
security: [
|
|
481
|
+
{
|
|
482
|
+
name: 'x-chroma-token',
|
|
483
|
+
type: 'apiKey'
|
|
484
|
+
}
|
|
485
|
+
],
|
|
331
486
|
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/indexing_status',
|
|
332
487
|
...options
|
|
333
488
|
});
|
|
334
489
|
}
|
|
335
490
|
|
|
336
491
|
/**
|
|
337
|
-
* Query
|
|
492
|
+
* Query collection
|
|
493
|
+
* Queries a collection using dense vector search with metadata and full-text search filtering.
|
|
338
494
|
*/
|
|
339
495
|
public static collectionQuery<ThrowOnError extends boolean = true>(options: Options<CollectionQueryData, ThrowOnError>) {
|
|
340
496
|
return (options.client ?? _heyApiClient).post<CollectionQueryResponse, CollectionQueryError, ThrowOnError>({
|
|
497
|
+
security: [
|
|
498
|
+
{
|
|
499
|
+
name: 'x-chroma-token',
|
|
500
|
+
type: 'apiKey'
|
|
501
|
+
}
|
|
502
|
+
],
|
|
341
503
|
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/query',
|
|
342
504
|
...options,
|
|
343
505
|
headers: {
|
|
@@ -348,10 +510,17 @@ export class DefaultService {
|
|
|
348
510
|
}
|
|
349
511
|
|
|
350
512
|
/**
|
|
351
|
-
* Search records
|
|
513
|
+
* Search records
|
|
514
|
+
* Searches records from a collection with dense, sparse, or hybrid vector search.
|
|
352
515
|
*/
|
|
353
516
|
public static collectionSearch<ThrowOnError extends boolean = true>(options: Options<CollectionSearchData, ThrowOnError>) {
|
|
354
517
|
return (options.client ?? _heyApiClient).post<CollectionSearchResponse, CollectionSearchError, ThrowOnError>({
|
|
518
|
+
security: [
|
|
519
|
+
{
|
|
520
|
+
name: 'x-chroma-token',
|
|
521
|
+
type: 'apiKey'
|
|
522
|
+
}
|
|
523
|
+
],
|
|
355
524
|
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/search',
|
|
356
525
|
...options,
|
|
357
526
|
headers: {
|
|
@@ -362,10 +531,17 @@ export class DefaultService {
|
|
|
362
531
|
}
|
|
363
532
|
|
|
364
533
|
/**
|
|
534
|
+
* Update records
|
|
365
535
|
* Updates records in a collection by ID.
|
|
366
536
|
*/
|
|
367
537
|
public static collectionUpdate<ThrowOnError extends boolean = true>(options: Options<CollectionUpdateData, ThrowOnError>) {
|
|
368
538
|
return (options.client ?? _heyApiClient).post<CollectionUpdateResponse, unknown, ThrowOnError>({
|
|
539
|
+
security: [
|
|
540
|
+
{
|
|
541
|
+
name: 'x-chroma-token',
|
|
542
|
+
type: 'apiKey'
|
|
543
|
+
}
|
|
544
|
+
],
|
|
369
545
|
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/update',
|
|
370
546
|
...options,
|
|
371
547
|
headers: {
|
|
@@ -376,10 +552,17 @@ export class DefaultService {
|
|
|
376
552
|
}
|
|
377
553
|
|
|
378
554
|
/**
|
|
555
|
+
* Upsert records
|
|
379
556
|
* Upserts records in a collection (create if not exists, otherwise update).
|
|
380
557
|
*/
|
|
381
558
|
public static collectionUpsert<ThrowOnError extends boolean = true>(options: Options<CollectionUpsertData, ThrowOnError>) {
|
|
382
559
|
return (options.client ?? _heyApiClient).post<CollectionUpsertResponse, CollectionUpsertError, ThrowOnError>({
|
|
560
|
+
security: [
|
|
561
|
+
{
|
|
562
|
+
name: 'x-chroma-token',
|
|
563
|
+
type: 'apiKey'
|
|
564
|
+
}
|
|
565
|
+
],
|
|
383
566
|
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/upsert',
|
|
384
567
|
...options,
|
|
385
568
|
headers: {
|
|
@@ -389,22 +572,64 @@ export class DefaultService {
|
|
|
389
572
|
});
|
|
390
573
|
}
|
|
391
574
|
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
export class FunctionService {
|
|
392
578
|
/**
|
|
393
|
-
*
|
|
579
|
+
* Detach function
|
|
580
|
+
* Detaches a function from a collection.
|
|
394
581
|
*/
|
|
395
|
-
public static
|
|
396
|
-
return (options.client ?? _heyApiClient).
|
|
397
|
-
|
|
398
|
-
|
|
582
|
+
public static detachFunction<ThrowOnError extends boolean = true>(options: Options<DetachFunctionData, ThrowOnError>) {
|
|
583
|
+
return (options.client ?? _heyApiClient).post<DetachFunctionResponse2, DetachFunctionError, ThrowOnError>({
|
|
584
|
+
security: [
|
|
585
|
+
{
|
|
586
|
+
name: 'x-chroma-token',
|
|
587
|
+
type: 'apiKey'
|
|
588
|
+
}
|
|
589
|
+
],
|
|
590
|
+
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/attached_functions/{name}/detach',
|
|
591
|
+
...options,
|
|
592
|
+
headers: {
|
|
593
|
+
'Content-Type': 'application/json',
|
|
594
|
+
...options?.headers
|
|
595
|
+
}
|
|
399
596
|
});
|
|
400
597
|
}
|
|
401
598
|
|
|
402
599
|
/**
|
|
403
|
-
*
|
|
600
|
+
* Attach function
|
|
601
|
+
* Attaches a function to a collection.
|
|
404
602
|
*/
|
|
405
|
-
public static
|
|
406
|
-
return (options
|
|
407
|
-
|
|
603
|
+
public static attachFunction<ThrowOnError extends boolean = true>(options: Options<AttachFunctionData, ThrowOnError>) {
|
|
604
|
+
return (options.client ?? _heyApiClient).post<AttachFunctionResponse2, AttachFunctionError, ThrowOnError>({
|
|
605
|
+
security: [
|
|
606
|
+
{
|
|
607
|
+
name: 'x-chroma-token',
|
|
608
|
+
type: 'apiKey'
|
|
609
|
+
}
|
|
610
|
+
],
|
|
611
|
+
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/functions/attach',
|
|
612
|
+
...options,
|
|
613
|
+
headers: {
|
|
614
|
+
'Content-Type': 'application/json',
|
|
615
|
+
...options?.headers
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* Get attached function
|
|
622
|
+
* Returns an attached function by name.
|
|
623
|
+
*/
|
|
624
|
+
public static getAttachedFunction<ThrowOnError extends boolean = true>(options: Options<GetAttachedFunctionData, ThrowOnError>) {
|
|
625
|
+
return (options.client ?? _heyApiClient).get<GetAttachedFunctionResponse2, GetAttachedFunctionError, ThrowOnError>({
|
|
626
|
+
security: [
|
|
627
|
+
{
|
|
628
|
+
name: 'x-chroma-token',
|
|
629
|
+
type: 'apiKey'
|
|
630
|
+
}
|
|
631
|
+
],
|
|
632
|
+
url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/functions/{function_name}',
|
|
408
633
|
...options
|
|
409
634
|
});
|
|
410
635
|
}
|