@relevanceai/sdk 1.3.0 → 1.8.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.
@@ -1,911 +0,0 @@
1
- /**
2
- * This file was auto-generated by openapi-typescript.
3
- * Do not make direct changes to the file.
4
- */
5
- export interface paths {
6
- "/datasets/{dataset_id}/documents/insert": {
7
- /**
8
- * When inserting the document you can specify your own id for a document by using the field name **"\_id"**.
9
- * For specifying your own vector use the suffix (ends with) **"\_vector\_"** for the field name.
10
- * e.g. "product\_description\_vector\_"
11
- */
12
- post: operations["Insert"];
13
- };
14
- "/datasets/{dataset_id}/documents/bulk_insert": {
15
- /**
16
- * When inserting documents you can specify your own id for a document by using the field name **"\_id"**.
17
- * For specifying your own vector use the suffix (ends with) **"\_vector\_"** for the field name.
18
- * e.g. "product\_description\_vector\_"
19
- */
20
- post: operations["BulkInsert"];
21
- };
22
- "/datasets/{dataset_id}/blob_access_urls": {
23
- /** Generate an upload and download url for temporary storing of large files. Used in conjunction with parse_blob to upload large datasets. */
24
- post: operations["BlobAccessURLs"];
25
- };
26
- "/datasets/{dataset_id}/parse_blob": {
27
- /** Bulk insert a large number of documents by downloading a file using "download url". This bypasses the need to directly send documents to the api, as happens in BulkInsert. */
28
- post: operations["ParseBlob"];
29
- };
30
- "/datasets/{dataset_id}/documents/update": {
31
- /** Edit by providing a key value pair of fields you are adding or changing. */
32
- post: operations["Update"];
33
- };
34
- "/datasets/{dataset_id}/documents/bulk_update": {
35
- /** Edits documents by providing a key value pair of fields you are adding or changing, make sure to include the "_id" in the documents. */
36
- post: operations["BulkUpdate"];
37
- };
38
- "/datasets/{dataset_id}/documents/update_where": {
39
- /** Updates documents by filters. The updates to make to the documents that is returned by a filter. The updates should be specified in a format of {"field_name": "value"}. e.g. {"item.status" : "Sold Out"} */
40
- post: operations["UpdateWhere"];
41
- };
42
- "/datasets/{dataset_id}/simple_search": {
43
- /**
44
- * All properties supported in the POST body can be set in query parameters when using GET method.
45
- * It returns the same response body SimpleSearchPost
46
- *
47
- *
48
- * For example:
49
- *
50
- * /latest/datasets/:dataset_id/simple_search?query=c&page=1&pageSize=1&fieldsToAggregate=["filter_field"]
51
- *
52
- *
53
- *
54
- * Integer and string properies such as query, page, pageSize should be directly included as query parameters.
55
- *
56
- * Object properties such as "fieldsToAggregate" should be stringified as JSON, then included as parameters.
57
- *
58
- *
59
- *
60
- * For example, in javascript, use the following code to add an object query parameter:
61
- *
62
- * "/latest/datasets/:dataset_id/simple_search?fieldsToAggregate="+JSON.stringify(["filter_field"])
63
- */
64
- get: operations["SimpleSearchGet"];
65
- /** SimpleSearch is an easy way to use vector search and traditional text matching to search your dataset. It also supports filtering, sorting and aggregating results. */
66
- post: operations["SimpleSearchPost"];
67
- };
68
- }
69
- export interface components {
70
- schemas: {
71
- InsertInput: {
72
- /** Whether to include insert date as a field 'insert_date_'. */
73
- insert_date?: boolean;
74
- /** Whether to overwrite document if it exists. */
75
- overwrite?: boolean;
76
- /** Whether the api should check the documents for vector datatype to update the schema. */
77
- update_schema?: boolean;
78
- /** Whether to return before all documents have finished updating. */
79
- wait_for_update?: boolean;
80
- /** Before insertion, fields of documents will be transformed according to this array of rules. If transformation fails, the output field will not be generated. */
81
- field_transformers?: {
82
- /** Field to transform. to transform a nested field, use a.b */
83
- field: string;
84
- /** If specified, place result in this field. To place in a nested field, use format a.b */
85
- output_field?: string;
86
- /** Whether to strip html tags from field. */
87
- remove_html?: boolean;
88
- /** Whether transform a text field into an array of text by splitting sentences. */
89
- split_sentences?: boolean;
90
- }[];
91
- /** A list of jobs to run once all documents are processed. */
92
- jobs_to_trigger?: {
93
- /** Specify this to run an encoding job after documents are processed. Supports chunk field encoding, encoding many fields, and storing results in a new field specified by alias. */
94
- encode?: {
95
- /** Chunk field to encode. Will produce a field with _chunkvector_ suffix. */
96
- chunk_field?: string;
97
- /** Regular fields to encode. Will produce a field with _vector suffix. */
98
- fields?: string[];
99
- /** If provided, this string will be added to the output field name. */
100
- alias?: string;
101
- /** Model name to use for encoding. */
102
- model_name?: string;
103
- };
104
- }[];
105
- /** Each document to upsert must have an _id field matching an existing document. */
106
- document?: {
107
- _id?: unknown;
108
- } & {
109
- [key: string]: unknown;
110
- };
111
- };
112
- InsertOutput: unknown;
113
- BulkInsertInput: {
114
- /** Whether to include insert date as a field 'insert_date_'. */
115
- insert_date?: boolean;
116
- /** Whether to overwrite document if it exists. */
117
- overwrite?: boolean;
118
- /** Whether the api should check the documents for vector datatype to update the schema. */
119
- update_schema?: boolean;
120
- /** Whether to return before all documents have finished updating. */
121
- wait_for_update?: boolean;
122
- /** Before insertion, fields of documents will be transformed according to this array of rules. If transformation fails, the output field will not be generated. */
123
- field_transformers?: {
124
- /** Field to transform. to transform a nested field, use a.b */
125
- field: string;
126
- /** If specified, place result in this field. To place in a nested field, use format a.b */
127
- output_field?: string;
128
- /** Whether to strip html tags from field. */
129
- remove_html?: boolean;
130
- /** Whether transform a text field into an array of text by splitting sentences. */
131
- split_sentences?: boolean;
132
- }[];
133
- /** A list of jobs to run once all documents are processed. */
134
- jobs_to_trigger?: {
135
- /** Specify this to run an encoding job after documents are processed. Supports chunk field encoding, encoding many fields, and storing results in a new field specified by alias. */
136
- encode?: {
137
- /** Chunk field to encode. Will produce a field with _chunkvector_ suffix. */
138
- chunk_field?: string;
139
- /** Regular fields to encode. Will produce a field with _vector suffix. */
140
- fields?: string[];
141
- /** If provided, this string will be added to the output field name. */
142
- alias?: string;
143
- /** Model name to use for encoding. */
144
- model_name?: string;
145
- };
146
- }[];
147
- documents?: ({
148
- _id?: unknown;
149
- } & {
150
- [key: string]: unknown;
151
- })[];
152
- };
153
- BulkInsertOutput: {
154
- /** Number of successfully processed documents. */
155
- inserted: number;
156
- /** Information about documents that were not processed successfully. */
157
- failed_documents: {
158
- /** _id field of unprocessed document. */
159
- _id?: unknown;
160
- error?: {
161
- /** http status code of individual document insertion operation. */
162
- status?: number;
163
- /** body response of individual document insertion operation. */
164
- body?: string;
165
- };
166
- }[];
167
- };
168
- BlobAccessURLsInput: unknown;
169
- BlobAccessURLsOutput: {
170
- /** Used to upload a blob of documents. */
171
- upload_blob_url: string;
172
- /** Used to download a blob of products. Used in the ParseBlob endpoint */
173
- download_blob_url: string;
174
- };
175
- ParseBlobInput: {
176
- /** Used to download the blob of documents. */
177
- blob_url: string;
178
- /** Whether the blob is in csv or json format. */
179
- format: "csv" | "json";
180
- /** replace _id with (_id||id)['$oid'], or JSON.stringify(_id||id) */
181
- process_id?: boolean;
182
- /** Only process rows of length skip_rows. */
183
- skip_rows?: number;
184
- };
185
- ParseBlobOutput: {
186
- status: string;
187
- /** Response message or error message. */
188
- message: string;
189
- /** Number of successfully inserted documents. */
190
- inserted?: number;
191
- /** Failed documents. */
192
- failed_documents?: unknown[];
193
- };
194
- UpdateInput: {
195
- /** _id of document to update. */
196
- id: unknown;
197
- /** Each document to upsert must have an _id field matching an existing document. */
198
- updates: {
199
- _id?: unknown;
200
- } & {
201
- [key: string]: unknown;
202
- };
203
- /** Whether to include insert date as a field 'insert_date_'. */
204
- insert_date?: boolean;
205
- /** Whether to return before all documents have finished updating. */
206
- wait_for_update?: boolean;
207
- /** Before insertion, fields of documents will be transformed according to this array of rules. If transformation fails, the output field will not be generated. */
208
- field_transformers?: {
209
- /** Field to transform. to transform a nested field, use a.b */
210
- field: string;
211
- /** If specified, place result in this field. To place in a nested field, use format a.b */
212
- output_field?: string;
213
- /** Whether to strip html tags from field. */
214
- remove_html?: boolean;
215
- /** Whether transform a text field into an array of text by splitting sentences. */
216
- split_sentences?: boolean;
217
- }[];
218
- };
219
- UpdateOutput: {
220
- /** Completion status. */
221
- status: string;
222
- /** Response message for completion state. */
223
- message: string;
224
- };
225
- BulkUpdateInput: {
226
- /** List of updates to apply to documents. Each update item must contain an _id. */
227
- updates: ({
228
- _id?: unknown;
229
- } & {
230
- [key: string]: unknown;
231
- })[];
232
- /** Whether to include insert date as a field 'insert_date_'. */
233
- insert_date?: boolean;
234
- /** Whether to return before all documents have finished updating. */
235
- wait_for_update?: boolean;
236
- /** Before insertion, fields of documents will be transformed according to this array of rules. If transformation fails, the output field will not be generated. */
237
- field_transformers?: {
238
- /** Field to transform. to transform a nested field, use a.b */
239
- field: string;
240
- /** If specified, place result in this field. To place in a nested field, use format a.b */
241
- output_field?: string;
242
- /** Whether to strip html tags from field. */
243
- remove_html?: boolean;
244
- /** Whether transform a text field into an array of text by splitting sentences. */
245
- split_sentences?: boolean;
246
- }[];
247
- };
248
- BulkUpdateOutput: {
249
- /** Number of successfully processed documents. */
250
- inserted: number;
251
- /** Information about documents that were not processed successfully. */
252
- failed_documents: {
253
- /** _id field of unprocessed document. */
254
- _id?: unknown;
255
- error?: {
256
- /** http status code of individual document insertion operation. */
257
- status?: number;
258
- /** body response of individual document insertion operation. */
259
- body?: string;
260
- };
261
- }[];
262
- };
263
- UpdateWhereInput: {
264
- /** Updates to make to the documents. It should be specified in a format of {"field_name": "value"}. e.g. {"item.status" : "Sold Out"} */
265
- updates: {
266
- [key: string]: unknown;
267
- };
268
- /** Array of objects. Each objects fields must match a documents corresponding field for a match */
269
- filters?: {
270
- [key: string]: unknown;
271
- }[];
272
- };
273
- UpdateWhereOutput: {
274
- /** Completion status. */
275
- status: string;
276
- /** Response message for completion state. */
277
- message: string;
278
- };
279
- /**
280
- * Control which fields aggregate data will be generated for. Aggregate data will appear in the "aggregations" property of the response body.
281
- *
282
- * Each list element can be a string like "name" or a dictionary like {"key":"name","resultsSize":11}
283
- *
284
- * Default: []
285
- *
286
- * Example: ["name","price","likes_cats",{"key":"color","resultsSize":20}]
287
- */
288
- fieldsToAggregate: (string | {
289
- /** Field to aggregate. */
290
- key: string;
291
- /** Number top aggregate results to return. */
292
- resultsSize?: number;
293
- fieldsToAggregate?: components["schemas"]["fieldsToAggregate"];
294
- })[];
295
- vectorSearchQuery: {
296
- /** Vector name to search on. For example, title_vector_ */
297
- field: string;
298
- /** Query to transform to a vector and then search with. Default to query in the root body if not provided. */
299
- query?: string;
300
- /** Model name to generate the vector with. */
301
- model?: string;
302
- /** Model url to use for encoding. If model and model_url are both set, model_url will override it. */
303
- model_url?: string;
304
- /** Increases or decreases the impact of this vector fields match on documents relevance score. */
305
- weight?: number;
306
- chunkConfig?: {
307
- chunkField: string;
308
- page?: number;
309
- pageSize?: number;
310
- };
311
- };
312
- filterListItem: {
313
- /** Match where document[key] is in value list. */
314
- match?: {
315
- /** Field to match on. */
316
- key: string;
317
- /** List of items that to match on. */
318
- value: unknown[];
319
- };
320
- /** Match documents where greaterThan < document[key] < lessThan. Supports numbers and date strings. */
321
- range?: {
322
- /** Field to match on. */
323
- key: string;
324
- greaterThan?: unknown;
325
- lessThan?: unknown;
326
- };
327
- wildcard?: {
328
- /** Field to match on. */
329
- key: string;
330
- /** array of valid wildcard strings to match on, for example ['tele*'] */
331
- value: string[];
332
- };
333
- /** Match documents where document[a] <=/>=/</>/==/!= document[b]. */
334
- selfreference?: {
335
- /** First field in comparison. */
336
- a: string;
337
- /** Second field in comparison. */
338
- b: string;
339
- /** Operator used to compare a and b. */
340
- operation: "<=" | ">=" | "<" | ">" | "==" | "!=";
341
- };
342
- /** Used to perform a logical OR of filters. each element of the OR list can itself be a list to perform a nested AND. {or:[[A,B],C]} is equivalent to (A AND B) OR C */
343
- or?: (components["schemas"]["filterListItem"][] | components["schemas"]["filterListItem"])[];
344
- /** Used to perform NOT filter. Can be a single filter or a list of filters to perform a !(AND). {not:[A,B]} is equivalent to !(A AND B) */
345
- not?: components["schemas"]["filterListItem"][] | components["schemas"]["filterListItem"];
346
- };
347
- relevanceBoosterItem: {
348
- /** Match where document[key] is in value list. */
349
- match?: {
350
- /** Field to match on. */
351
- key: string;
352
- /** List of items that to match on. */
353
- value: unknown[];
354
- };
355
- /** Match documents where greaterThan < document[key] < lessThan. Supports numbers and date strings. */
356
- range?: {
357
- /** Field to match on. */
358
- key: string;
359
- greaterThan?: unknown;
360
- lessThan?: unknown;
361
- };
362
- wildcard?: {
363
- /** Field to match on. */
364
- key: string;
365
- /** array of valid wildcard strings to match on, for example ['tele*'] */
366
- value: string[];
367
- };
368
- /** Match documents where document[a] <=/>=/</>/==/!= document[b]. */
369
- selfreference?: {
370
- /** First field in comparison. */
371
- a: string;
372
- /** Second field in comparison. */
373
- b: string;
374
- /** Operator used to compare a and b. */
375
- operation: "<=" | ">=" | "<" | ">" | "==" | "!=";
376
- };
377
- /** Used to perform a logical OR of filters. each element of the OR list can itself be a list to perform a nested AND. {or:[[A,B],C]} is equivalent to (A AND B) OR C */
378
- or?: (components["schemas"]["filterListItem"][] | components["schemas"]["filterListItem"])[];
379
- /** Used to perform NOT filter. Can be a single filter or a list of filters to perform a !(AND). {not:[A,B]} is equivalent to !(A AND B) */
380
- not?: components["schemas"]["filterListItem"][] | components["schemas"]["filterListItem"];
381
- /** Multiplies the relevance contribution of this condition. */
382
- weight?: number;
383
- };
384
- SimpleSearchPostInput: {
385
- /**
386
- * Search for documents that contain this query string in your dataset. Use fieldsToSearch parameter to restrict which fields are searched.
387
- *
388
- * "tele" matches "Television", "This television is an excellent product…"
389
- *
390
- * Example: "tele"
391
- */
392
- query?: string;
393
- /** Configuration for traditional search query. */
394
- queryConfig?: {
395
- /** Increases or decreases the impact of traditional search when calculating a documents _relevance. new_traditional_relevance = traditional_relevance*queryConfig.weight */
396
- weight?: number;
397
- };
398
- /**
399
- * Prioritise the result list of documents based on semantic similarity to "query" provided here.
400
- *
401
- * For example if field "animaltype_vector_" contains encoded vector values for "cat", lion, "dog","bird", and "query" is set to "kitten", documents with "cat", "lion" will be returned first in the results list.
402
- *
403
- * It can be an object or a list of objects.
404
- *
405
- *
406
- *
407
- * Example payloads:
408
- *
409
- * {"field":"animaltype_vector_","query":"kitten"}
410
- *
411
- * [
412
- *
413
- * {"field":"animaltype_vector_","query":"kitten","weight":1","model":"text"}, {"field":"animaltype_vector_","query":"https://www.dogimage.com/dogimage.png","model":"image","weight":2}
414
- *
415
- * ]
416
- */
417
- vectorSearchQuery?: components["schemas"]["vectorSearchQuery"] | components["schemas"]["vectorSearchQuery"][];
418
- /**
419
- * A list of fields to search using the "query" parameter.
420
- *
421
- * Each item can be field name as a string, or an object with 'key' as field name and optional parameters such as field weight.
422
- *
423
- * Default behaviour is to search all fields.
424
- *
425
- * Example: ["name",{"key":"favourite_color","weight":0.2}]
426
- */
427
- fieldsToSearch?: (string | {
428
- /** Field name to search. */
429
- key: string;
430
- /** Multiply the relevance contribution of a specific field when using traditional search. */
431
- weight?: number;
432
- })[];
433
- /**
434
- * Page of results to return.
435
- * Returns results from position page*pageSize to (page+1)*pageSize
436
- *
437
- * Default: 0
438
- *
439
- * Example: 3
440
- */
441
- page?: number;
442
- /**
443
- * Page size of results to return.
444
- * Returns results from position page*pageSize to (page+1)*pageSize
445
- *
446
- * Default: 10
447
- *
448
- * Example: 25
449
- */
450
- pageSize?: number;
451
- /**
452
- * Only return documents with a _relevance above this threshold.
453
- *
454
- * Example: 0.3
455
- */
456
- minimumRelevance?: number;
457
- /**
458
- * Use the datasets schema to remove parameters that are unsafe before making a request.
459
- *
460
- * For example, fieldsToAggregateStats only supports numeric fields. if this flag is set, all non numeric fields will be removed from fieldsToAggregateStats.
461
- *
462
- * Example: true
463
- */
464
- cleanPayloadUsingSchema?: boolean;
465
- /**
466
- * Prioritise results based on integer, float and boolean fields values. Can sort ascending or descending.
467
- *
468
- * Example 1: {"on_sale":"desc"}
469
- *
470
- * Example 2: {"price":"asc"}
471
- */
472
- sort?: {
473
- [key: string]: "asc" | "desc";
474
- };
475
- /**
476
- * Only return fields of documents listed in this array.
477
- *
478
- * Example: ["name","description_vector_"]
479
- */
480
- includeFields?: string[];
481
- /**
482
- * Don't return fields of documents listed in this array.
483
- *
484
- * Example: ["name","description_vector"]
485
- */
486
- excludeFields?: string[];
487
- /**
488
- * Set to true to return all vector fields. includeFields / excludeFields has priority over this rule.
489
- *
490
- * Example: true / false
491
- */
492
- includeVectors?: boolean;
493
- /**
494
- * Prioritise results based on integer, float and boolean fields values. Can sort ascending or descending.
495
- *
496
- * Example 1: {"on_sale":"desc"}
497
- *
498
- * Example 2: {"price":"asc"}
499
- */
500
- textSort?: {
501
- [key: string]: "asc" | "desc";
502
- };
503
- fieldsToAggregate?: components["schemas"]["fieldsToAggregate"];
504
- /**
505
- * Control which fields aggregate stats data will be generated for. This includes, min value, max value, average value, and document counts per interval within the dataset.
506
- *
507
- * Aggregate data will appear in the "aggregateStats" property of the response body.
508
- *
509
- * Each list item can be:
510
- *
511
- * a string stating which field to aggregate stats on
512
- *
513
- * An object containing "key" to pick a field, and "interval" to control the range of each bucket when counting documents:
514
- *
515
- * For example, if we had products {"price":50},{"price:"150"},{price:"180"},{"key":"price","interval":100} would split results into 2 buckets.
516
- *
517
- * Default: []
518
- * Example: ["postcode",{"key":"price","interval":10}]
519
- */
520
- fieldsToAggregateStats?: (string | {
521
- /** Field to return stats for in aggregateStats. */
522
- key: string;
523
- /** Interval gap when building a histogram. An interval of 2 will count documents in range 0-2,2-4,4-6... */
524
- interval?: number;
525
- })[];
526
- /**
527
- * Only Include results that match on this list of filters.
528
- *
529
- * "match" property of filters requires "key" to control which field to match on, and an array of items in "value" to dictate exact match values.
530
- *
531
- * "range" property of filters requires "key" to control which field to match on, and "greaterThan" and/or "lessThan", which must be a number or a date string.
532
- *
533
- * "wildcard" property of filters requires "key" to control which field to match on, and an array of items in "value" to control wildcard match pattern. It may include * to match any string of characters, and ? To match one character.
534
- *
535
- * "or" property of filters requires either: a list of ( subfilters / list of subfilters) etc. [{"match":...},[{"match":...},{"range":...}]].At least one of the subfilters must evaluate to true. If a subfilter is an array, it performs an AND over the sub-sub-filters. For example, [filter1,[filter2,filter3]] is equivalent to filter1 OR (filter2 AND filter3).
536
- *
537
- * Example:
538
- * [
539
- *
540
- * {
541
- *
542
- * "match":{
543
- *
544
- * "key":"name",
545
- *
546
- * "value":["television"]
547
- *
548
- * }
549
- *
550
- * },
551
- *
552
- * {
553
- *
554
- * "wildcard":{
555
- *
556
- * "key":"name",
557
- *
558
- * "value":["television*"]
559
- *
560
- * }
561
- *
562
- * },
563
- *
564
- *
565
- *
566
- * {
567
- *
568
- * "range":{
569
- *
570
- * "key":"price",
571
- *
572
- * "greaterThan":5.5,
573
- *
574
- * "lessThan":20
575
- *
576
- * }
577
- *
578
- * },
579
- *
580
- * {
581
- *
582
- * "range":{
583
- *
584
- * "key":"postcode",
585
- *
586
- * "greaterThan":2000
587
- *
588
- * }
589
- *
590
- * },
591
- *
592
- * {
593
- *
594
- * "match":{
595
- *
596
- * "key":"likes_dogs",
597
- *
598
- * "value":[true]
599
- *
600
- * }
601
- *
602
- * },
603
- *
604
- * {
605
- *
606
- * "or": [ {"match":{"key":"name","value":["dog"]}},[{"match":{"key":"name","value":["cat"]}},{"wildcard":{"key":"color","value"["orange"]}] ]
607
- *
608
- * },
609
- *
610
- *
611
- *
612
- * ]
613
- */
614
- filters?: components["schemas"]["filterListItem"][];
615
- /** Add relevance to documents if they match conditions in this list. configure 'weight' on each condition to modify the relevance contribution. */
616
- relevanceBoosters?: components["schemas"]["relevanceBoosterItem"][];
617
- };
618
- /** Aggregate output. Recursive aggregate output is returned here. */
619
- outputAggregations: {
620
- [key: string]: {
621
- /** Most common field values and their counts. */
622
- results: {
623
- [key: string]: number;
624
- };
625
- aggregates: components["schemas"]["outputAggregations"];
626
- };
627
- };
628
- SimpleSearchPostOutput: {
629
- /**
630
- * List of documents. List items are affected by page, pageSize, query, filters. Items order is affected by vectorSeachQuery, sort, textSort.
631
- *
632
- * Example: [{"_id":"abcd","animal":"cat","price":10}, {"_id":"abcd","price":13}]
633
- */
634
- results: {
635
- /** Measures how closely a document matches on query and vectorSearchQuery. */
636
- _relevance: number;
637
- _chunk_results?: {
638
- [key: string]: {
639
- results: {
640
- _relevance?: number;
641
- }[];
642
- _relevance: number;
643
- };
644
- };
645
- }[];
646
- /**
647
- * Total number of documents matched in the dataset.
648
- *
649
- * Example: 100
650
- */
651
- resultsSize: number;
652
- aggregates: components["schemas"]["outputAggregations"];
653
- /**
654
- * Dictionary of most common field values specified in "fieldsToAggregate".
655
- *
656
- * Example: {"color":{"red":15,"blue":7,"green":1},"name":{"roger":10000,"bill":500,"jo":200}}
657
- */
658
- aggregations: {
659
- [key: string]: {
660
- [key: string]: number;
661
- };
662
- };
663
- /**
664
- * Dictionary of field stats.
665
- *
666
- * Fields to summarise is specified in "fieldsToAggregateStats" of request body.
667
- *
668
- * Example: {"price":{"min":0.5,"max":2000,"avg":100,sum:"40230032","results":{"0":202,"100":43,"200":16}}}
669
- */
670
- aggregateStats: {
671
- [key: string]: {
672
- /** Maximum value of field. */
673
- max: number;
674
- /** Minimum value of field. */
675
- min: number;
676
- /** Average value of field. */
677
- avg: number;
678
- /** Sum of all field values. */
679
- sum: number;
680
- };
681
- };
682
- };
683
- SimpleSearchGetInput: unknown;
684
- SimpleSearchGetOutput: unknown;
685
- };
686
- }
687
- export interface operations {
688
- /**
689
- * When inserting the document you can specify your own id for a document by using the field name **"\_id"**.
690
- * For specifying your own vector use the suffix (ends with) **"\_vector\_"** for the field name.
691
- * e.g. "product\_description\_vector\_"
692
- */
693
- Insert: {
694
- parameters: {
695
- path: {
696
- /** ID of dataset */
697
- dataset_id: string;
698
- };
699
- };
700
- responses: {
701
- /** successful operation */
702
- 200: {
703
- content: {
704
- "application/json": components["schemas"]["InsertOutput"];
705
- };
706
- };
707
- };
708
- requestBody: {
709
- content: {
710
- "application/json": components["schemas"]["InsertInput"];
711
- };
712
- };
713
- };
714
- /**
715
- * When inserting documents you can specify your own id for a document by using the field name **"\_id"**.
716
- * For specifying your own vector use the suffix (ends with) **"\_vector\_"** for the field name.
717
- * e.g. "product\_description\_vector\_"
718
- */
719
- BulkInsert: {
720
- parameters: {
721
- path: {
722
- /** ID of dataset */
723
- dataset_id: string;
724
- };
725
- };
726
- responses: {
727
- /** successful operation */
728
- 200: {
729
- content: {
730
- "application/json": components["schemas"]["BulkInsertOutput"];
731
- };
732
- };
733
- };
734
- requestBody: {
735
- content: {
736
- "application/json": components["schemas"]["BulkInsertInput"];
737
- };
738
- };
739
- };
740
- /** Generate an upload and download url for temporary storing of large files. Used in conjunction with parse_blob to upload large datasets. */
741
- BlobAccessURLs: {
742
- parameters: {
743
- path: {
744
- /** ID of dataset */
745
- dataset_id: string;
746
- };
747
- };
748
- responses: {
749
- /** successful operation */
750
- 200: {
751
- content: {
752
- "application/json": components["schemas"]["BlobAccessURLsOutput"];
753
- };
754
- };
755
- };
756
- requestBody: {
757
- content: {
758
- "application/json": components["schemas"]["BlobAccessURLsInput"];
759
- };
760
- };
761
- };
762
- /** Bulk insert a large number of documents by downloading a file using "download url". This bypasses the need to directly send documents to the api, as happens in BulkInsert. */
763
- ParseBlob: {
764
- parameters: {
765
- path: {
766
- /** ID of dataset */
767
- dataset_id: string;
768
- };
769
- };
770
- responses: {
771
- /** successful operation */
772
- 200: {
773
- content: {
774
- "application/json": components["schemas"]["ParseBlobOutput"];
775
- };
776
- };
777
- };
778
- requestBody: {
779
- content: {
780
- "application/json": components["schemas"]["ParseBlobInput"];
781
- };
782
- };
783
- };
784
- /** Edit by providing a key value pair of fields you are adding or changing. */
785
- Update: {
786
- parameters: {
787
- path: {
788
- /** ID of dataset */
789
- dataset_id: string;
790
- };
791
- };
792
- responses: {
793
- /** successful operation */
794
- 200: {
795
- content: {
796
- "application/json": components["schemas"]["UpdateOutput"];
797
- };
798
- };
799
- };
800
- requestBody: {
801
- content: {
802
- "application/json": components["schemas"]["UpdateInput"];
803
- };
804
- };
805
- };
806
- /** Edits documents by providing a key value pair of fields you are adding or changing, make sure to include the "_id" in the documents. */
807
- BulkUpdate: {
808
- parameters: {
809
- path: {
810
- /** ID of dataset */
811
- dataset_id: string;
812
- };
813
- };
814
- responses: {
815
- /** successful operation */
816
- 200: {
817
- content: {
818
- "application/json": components["schemas"]["BulkUpdateOutput"];
819
- };
820
- };
821
- };
822
- requestBody: {
823
- content: {
824
- "application/json": components["schemas"]["BulkUpdateInput"];
825
- };
826
- };
827
- };
828
- /** Updates documents by filters. The updates to make to the documents that is returned by a filter. The updates should be specified in a format of {"field_name": "value"}. e.g. {"item.status" : "Sold Out"} */
829
- UpdateWhere: {
830
- parameters: {
831
- path: {
832
- /** ID of dataset */
833
- dataset_id: string;
834
- };
835
- };
836
- responses: {
837
- /** successful operation */
838
- 200: {
839
- content: {
840
- "application/json": components["schemas"]["UpdateWhereOutput"];
841
- };
842
- };
843
- };
844
- requestBody: {
845
- content: {
846
- "application/json": components["schemas"]["UpdateWhereInput"];
847
- };
848
- };
849
- };
850
- /**
851
- * All properties supported in the POST body can be set in query parameters when using GET method.
852
- * It returns the same response body SimpleSearchPost
853
- *
854
- *
855
- * For example:
856
- *
857
- * /latest/datasets/:dataset_id/simple_search?query=c&page=1&pageSize=1&fieldsToAggregate=["filter_field"]
858
- *
859
- *
860
- *
861
- * Integer and string properies such as query, page, pageSize should be directly included as query parameters.
862
- *
863
- * Object properties such as "fieldsToAggregate" should be stringified as JSON, then included as parameters.
864
- *
865
- *
866
- *
867
- * For example, in javascript, use the following code to add an object query parameter:
868
- *
869
- * "/latest/datasets/:dataset_id/simple_search?fieldsToAggregate="+JSON.stringify(["filter_field"])
870
- */
871
- SimpleSearchGet: {
872
- parameters: {
873
- path: {
874
- /** ID of dataset */
875
- dataset_id: string;
876
- };
877
- };
878
- responses: {
879
- /** successful operation */
880
- 200: {
881
- content: {
882
- "application/json": components["schemas"]["SimpleSearchGetOutput"];
883
- };
884
- };
885
- };
886
- };
887
- /** SimpleSearch is an easy way to use vector search and traditional text matching to search your dataset. It also supports filtering, sorting and aggregating results. */
888
- SimpleSearchPost: {
889
- parameters: {
890
- path: {
891
- /** ID of dataset */
892
- dataset_id: string;
893
- };
894
- };
895
- responses: {
896
- /** successful operation */
897
- 200: {
898
- content: {
899
- "application/json": components["schemas"]["SimpleSearchPostOutput"];
900
- };
901
- };
902
- };
903
- requestBody: {
904
- content: {
905
- "application/json": components["schemas"]["SimpleSearchPostInput"];
906
- };
907
- };
908
- };
909
- }
910
- export interface external {
911
- }