@elastic/elasticsearch 8.17.1 → 8.18.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.
Files changed (110) hide show
  1. package/lib/api/api/async_search.d.ts +5 -5
  2. package/lib/api/api/autoscaling.d.ts +4 -4
  3. package/lib/api/api/bulk.d.ts +1 -1
  4. package/lib/api/api/cat.d.ts +26 -26
  5. package/lib/api/api/ccr.d.ts +14 -14
  6. package/lib/api/api/ccr.js +1 -1
  7. package/lib/api/api/ccr.js.map +1 -1
  8. package/lib/api/api/clear_scroll.d.ts +1 -1
  9. package/lib/api/api/close_point_in_time.d.ts +1 -1
  10. package/lib/api/api/cluster.d.ts +17 -17
  11. package/lib/api/api/connector.d.ts +30 -30
  12. package/lib/api/api/count.d.ts +1 -1
  13. package/lib/api/api/create.d.ts +2 -2
  14. package/lib/api/api/dangling_indices.d.ts +3 -3
  15. package/lib/api/api/delete.d.ts +1 -1
  16. package/lib/api/api/delete_by_query.d.ts +1 -1
  17. package/lib/api/api/delete_by_query_rethrottle.d.ts +1 -1
  18. package/lib/api/api/delete_script.d.ts +1 -1
  19. package/lib/api/api/enrich.d.ts +5 -5
  20. package/lib/api/api/eql.d.ts +4 -4
  21. package/lib/api/api/eql.js +1 -1
  22. package/lib/api/api/eql.js.map +1 -1
  23. package/lib/api/api/esql.d.ts +11 -4
  24. package/lib/api/api/esql.js +24 -1
  25. package/lib/api/api/esql.js.map +1 -1
  26. package/lib/api/api/exists.d.ts +1 -1
  27. package/lib/api/api/exists_source.d.ts +1 -1
  28. package/lib/api/api/explain.d.ts +1 -1
  29. package/lib/api/api/features.d.ts +2 -2
  30. package/lib/api/api/field_caps.d.ts +1 -1
  31. package/lib/api/api/fleet.d.ts +4 -2
  32. package/lib/api/api/fleet.js.map +1 -1
  33. package/lib/api/api/get.d.ts +1 -1
  34. package/lib/api/api/get_script.d.ts +1 -1
  35. package/lib/api/api/get_script_context.d.ts +1 -1
  36. package/lib/api/api/get_script_languages.d.ts +1 -1
  37. package/lib/api/api/get_source.d.ts +1 -1
  38. package/lib/api/api/graph.d.ts +1 -1
  39. package/lib/api/api/health_report.d.ts +1 -1
  40. package/lib/api/api/ilm.d.ts +11 -11
  41. package/lib/api/api/index.d.ts +2 -2
  42. package/lib/api/api/indices.d.ts +98 -70
  43. package/lib/api/api/indices.js +116 -3
  44. package/lib/api/api/indices.js.map +1 -1
  45. package/lib/api/api/inference.d.ts +157 -10
  46. package/lib/api/api/inference.js +802 -25
  47. package/lib/api/api/inference.js.map +1 -1
  48. package/lib/api/api/info.d.ts +1 -1
  49. package/lib/api/api/ingest.d.ts +12 -12
  50. package/lib/api/api/knn_search.d.ts +1 -1
  51. package/lib/api/api/license.d.ts +8 -8
  52. package/lib/api/api/logstash.d.ts +3 -3
  53. package/lib/api/api/mget.d.ts +1 -1
  54. package/lib/api/api/migration.d.ts +3 -3
  55. package/lib/api/api/ml.d.ts +78 -78
  56. package/lib/api/api/ml.js +17 -3
  57. package/lib/api/api/ml.js.map +1 -1
  58. package/lib/api/api/monitoring.d.ts +1 -1
  59. package/lib/api/api/msearch.d.ts +1 -1
  60. package/lib/api/api/msearch_template.d.ts +1 -1
  61. package/lib/api/api/mtermvectors.d.ts +1 -1
  62. package/lib/api/api/nodes.d.ts +7 -7
  63. package/lib/api/api/open_point_in_time.d.ts +1 -1
  64. package/lib/api/api/ping.d.ts +1 -1
  65. package/lib/api/api/profiling.d.ts +4 -4
  66. package/lib/api/api/put_script.d.ts +1 -1
  67. package/lib/api/api/query_rules.d.ts +8 -8
  68. package/lib/api/api/rank_eval.d.ts +1 -1
  69. package/lib/api/api/reindex.d.ts +2 -2
  70. package/lib/api/api/reindex_rethrottle.d.ts +1 -1
  71. package/lib/api/api/render_search_template.d.ts +1 -1
  72. package/lib/api/api/rollup.d.ts +8 -8
  73. package/lib/api/api/scripts_painless_execute.d.ts +2 -2
  74. package/lib/api/api/scroll.d.ts +1 -1
  75. package/lib/api/api/search.d.ts +1 -1
  76. package/lib/api/api/search_application.d.ts +10 -10
  77. package/lib/api/api/search_mvt.d.ts +1 -1
  78. package/lib/api/api/search_shards.d.ts +1 -1
  79. package/lib/api/api/search_template.d.ts +1 -1
  80. package/lib/api/api/searchable_snapshots.d.ts +4 -4
  81. package/lib/api/api/security.d.ts +64 -64
  82. package/lib/api/api/security.js +1 -1
  83. package/lib/api/api/security.js.map +1 -1
  84. package/lib/api/api/shutdown.d.ts +3 -3
  85. package/lib/api/api/simulate.d.ts +1 -1
  86. package/lib/api/api/simulate.js +1 -1
  87. package/lib/api/api/simulate.js.map +1 -1
  88. package/lib/api/api/slm.d.ts +9 -9
  89. package/lib/api/api/snapshot.d.ts +13 -13
  90. package/lib/api/api/sql.d.ts +6 -6
  91. package/lib/api/api/ssl.d.ts +1 -1
  92. package/lib/api/api/synonyms.d.ts +7 -7
  93. package/lib/api/api/tasks.d.ts +3 -3
  94. package/lib/api/api/terms_enum.d.ts +1 -1
  95. package/lib/api/api/termvectors.d.ts +1 -1
  96. package/lib/api/api/termvectors.js +1 -1
  97. package/lib/api/api/termvectors.js.map +1 -1
  98. package/lib/api/api/text_structure.d.ts +4 -4
  99. package/lib/api/api/transform.d.ts +18 -18
  100. package/lib/api/api/update.d.ts +1 -1
  101. package/lib/api/api/update_by_query.d.ts +1 -1
  102. package/lib/api/api/update_by_query_rethrottle.d.ts +1 -1
  103. package/lib/api/api/watcher.d.ts +14 -14
  104. package/lib/api/api/xpack.d.ts +2 -2
  105. package/lib/api/types.d.ts +777 -114
  106. package/lib/api/typesWithBodyKey.d.ts +846 -117
  107. package/lib/client.d.ts +1 -1
  108. package/lib/client.js +17 -1
  109. package/lib/client.js.map +1 -1
  110. package/package.json +7 -8
@@ -28,6 +28,73 @@ class Inference {
28
28
  });
29
29
  this.transport = transport;
30
30
  }
31
+ async chatCompletionUnified(params, options) {
32
+ var _a;
33
+ const acceptedPath = ['inference_id'];
34
+ const acceptedBody = ['chat_completion_request'];
35
+ const querystring = {};
36
+ // @ts-expect-error
37
+ let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
38
+ for (const key in params) {
39
+ if (acceptedBody.includes(key)) {
40
+ // @ts-expect-error
41
+ body = params[key];
42
+ }
43
+ else if (acceptedPath.includes(key)) {
44
+ continue;
45
+ }
46
+ else if (key !== 'body') {
47
+ // @ts-expect-error
48
+ querystring[key] = params[key];
49
+ }
50
+ }
51
+ const method = 'POST';
52
+ const path = `/_inference/chat_completion/${encodeURIComponent(params.inference_id.toString())}/_stream`;
53
+ const meta = {
54
+ name: 'inference.chat_completion_unified',
55
+ pathParts: {
56
+ inference_id: params.inference_id
57
+ }
58
+ };
59
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
60
+ }
61
+ async completion(params, options) {
62
+ const acceptedPath = ['inference_id'];
63
+ const acceptedBody = ['input', 'task_settings'];
64
+ const querystring = {};
65
+ // @ts-expect-error
66
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
67
+ let body;
68
+ if (typeof userBody === 'string') {
69
+ body = userBody;
70
+ }
71
+ else {
72
+ body = userBody != null ? { ...userBody } : undefined;
73
+ }
74
+ for (const key in params) {
75
+ if (acceptedBody.includes(key)) {
76
+ body = body !== null && body !== void 0 ? body : {};
77
+ // @ts-expect-error
78
+ body[key] = params[key];
79
+ }
80
+ else if (acceptedPath.includes(key)) {
81
+ continue;
82
+ }
83
+ else if (key !== 'body') {
84
+ // @ts-expect-error
85
+ querystring[key] = params[key];
86
+ }
87
+ }
88
+ const method = 'POST';
89
+ const path = `/_inference/completion/${encodeURIComponent(params.inference_id.toString())}`;
90
+ const meta = {
91
+ name: 'inference.completion',
92
+ pathParts: {
93
+ inference_id: params.inference_id
94
+ }
95
+ };
96
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
97
+ }
31
98
  async delete(params, options) {
32
99
  const acceptedPath = ['task_type', 'inference_id'];
33
100
  const querystring = {};
@@ -182,9 +249,9 @@ class Inference {
182
249
  };
183
250
  return await this.transport.request({ path, method, querystring, body, meta }, options);
184
251
  }
185
- async streamInference(params, options) {
186
- const acceptedPath = ['inference_id', 'task_type'];
187
- const acceptedBody = ['input'];
252
+ async putAlibabacloud(params, options) {
253
+ const acceptedPath = ['task_type', 'alibabacloud_inference_id'];
254
+ const acceptedBody = ['chunking_settings', 'service', 'service_settings', 'task_settings'];
188
255
  const querystring = {};
189
256
  // @ts-expect-error
190
257
  const userBody = params === null || params === void 0 ? void 0 : params.body;
@@ -209,36 +276,73 @@ class Inference {
209
276
  querystring[key] = params[key];
210
277
  }
211
278
  }
212
- let method = '';
213
- let path = '';
214
- if (params.task_type != null && params.inference_id != null) {
215
- method = 'POST';
216
- path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.inference_id.toString())}/_stream`;
279
+ const method = 'PUT';
280
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.alibabacloud_inference_id.toString())}`;
281
+ const meta = {
282
+ name: 'inference.put_alibabacloud',
283
+ pathParts: {
284
+ task_type: params.task_type,
285
+ alibabacloud_inference_id: params.alibabacloud_inference_id
286
+ }
287
+ };
288
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
289
+ }
290
+ async putAmazonbedrock(params, options) {
291
+ const acceptedPath = ['task_type', 'amazonbedrock_inference_id'];
292
+ const acceptedBody = ['chunking_settings', 'service', 'service_settings', 'task_settings'];
293
+ const querystring = {};
294
+ // @ts-expect-error
295
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
296
+ let body;
297
+ if (typeof userBody === 'string') {
298
+ body = userBody;
217
299
  }
218
300
  else {
219
- method = 'POST';
220
- path = `/_inference/${encodeURIComponent(params.inference_id.toString())}/_stream`;
301
+ body = userBody != null ? { ...userBody } : undefined;
302
+ }
303
+ for (const key in params) {
304
+ if (acceptedBody.includes(key)) {
305
+ body = body !== null && body !== void 0 ? body : {};
306
+ // @ts-expect-error
307
+ body[key] = params[key];
308
+ }
309
+ else if (acceptedPath.includes(key)) {
310
+ continue;
311
+ }
312
+ else if (key !== 'body') {
313
+ // @ts-expect-error
314
+ querystring[key] = params[key];
315
+ }
221
316
  }
317
+ const method = 'PUT';
318
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.amazonbedrock_inference_id.toString())}`;
222
319
  const meta = {
223
- name: 'inference.stream_inference',
320
+ name: 'inference.put_amazonbedrock',
224
321
  pathParts: {
225
- inference_id: params.inference_id,
226
- task_type: params.task_type
322
+ task_type: params.task_type,
323
+ amazonbedrock_inference_id: params.amazonbedrock_inference_id
227
324
  }
228
325
  };
229
326
  return await this.transport.request({ path, method, querystring, body, meta }, options);
230
327
  }
231
- async update(params, options) {
232
- var _a;
233
- const acceptedPath = ['inference_id', 'task_type'];
234
- const acceptedBody = ['inference_config'];
328
+ async putAnthropic(params, options) {
329
+ const acceptedPath = ['task_type', 'anthropic_inference_id'];
330
+ const acceptedBody = ['chunking_settings', 'service', 'service_settings', 'task_settings'];
235
331
  const querystring = {};
236
332
  // @ts-expect-error
237
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
333
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
334
+ let body;
335
+ if (typeof userBody === 'string') {
336
+ body = userBody;
337
+ }
338
+ else {
339
+ body = userBody != null ? { ...userBody } : undefined;
340
+ }
238
341
  for (const key in params) {
239
342
  if (acceptedBody.includes(key)) {
343
+ body = body !== null && body !== void 0 ? body : {};
240
344
  // @ts-expect-error
241
- body = params[key];
345
+ body[key] = params[key];
242
346
  }
243
347
  else if (acceptedPath.includes(key)) {
244
348
  continue;
@@ -248,14 +352,687 @@ class Inference {
248
352
  querystring[key] = params[key];
249
353
  }
250
354
  }
251
- let method = '';
252
- let path = '';
253
- if (params.task_type != null && params.inference_id != null) {
254
- method = 'POST';
255
- path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.inference_id.toString())}/_update`;
355
+ const method = 'PUT';
356
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.anthropic_inference_id.toString())}`;
357
+ const meta = {
358
+ name: 'inference.put_anthropic',
359
+ pathParts: {
360
+ task_type: params.task_type,
361
+ anthropic_inference_id: params.anthropic_inference_id
362
+ }
363
+ };
364
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
365
+ }
366
+ async putAzureaistudio(params, options) {
367
+ const acceptedPath = ['task_type', 'azureaistudio_inference_id'];
368
+ const acceptedBody = ['chunking_settings', 'service', 'service_settings', 'task_settings'];
369
+ const querystring = {};
370
+ // @ts-expect-error
371
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
372
+ let body;
373
+ if (typeof userBody === 'string') {
374
+ body = userBody;
256
375
  }
257
376
  else {
258
- method = 'POST';
377
+ body = userBody != null ? { ...userBody } : undefined;
378
+ }
379
+ for (const key in params) {
380
+ if (acceptedBody.includes(key)) {
381
+ body = body !== null && body !== void 0 ? body : {};
382
+ // @ts-expect-error
383
+ body[key] = params[key];
384
+ }
385
+ else if (acceptedPath.includes(key)) {
386
+ continue;
387
+ }
388
+ else if (key !== 'body') {
389
+ // @ts-expect-error
390
+ querystring[key] = params[key];
391
+ }
392
+ }
393
+ const method = 'PUT';
394
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.azureaistudio_inference_id.toString())}`;
395
+ const meta = {
396
+ name: 'inference.put_azureaistudio',
397
+ pathParts: {
398
+ task_type: params.task_type,
399
+ azureaistudio_inference_id: params.azureaistudio_inference_id
400
+ }
401
+ };
402
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
403
+ }
404
+ async putAzureopenai(params, options) {
405
+ const acceptedPath = ['task_type', 'azureopenai_inference_id'];
406
+ const acceptedBody = ['chunking_settings', 'service', 'service_settings', 'task_settings'];
407
+ const querystring = {};
408
+ // @ts-expect-error
409
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
410
+ let body;
411
+ if (typeof userBody === 'string') {
412
+ body = userBody;
413
+ }
414
+ else {
415
+ body = userBody != null ? { ...userBody } : undefined;
416
+ }
417
+ for (const key in params) {
418
+ if (acceptedBody.includes(key)) {
419
+ body = body !== null && body !== void 0 ? body : {};
420
+ // @ts-expect-error
421
+ body[key] = params[key];
422
+ }
423
+ else if (acceptedPath.includes(key)) {
424
+ continue;
425
+ }
426
+ else if (key !== 'body') {
427
+ // @ts-expect-error
428
+ querystring[key] = params[key];
429
+ }
430
+ }
431
+ const method = 'PUT';
432
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.azureopenai_inference_id.toString())}`;
433
+ const meta = {
434
+ name: 'inference.put_azureopenai',
435
+ pathParts: {
436
+ task_type: params.task_type,
437
+ azureopenai_inference_id: params.azureopenai_inference_id
438
+ }
439
+ };
440
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
441
+ }
442
+ async putCohere(params, options) {
443
+ const acceptedPath = ['task_type', 'cohere_inference_id'];
444
+ const acceptedBody = ['chunking_settings', 'service', 'service_settings', 'task_settings'];
445
+ const querystring = {};
446
+ // @ts-expect-error
447
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
448
+ let body;
449
+ if (typeof userBody === 'string') {
450
+ body = userBody;
451
+ }
452
+ else {
453
+ body = userBody != null ? { ...userBody } : undefined;
454
+ }
455
+ for (const key in params) {
456
+ if (acceptedBody.includes(key)) {
457
+ body = body !== null && body !== void 0 ? body : {};
458
+ // @ts-expect-error
459
+ body[key] = params[key];
460
+ }
461
+ else if (acceptedPath.includes(key)) {
462
+ continue;
463
+ }
464
+ else if (key !== 'body') {
465
+ // @ts-expect-error
466
+ querystring[key] = params[key];
467
+ }
468
+ }
469
+ const method = 'PUT';
470
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.cohere_inference_id.toString())}`;
471
+ const meta = {
472
+ name: 'inference.put_cohere',
473
+ pathParts: {
474
+ task_type: params.task_type,
475
+ cohere_inference_id: params.cohere_inference_id
476
+ }
477
+ };
478
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
479
+ }
480
+ async putElasticsearch(params, options) {
481
+ const acceptedPath = ['task_type', 'elasticsearch_inference_id'];
482
+ const acceptedBody = ['chunking_settings', 'service', 'service_settings', 'task_settings'];
483
+ const querystring = {};
484
+ // @ts-expect-error
485
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
486
+ let body;
487
+ if (typeof userBody === 'string') {
488
+ body = userBody;
489
+ }
490
+ else {
491
+ body = userBody != null ? { ...userBody } : undefined;
492
+ }
493
+ for (const key in params) {
494
+ if (acceptedBody.includes(key)) {
495
+ body = body !== null && body !== void 0 ? body : {};
496
+ // @ts-expect-error
497
+ body[key] = params[key];
498
+ }
499
+ else if (acceptedPath.includes(key)) {
500
+ continue;
501
+ }
502
+ else if (key !== 'body') {
503
+ // @ts-expect-error
504
+ querystring[key] = params[key];
505
+ }
506
+ }
507
+ const method = 'PUT';
508
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.elasticsearch_inference_id.toString())}`;
509
+ const meta = {
510
+ name: 'inference.put_elasticsearch',
511
+ pathParts: {
512
+ task_type: params.task_type,
513
+ elasticsearch_inference_id: params.elasticsearch_inference_id
514
+ }
515
+ };
516
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
517
+ }
518
+ async putElser(params, options) {
519
+ const acceptedPath = ['task_type', 'elser_inference_id'];
520
+ const acceptedBody = ['chunking_settings', 'service', 'service_settings'];
521
+ const querystring = {};
522
+ // @ts-expect-error
523
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
524
+ let body;
525
+ if (typeof userBody === 'string') {
526
+ body = userBody;
527
+ }
528
+ else {
529
+ body = userBody != null ? { ...userBody } : undefined;
530
+ }
531
+ for (const key in params) {
532
+ if (acceptedBody.includes(key)) {
533
+ body = body !== null && body !== void 0 ? body : {};
534
+ // @ts-expect-error
535
+ body[key] = params[key];
536
+ }
537
+ else if (acceptedPath.includes(key)) {
538
+ continue;
539
+ }
540
+ else if (key !== 'body') {
541
+ // @ts-expect-error
542
+ querystring[key] = params[key];
543
+ }
544
+ }
545
+ const method = 'PUT';
546
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.elser_inference_id.toString())}`;
547
+ const meta = {
548
+ name: 'inference.put_elser',
549
+ pathParts: {
550
+ task_type: params.task_type,
551
+ elser_inference_id: params.elser_inference_id
552
+ }
553
+ };
554
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
555
+ }
556
+ async putGoogleaistudio(params, options) {
557
+ const acceptedPath = ['task_type', 'googleaistudio_inference_id'];
558
+ const acceptedBody = ['chunking_settings', 'service', 'service_settings'];
559
+ const querystring = {};
560
+ // @ts-expect-error
561
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
562
+ let body;
563
+ if (typeof userBody === 'string') {
564
+ body = userBody;
565
+ }
566
+ else {
567
+ body = userBody != null ? { ...userBody } : undefined;
568
+ }
569
+ for (const key in params) {
570
+ if (acceptedBody.includes(key)) {
571
+ body = body !== null && body !== void 0 ? body : {};
572
+ // @ts-expect-error
573
+ body[key] = params[key];
574
+ }
575
+ else if (acceptedPath.includes(key)) {
576
+ continue;
577
+ }
578
+ else if (key !== 'body') {
579
+ // @ts-expect-error
580
+ querystring[key] = params[key];
581
+ }
582
+ }
583
+ const method = 'PUT';
584
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.googleaistudio_inference_id.toString())}`;
585
+ const meta = {
586
+ name: 'inference.put_googleaistudio',
587
+ pathParts: {
588
+ task_type: params.task_type,
589
+ googleaistudio_inference_id: params.googleaistudio_inference_id
590
+ }
591
+ };
592
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
593
+ }
594
+ async putGooglevertexai(params, options) {
595
+ const acceptedPath = ['task_type', 'googlevertexai_inference_id'];
596
+ const acceptedBody = ['chunking_settings', 'service', 'service_settings', 'task_settings'];
597
+ const querystring = {};
598
+ // @ts-expect-error
599
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
600
+ let body;
601
+ if (typeof userBody === 'string') {
602
+ body = userBody;
603
+ }
604
+ else {
605
+ body = userBody != null ? { ...userBody } : undefined;
606
+ }
607
+ for (const key in params) {
608
+ if (acceptedBody.includes(key)) {
609
+ body = body !== null && body !== void 0 ? body : {};
610
+ // @ts-expect-error
611
+ body[key] = params[key];
612
+ }
613
+ else if (acceptedPath.includes(key)) {
614
+ continue;
615
+ }
616
+ else if (key !== 'body') {
617
+ // @ts-expect-error
618
+ querystring[key] = params[key];
619
+ }
620
+ }
621
+ const method = 'PUT';
622
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.googlevertexai_inference_id.toString())}`;
623
+ const meta = {
624
+ name: 'inference.put_googlevertexai',
625
+ pathParts: {
626
+ task_type: params.task_type,
627
+ googlevertexai_inference_id: params.googlevertexai_inference_id
628
+ }
629
+ };
630
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
631
+ }
632
+ async putHuggingFace(params, options) {
633
+ const acceptedPath = ['task_type', 'huggingface_inference_id'];
634
+ const acceptedBody = ['chunking_settings', 'service', 'service_settings'];
635
+ const querystring = {};
636
+ // @ts-expect-error
637
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
638
+ let body;
639
+ if (typeof userBody === 'string') {
640
+ body = userBody;
641
+ }
642
+ else {
643
+ body = userBody != null ? { ...userBody } : undefined;
644
+ }
645
+ for (const key in params) {
646
+ if (acceptedBody.includes(key)) {
647
+ body = body !== null && body !== void 0 ? body : {};
648
+ // @ts-expect-error
649
+ body[key] = params[key];
650
+ }
651
+ else if (acceptedPath.includes(key)) {
652
+ continue;
653
+ }
654
+ else if (key !== 'body') {
655
+ // @ts-expect-error
656
+ querystring[key] = params[key];
657
+ }
658
+ }
659
+ const method = 'PUT';
660
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.huggingface_inference_id.toString())}`;
661
+ const meta = {
662
+ name: 'inference.put_hugging_face',
663
+ pathParts: {
664
+ task_type: params.task_type,
665
+ huggingface_inference_id: params.huggingface_inference_id
666
+ }
667
+ };
668
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
669
+ }
670
+ async putJinaai(params, options) {
671
+ const acceptedPath = ['task_type', 'jinaai_inference_id'];
672
+ const acceptedBody = ['chunking_settings', 'service', 'service_settings', 'task_settings'];
673
+ const querystring = {};
674
+ // @ts-expect-error
675
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
676
+ let body;
677
+ if (typeof userBody === 'string') {
678
+ body = userBody;
679
+ }
680
+ else {
681
+ body = userBody != null ? { ...userBody } : undefined;
682
+ }
683
+ for (const key in params) {
684
+ if (acceptedBody.includes(key)) {
685
+ body = body !== null && body !== void 0 ? body : {};
686
+ // @ts-expect-error
687
+ body[key] = params[key];
688
+ }
689
+ else if (acceptedPath.includes(key)) {
690
+ continue;
691
+ }
692
+ else if (key !== 'body') {
693
+ // @ts-expect-error
694
+ querystring[key] = params[key];
695
+ }
696
+ }
697
+ const method = 'PUT';
698
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.jinaai_inference_id.toString())}`;
699
+ const meta = {
700
+ name: 'inference.put_jinaai',
701
+ pathParts: {
702
+ task_type: params.task_type,
703
+ jinaai_inference_id: params.jinaai_inference_id
704
+ }
705
+ };
706
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
707
+ }
708
+ async putMistral(params, options) {
709
+ const acceptedPath = ['task_type', 'mistral_inference_id'];
710
+ const acceptedBody = ['chunking_settings', 'service', 'service_settings'];
711
+ const querystring = {};
712
+ // @ts-expect-error
713
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
714
+ let body;
715
+ if (typeof userBody === 'string') {
716
+ body = userBody;
717
+ }
718
+ else {
719
+ body = userBody != null ? { ...userBody } : undefined;
720
+ }
721
+ for (const key in params) {
722
+ if (acceptedBody.includes(key)) {
723
+ body = body !== null && body !== void 0 ? body : {};
724
+ // @ts-expect-error
725
+ body[key] = params[key];
726
+ }
727
+ else if (acceptedPath.includes(key)) {
728
+ continue;
729
+ }
730
+ else if (key !== 'body') {
731
+ // @ts-expect-error
732
+ querystring[key] = params[key];
733
+ }
734
+ }
735
+ const method = 'PUT';
736
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.mistral_inference_id.toString())}`;
737
+ const meta = {
738
+ name: 'inference.put_mistral',
739
+ pathParts: {
740
+ task_type: params.task_type,
741
+ mistral_inference_id: params.mistral_inference_id
742
+ }
743
+ };
744
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
745
+ }
746
+ async putOpenai(params, options) {
747
+ const acceptedPath = ['task_type', 'openai_inference_id'];
748
+ const acceptedBody = ['chunking_settings', 'service', 'service_settings', 'task_settings'];
749
+ const querystring = {};
750
+ // @ts-expect-error
751
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
752
+ let body;
753
+ if (typeof userBody === 'string') {
754
+ body = userBody;
755
+ }
756
+ else {
757
+ body = userBody != null ? { ...userBody } : undefined;
758
+ }
759
+ for (const key in params) {
760
+ if (acceptedBody.includes(key)) {
761
+ body = body !== null && body !== void 0 ? body : {};
762
+ // @ts-expect-error
763
+ body[key] = params[key];
764
+ }
765
+ else if (acceptedPath.includes(key)) {
766
+ continue;
767
+ }
768
+ else if (key !== 'body') {
769
+ // @ts-expect-error
770
+ querystring[key] = params[key];
771
+ }
772
+ }
773
+ const method = 'PUT';
774
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.openai_inference_id.toString())}`;
775
+ const meta = {
776
+ name: 'inference.put_openai',
777
+ pathParts: {
778
+ task_type: params.task_type,
779
+ openai_inference_id: params.openai_inference_id
780
+ }
781
+ };
782
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
783
+ }
784
+ async putVoyageai(params, options) {
785
+ const acceptedPath = ['task_type', 'voyageai_inference_id'];
786
+ const acceptedBody = ['chunking_settings', 'service', 'service_settings', 'task_settings'];
787
+ const querystring = {};
788
+ // @ts-expect-error
789
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
790
+ let body;
791
+ if (typeof userBody === 'string') {
792
+ body = userBody;
793
+ }
794
+ else {
795
+ body = userBody != null ? { ...userBody } : undefined;
796
+ }
797
+ for (const key in params) {
798
+ if (acceptedBody.includes(key)) {
799
+ body = body !== null && body !== void 0 ? body : {};
800
+ // @ts-expect-error
801
+ body[key] = params[key];
802
+ }
803
+ else if (acceptedPath.includes(key)) {
804
+ continue;
805
+ }
806
+ else if (key !== 'body') {
807
+ // @ts-expect-error
808
+ querystring[key] = params[key];
809
+ }
810
+ }
811
+ const method = 'PUT';
812
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.voyageai_inference_id.toString())}`;
813
+ const meta = {
814
+ name: 'inference.put_voyageai',
815
+ pathParts: {
816
+ task_type: params.task_type,
817
+ voyageai_inference_id: params.voyageai_inference_id
818
+ }
819
+ };
820
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
821
+ }
822
+ async putWatsonx(params, options) {
823
+ const acceptedPath = ['task_type', 'watsonx_inference_id'];
824
+ const acceptedBody = ['service', 'service_settings'];
825
+ const querystring = {};
826
+ // @ts-expect-error
827
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
828
+ let body;
829
+ if (typeof userBody === 'string') {
830
+ body = userBody;
831
+ }
832
+ else {
833
+ body = userBody != null ? { ...userBody } : undefined;
834
+ }
835
+ for (const key in params) {
836
+ if (acceptedBody.includes(key)) {
837
+ body = body !== null && body !== void 0 ? body : {};
838
+ // @ts-expect-error
839
+ body[key] = params[key];
840
+ }
841
+ else if (acceptedPath.includes(key)) {
842
+ continue;
843
+ }
844
+ else if (key !== 'body') {
845
+ // @ts-expect-error
846
+ querystring[key] = params[key];
847
+ }
848
+ }
849
+ const method = 'PUT';
850
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.watsonx_inference_id.toString())}`;
851
+ const meta = {
852
+ name: 'inference.put_watsonx',
853
+ pathParts: {
854
+ task_type: params.task_type,
855
+ watsonx_inference_id: params.watsonx_inference_id
856
+ }
857
+ };
858
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
859
+ }
860
+ async rerank(params, options) {
861
+ const acceptedPath = ['inference_id'];
862
+ const acceptedBody = ['query', 'input', 'task_settings'];
863
+ const querystring = {};
864
+ // @ts-expect-error
865
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
866
+ let body;
867
+ if (typeof userBody === 'string') {
868
+ body = userBody;
869
+ }
870
+ else {
871
+ body = userBody != null ? { ...userBody } : undefined;
872
+ }
873
+ for (const key in params) {
874
+ if (acceptedBody.includes(key)) {
875
+ body = body !== null && body !== void 0 ? body : {};
876
+ // @ts-expect-error
877
+ body[key] = params[key];
878
+ }
879
+ else if (acceptedPath.includes(key)) {
880
+ continue;
881
+ }
882
+ else if (key !== 'body') {
883
+ // @ts-expect-error
884
+ querystring[key] = params[key];
885
+ }
886
+ }
887
+ const method = 'POST';
888
+ const path = `/_inference/rerank/${encodeURIComponent(params.inference_id.toString())}`;
889
+ const meta = {
890
+ name: 'inference.rerank',
891
+ pathParts: {
892
+ inference_id: params.inference_id
893
+ }
894
+ };
895
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
896
+ }
897
+ async sparseEmbedding(params, options) {
898
+ const acceptedPath = ['inference_id'];
899
+ const acceptedBody = ['input', 'task_settings'];
900
+ const querystring = {};
901
+ // @ts-expect-error
902
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
903
+ let body;
904
+ if (typeof userBody === 'string') {
905
+ body = userBody;
906
+ }
907
+ else {
908
+ body = userBody != null ? { ...userBody } : undefined;
909
+ }
910
+ for (const key in params) {
911
+ if (acceptedBody.includes(key)) {
912
+ body = body !== null && body !== void 0 ? body : {};
913
+ // @ts-expect-error
914
+ body[key] = params[key];
915
+ }
916
+ else if (acceptedPath.includes(key)) {
917
+ continue;
918
+ }
919
+ else if (key !== 'body') {
920
+ // @ts-expect-error
921
+ querystring[key] = params[key];
922
+ }
923
+ }
924
+ const method = 'POST';
925
+ const path = `/_inference/sparse_embedding/${encodeURIComponent(params.inference_id.toString())}`;
926
+ const meta = {
927
+ name: 'inference.sparse_embedding',
928
+ pathParts: {
929
+ inference_id: params.inference_id
930
+ }
931
+ };
932
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
933
+ }
934
+ async streamCompletion(params, options) {
935
+ const acceptedPath = ['inference_id'];
936
+ const acceptedBody = ['input', 'task_settings'];
937
+ const querystring = {};
938
+ // @ts-expect-error
939
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
940
+ let body;
941
+ if (typeof userBody === 'string') {
942
+ body = userBody;
943
+ }
944
+ else {
945
+ body = userBody != null ? { ...userBody } : undefined;
946
+ }
947
+ for (const key in params) {
948
+ if (acceptedBody.includes(key)) {
949
+ body = body !== null && body !== void 0 ? body : {};
950
+ // @ts-expect-error
951
+ body[key] = params[key];
952
+ }
953
+ else if (acceptedPath.includes(key)) {
954
+ continue;
955
+ }
956
+ else if (key !== 'body') {
957
+ // @ts-expect-error
958
+ querystring[key] = params[key];
959
+ }
960
+ }
961
+ const method = 'POST';
962
+ const path = `/_inference/completion/${encodeURIComponent(params.inference_id.toString())}/_stream`;
963
+ const meta = {
964
+ name: 'inference.stream_completion',
965
+ pathParts: {
966
+ inference_id: params.inference_id
967
+ }
968
+ };
969
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
970
+ }
971
+ async textEmbedding(params, options) {
972
+ const acceptedPath = ['inference_id'];
973
+ const acceptedBody = ['input', 'task_settings'];
974
+ const querystring = {};
975
+ // @ts-expect-error
976
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
977
+ let body;
978
+ if (typeof userBody === 'string') {
979
+ body = userBody;
980
+ }
981
+ else {
982
+ body = userBody != null ? { ...userBody } : undefined;
983
+ }
984
+ for (const key in params) {
985
+ if (acceptedBody.includes(key)) {
986
+ body = body !== null && body !== void 0 ? body : {};
987
+ // @ts-expect-error
988
+ body[key] = params[key];
989
+ }
990
+ else if (acceptedPath.includes(key)) {
991
+ continue;
992
+ }
993
+ else if (key !== 'body') {
994
+ // @ts-expect-error
995
+ querystring[key] = params[key];
996
+ }
997
+ }
998
+ const method = 'POST';
999
+ const path = `/_inference/text_embedding/${encodeURIComponent(params.inference_id.toString())}`;
1000
+ const meta = {
1001
+ name: 'inference.text_embedding',
1002
+ pathParts: {
1003
+ inference_id: params.inference_id
1004
+ }
1005
+ };
1006
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1007
+ }
1008
+ async update(params, options) {
1009
+ var _a;
1010
+ const acceptedPath = ['inference_id', 'task_type'];
1011
+ const acceptedBody = ['inference_config'];
1012
+ const querystring = {};
1013
+ // @ts-expect-error
1014
+ let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1015
+ for (const key in params) {
1016
+ if (acceptedBody.includes(key)) {
1017
+ // @ts-expect-error
1018
+ body = params[key];
1019
+ }
1020
+ else if (acceptedPath.includes(key)) {
1021
+ continue;
1022
+ }
1023
+ else if (key !== 'body') {
1024
+ // @ts-expect-error
1025
+ querystring[key] = params[key];
1026
+ }
1027
+ }
1028
+ let method = '';
1029
+ let path = '';
1030
+ if (params.task_type != null && params.inference_id != null) {
1031
+ method = 'PUT';
1032
+ path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.inference_id.toString())}/_update`;
1033
+ }
1034
+ else {
1035
+ method = 'PUT';
259
1036
  path = `/_inference/${encodeURIComponent(params.inference_id.toString())}/_update`;
260
1037
  }
261
1038
  const meta = {