@elastic/elasticsearch 9.0.0-alpha.4 → 9.0.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.
Files changed (273) hide show
  1. package/index.d.ts +2 -16
  2. package/index.js +2 -16
  3. package/lib/api/api/async_search.d.ts +4 -4
  4. package/lib/api/api/async_search.js +2 -16
  5. package/lib/api/api/async_search.js.map +1 -1
  6. package/lib/api/api/autoscaling.d.ts +4 -4
  7. package/lib/api/api/autoscaling.js +2 -16
  8. package/lib/api/api/autoscaling.js.map +1 -1
  9. package/lib/api/api/bulk.d.ts +1 -1
  10. package/lib/api/api/bulk.js +2 -16
  11. package/lib/api/api/bulk.js.map +1 -1
  12. package/lib/api/api/capabilities.js +2 -16
  13. package/lib/api/api/capabilities.js.map +1 -1
  14. package/lib/api/api/cat.d.ts +26 -26
  15. package/lib/api/api/cat.js +2 -16
  16. package/lib/api/api/cat.js.map +1 -1
  17. package/lib/api/api/ccr.d.ts +13 -13
  18. package/lib/api/api/ccr.js +2 -16
  19. package/lib/api/api/ccr.js.map +1 -1
  20. package/lib/api/api/clear_scroll.d.ts +1 -1
  21. package/lib/api/api/clear_scroll.js +2 -16
  22. package/lib/api/api/clear_scroll.js.map +1 -1
  23. package/lib/api/api/close_point_in_time.d.ts +1 -1
  24. package/lib/api/api/close_point_in_time.js +2 -16
  25. package/lib/api/api/close_point_in_time.js.map +1 -1
  26. package/lib/api/api/cluster.d.ts +16 -16
  27. package/lib/api/api/cluster.js +2 -16
  28. package/lib/api/api/cluster.js.map +1 -1
  29. package/lib/api/api/connector.d.ts +30 -30
  30. package/lib/api/api/connector.js +2 -16
  31. package/lib/api/api/connector.js.map +1 -1
  32. package/lib/api/api/count.d.ts +1 -1
  33. package/lib/api/api/count.js +2 -16
  34. package/lib/api/api/count.js.map +1 -1
  35. package/lib/api/api/create.d.ts +1 -1
  36. package/lib/api/api/create.js +7 -16
  37. package/lib/api/api/create.js.map +1 -1
  38. package/lib/api/api/dangling_indices.d.ts +3 -3
  39. package/lib/api/api/dangling_indices.js +2 -16
  40. package/lib/api/api/dangling_indices.js.map +1 -1
  41. package/lib/api/api/delete.d.ts +1 -1
  42. package/lib/api/api/delete.js +2 -16
  43. package/lib/api/api/delete.js.map +1 -1
  44. package/lib/api/api/delete_by_query.d.ts +1 -1
  45. package/lib/api/api/delete_by_query.js +2 -16
  46. package/lib/api/api/delete_by_query.js.map +1 -1
  47. package/lib/api/api/delete_by_query_rethrottle.d.ts +1 -1
  48. package/lib/api/api/delete_by_query_rethrottle.js +2 -16
  49. package/lib/api/api/delete_by_query_rethrottle.js.map +1 -1
  50. package/lib/api/api/delete_script.d.ts +1 -1
  51. package/lib/api/api/delete_script.js +2 -16
  52. package/lib/api/api/delete_script.js.map +1 -1
  53. package/lib/api/api/enrich.d.ts +5 -5
  54. package/lib/api/api/enrich.js +2 -16
  55. package/lib/api/api/enrich.js.map +1 -1
  56. package/lib/api/api/eql.d.ts +4 -4
  57. package/lib/api/api/eql.js +2 -16
  58. package/lib/api/api/eql.js.map +1 -1
  59. package/lib/api/api/esql.d.ts +5 -5
  60. package/lib/api/api/esql.js +4 -17
  61. package/lib/api/api/esql.js.map +1 -1
  62. package/lib/api/api/exists.d.ts +1 -1
  63. package/lib/api/api/exists.js +2 -16
  64. package/lib/api/api/exists.js.map +1 -1
  65. package/lib/api/api/exists_source.d.ts +1 -1
  66. package/lib/api/api/exists_source.js +2 -16
  67. package/lib/api/api/exists_source.js.map +1 -1
  68. package/lib/api/api/explain.d.ts +1 -1
  69. package/lib/api/api/explain.js +2 -16
  70. package/lib/api/api/explain.js.map +1 -1
  71. package/lib/api/api/features.d.ts +2 -2
  72. package/lib/api/api/features.js +2 -16
  73. package/lib/api/api/features.js.map +1 -1
  74. package/lib/api/api/field_caps.d.ts +1 -1
  75. package/lib/api/api/field_caps.js +2 -16
  76. package/lib/api/api/field_caps.js.map +1 -1
  77. package/lib/api/api/fleet.d.ts +3 -3
  78. package/lib/api/api/fleet.js +2 -16
  79. package/lib/api/api/fleet.js.map +1 -1
  80. package/lib/api/api/get.d.ts +1 -1
  81. package/lib/api/api/get.js +2 -16
  82. package/lib/api/api/get.js.map +1 -1
  83. package/lib/api/api/get_script.d.ts +1 -1
  84. package/lib/api/api/get_script.js +2 -16
  85. package/lib/api/api/get_script.js.map +1 -1
  86. package/lib/api/api/get_script_context.d.ts +1 -1
  87. package/lib/api/api/get_script_context.js +2 -16
  88. package/lib/api/api/get_script_context.js.map +1 -1
  89. package/lib/api/api/get_script_languages.d.ts +1 -1
  90. package/lib/api/api/get_script_languages.js +2 -16
  91. package/lib/api/api/get_script_languages.js.map +1 -1
  92. package/lib/api/api/get_source.d.ts +1 -1
  93. package/lib/api/api/get_source.js +2 -16
  94. package/lib/api/api/get_source.js.map +1 -1
  95. package/lib/api/api/graph.d.ts +1 -1
  96. package/lib/api/api/graph.js +2 -16
  97. package/lib/api/api/graph.js.map +1 -1
  98. package/lib/api/api/health_report.d.ts +1 -1
  99. package/lib/api/api/health_report.js +2 -16
  100. package/lib/api/api/health_report.js.map +1 -1
  101. package/lib/api/api/ilm.d.ts +11 -11
  102. package/lib/api/api/ilm.js +2 -16
  103. package/lib/api/api/ilm.js.map +1 -1
  104. package/lib/api/api/index.d.ts +1 -1
  105. package/lib/api/api/index.js +2 -16
  106. package/lib/api/api/index.js.map +1 -1
  107. package/lib/api/api/indices.d.ts +63 -63
  108. package/lib/api/api/indices.js +19 -22
  109. package/lib/api/api/indices.js.map +1 -1
  110. package/lib/api/api/inference.d.ts +155 -15
  111. package/lib/api/api/inference.js +1175 -57
  112. package/lib/api/api/inference.js.map +1 -1
  113. package/lib/api/api/info.d.ts +1 -1
  114. package/lib/api/api/info.js +2 -16
  115. package/lib/api/api/info.js.map +1 -1
  116. package/lib/api/api/ingest.d.ts +12 -12
  117. package/lib/api/api/ingest.js +2 -16
  118. package/lib/api/api/ingest.js.map +1 -1
  119. package/lib/api/api/knn_search.d.ts +5 -5
  120. package/lib/api/api/knn_search.js +8 -44
  121. package/lib/api/api/knn_search.js.map +1 -1
  122. package/lib/api/api/license.d.ts +7 -7
  123. package/lib/api/api/license.js +2 -16
  124. package/lib/api/api/license.js.map +1 -1
  125. package/lib/api/api/logstash.d.ts +3 -3
  126. package/lib/api/api/logstash.js +2 -16
  127. package/lib/api/api/logstash.js.map +1 -1
  128. package/lib/api/api/mget.d.ts +1 -1
  129. package/lib/api/api/mget.js +2 -16
  130. package/lib/api/api/mget.js.map +1 -1
  131. package/lib/api/api/migration.d.ts +3 -3
  132. package/lib/api/api/migration.js +2 -16
  133. package/lib/api/api/migration.js.map +1 -1
  134. package/lib/api/api/ml.d.ts +73 -73
  135. package/lib/api/api/ml.js +2 -17
  136. package/lib/api/api/ml.js.map +1 -1
  137. package/lib/api/api/monitoring.d.ts +1 -1
  138. package/lib/api/api/monitoring.js +2 -16
  139. package/lib/api/api/monitoring.js.map +1 -1
  140. package/lib/api/api/msearch.d.ts +1 -1
  141. package/lib/api/api/msearch.js +2 -16
  142. package/lib/api/api/msearch.js.map +1 -1
  143. package/lib/api/api/msearch_template.d.ts +1 -1
  144. package/lib/api/api/msearch_template.js +2 -16
  145. package/lib/api/api/msearch_template.js.map +1 -1
  146. package/lib/api/api/mtermvectors.d.ts +1 -1
  147. package/lib/api/api/mtermvectors.js +2 -16
  148. package/lib/api/api/mtermvectors.js.map +1 -1
  149. package/lib/api/api/nodes.d.ts +7 -7
  150. package/lib/api/api/nodes.js +2 -16
  151. package/lib/api/api/nodes.js.map +1 -1
  152. package/lib/api/api/open_point_in_time.d.ts +1 -1
  153. package/lib/api/api/open_point_in_time.js +4 -17
  154. package/lib/api/api/open_point_in_time.js.map +1 -1
  155. package/lib/api/api/ping.d.ts +1 -1
  156. package/lib/api/api/ping.js +2 -16
  157. package/lib/api/api/ping.js.map +1 -1
  158. package/lib/api/api/profiling.d.ts +4 -4
  159. package/lib/api/api/profiling.js +2 -16
  160. package/lib/api/api/profiling.js.map +1 -1
  161. package/lib/api/api/put_script.d.ts +1 -1
  162. package/lib/api/api/put_script.js +2 -16
  163. package/lib/api/api/put_script.js.map +1 -1
  164. package/lib/api/api/query_rules.d.ts +8 -8
  165. package/lib/api/api/query_rules.js +2 -16
  166. package/lib/api/api/query_rules.js.map +1 -1
  167. package/lib/api/api/rank_eval.d.ts +1 -1
  168. package/lib/api/api/rank_eval.js +2 -16
  169. package/lib/api/api/rank_eval.js.map +1 -1
  170. package/lib/api/api/reindex.d.ts +1 -1
  171. package/lib/api/api/reindex.js +2 -16
  172. package/lib/api/api/reindex.js.map +1 -1
  173. package/lib/api/api/reindex_rethrottle.d.ts +1 -1
  174. package/lib/api/api/reindex_rethrottle.js +2 -16
  175. package/lib/api/api/reindex_rethrottle.js.map +1 -1
  176. package/lib/api/api/render_search_template.d.ts +1 -1
  177. package/lib/api/api/render_search_template.js +2 -16
  178. package/lib/api/api/render_search_template.js.map +1 -1
  179. package/lib/api/api/rollup.d.ts +8 -8
  180. package/lib/api/api/rollup.js +2 -16
  181. package/lib/api/api/rollup.js.map +1 -1
  182. package/lib/api/api/scripts_painless_execute.d.ts +1 -1
  183. package/lib/api/api/scripts_painless_execute.js +2 -16
  184. package/lib/api/api/scripts_painless_execute.js.map +1 -1
  185. package/lib/api/api/scroll.d.ts +1 -1
  186. package/lib/api/api/scroll.js +2 -16
  187. package/lib/api/api/scroll.js.map +1 -1
  188. package/lib/api/api/search.d.ts +1 -1
  189. package/lib/api/api/search.js +2 -16
  190. package/lib/api/api/search.js.map +1 -1
  191. package/lib/api/api/search_application.d.ts +10 -10
  192. package/lib/api/api/search_application.js +2 -16
  193. package/lib/api/api/search_application.js.map +1 -1
  194. package/lib/api/api/search_mvt.d.ts +1 -1
  195. package/lib/api/api/search_mvt.js +2 -16
  196. package/lib/api/api/search_mvt.js.map +1 -1
  197. package/lib/api/api/search_shards.d.ts +1 -1
  198. package/lib/api/api/search_shards.js +2 -16
  199. package/lib/api/api/search_shards.js.map +1 -1
  200. package/lib/api/api/search_template.d.ts +1 -1
  201. package/lib/api/api/search_template.js +2 -16
  202. package/lib/api/api/search_template.js.map +1 -1
  203. package/lib/api/api/searchable_snapshots.d.ts +4 -4
  204. package/lib/api/api/searchable_snapshots.js +2 -16
  205. package/lib/api/api/searchable_snapshots.js.map +1 -1
  206. package/lib/api/api/security.d.ts +64 -64
  207. package/lib/api/api/security.js +3 -17
  208. package/lib/api/api/security.js.map +1 -1
  209. package/lib/api/api/shutdown.d.ts +3 -3
  210. package/lib/api/api/shutdown.js +2 -16
  211. package/lib/api/api/shutdown.js.map +1 -1
  212. package/lib/api/api/simulate.d.ts +1 -1
  213. package/lib/api/api/simulate.js +3 -17
  214. package/lib/api/api/simulate.js.map +1 -1
  215. package/lib/api/api/slm.d.ts +9 -9
  216. package/lib/api/api/slm.js +2 -16
  217. package/lib/api/api/slm.js.map +1 -1
  218. package/lib/api/api/snapshot.d.ts +13 -13
  219. package/lib/api/api/snapshot.js +3 -18
  220. package/lib/api/api/snapshot.js.map +1 -1
  221. package/lib/api/api/sql.d.ts +6 -6
  222. package/lib/api/api/sql.js +2 -16
  223. package/lib/api/api/sql.js.map +1 -1
  224. package/lib/api/api/ssl.d.ts +1 -1
  225. package/lib/api/api/ssl.js +2 -16
  226. package/lib/api/api/ssl.js.map +1 -1
  227. package/lib/api/api/synonyms.d.ts +7 -7
  228. package/lib/api/api/synonyms.js +2 -16
  229. package/lib/api/api/synonyms.js.map +1 -1
  230. package/lib/api/api/tasks.d.ts +3 -3
  231. package/lib/api/api/tasks.js +2 -16
  232. package/lib/api/api/tasks.js.map +1 -1
  233. package/lib/api/api/terms_enum.d.ts +1 -1
  234. package/lib/api/api/terms_enum.js +2 -16
  235. package/lib/api/api/terms_enum.js.map +1 -1
  236. package/lib/api/api/termvectors.d.ts +1 -1
  237. package/lib/api/api/termvectors.js +12 -17
  238. package/lib/api/api/termvectors.js.map +1 -1
  239. package/lib/api/api/text_structure.d.ts +4 -4
  240. package/lib/api/api/text_structure.js +2 -16
  241. package/lib/api/api/text_structure.js.map +1 -1
  242. package/lib/api/api/transform.d.ts +12 -12
  243. package/lib/api/api/transform.js +2 -16
  244. package/lib/api/api/transform.js.map +1 -1
  245. package/lib/api/api/update.d.ts +1 -1
  246. package/lib/api/api/update.js +2 -16
  247. package/lib/api/api/update.js.map +1 -1
  248. package/lib/api/api/update_by_query.d.ts +1 -1
  249. package/lib/api/api/update_by_query.js +2 -16
  250. package/lib/api/api/update_by_query.js.map +1 -1
  251. package/lib/api/api/update_by_query_rethrottle.d.ts +1 -1
  252. package/lib/api/api/update_by_query_rethrottle.js +2 -16
  253. package/lib/api/api/update_by_query_rethrottle.js.map +1 -1
  254. package/lib/api/api/watcher.d.ts +14 -14
  255. package/lib/api/api/watcher.js +2 -16
  256. package/lib/api/api/watcher.js.map +1 -1
  257. package/lib/api/api/xpack.d.ts +2 -2
  258. package/lib/api/api/xpack.js +2 -16
  259. package/lib/api/api/xpack.js.map +1 -1
  260. package/lib/api/index.js +2 -16
  261. package/lib/api/index.js.map +1 -1
  262. package/lib/api/types.d.ts +12870 -1445
  263. package/lib/api/types.js +2 -16
  264. package/lib/api/types.js.map +1 -1
  265. package/lib/client.d.ts +3 -0
  266. package/lib/client.js +61 -43
  267. package/lib/client.js.map +1 -1
  268. package/lib/helpers.d.ts +1 -7
  269. package/lib/helpers.js +4 -17
  270. package/lib/helpers.js.map +1 -1
  271. package/lib/sniffingTransport.js +2 -16
  272. package/lib/sniffingTransport.js.map +1 -1
  273. package/package.json +3 -2
@@ -1,21 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
- * Licensed to Elasticsearch B.V. under one or more contributor
4
- * license agreements. See the NOTICE file distributed with
5
- * this work for additional information regarding copyright
6
- * ownership. Elasticsearch B.V. licenses this file to you under
7
- * the Apache License, Version 2.0 (the "License"); you may
8
- * not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied. See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
3
+ * Copyright Elasticsearch B.V. and contributors
4
+ * SPDX-License-Identifier: Apache-2.0
19
5
  */
20
6
  Object.defineProperty(exports, "__esModule", { value: true });
21
7
  const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'];
@@ -35,6 +21,29 @@ class Inference {
35
21
  });
36
22
  this.transport = transport;
37
23
  this.acceptedParams = {
24
+ 'inference.chat_completion_unified': {
25
+ path: [
26
+ 'inference_id'
27
+ ],
28
+ body: [
29
+ 'chat_completion_request'
30
+ ],
31
+ query: [
32
+ 'timeout'
33
+ ]
34
+ },
35
+ 'inference.completion': {
36
+ path: [
37
+ 'inference_id'
38
+ ],
39
+ body: [
40
+ 'input',
41
+ 'task_settings'
42
+ ],
43
+ query: [
44
+ 'timeout'
45
+ ]
46
+ },
38
47
  'inference.delete': {
39
48
  path: [
40
49
  'task_type',
@@ -78,30 +87,250 @@ class Inference {
78
87
  ],
79
88
  query: []
80
89
  },
81
- 'inference.stream_inference': {
90
+ 'inference.put_alibabacloud': {
82
91
  path: [
83
- 'inference_id',
84
- 'task_type'
92
+ 'task_type',
93
+ 'alibabacloud_inference_id'
94
+ ],
95
+ body: [
96
+ 'chunking_settings',
97
+ 'service',
98
+ 'service_settings',
99
+ 'task_settings'
100
+ ],
101
+ query: []
102
+ },
103
+ 'inference.put_amazonbedrock': {
104
+ path: [
105
+ 'task_type',
106
+ 'amazonbedrock_inference_id'
107
+ ],
108
+ body: [
109
+ 'chunking_settings',
110
+ 'service',
111
+ 'service_settings',
112
+ 'task_settings'
113
+ ],
114
+ query: []
115
+ },
116
+ 'inference.put_anthropic': {
117
+ path: [
118
+ 'task_type',
119
+ 'anthropic_inference_id'
120
+ ],
121
+ body: [
122
+ 'chunking_settings',
123
+ 'service',
124
+ 'service_settings',
125
+ 'task_settings'
126
+ ],
127
+ query: []
128
+ },
129
+ 'inference.put_azureaistudio': {
130
+ path: [
131
+ 'task_type',
132
+ 'azureaistudio_inference_id'
133
+ ],
134
+ body: [
135
+ 'chunking_settings',
136
+ 'service',
137
+ 'service_settings',
138
+ 'task_settings'
139
+ ],
140
+ query: []
141
+ },
142
+ 'inference.put_azureopenai': {
143
+ path: [
144
+ 'task_type',
145
+ 'azureopenai_inference_id'
146
+ ],
147
+ body: [
148
+ 'chunking_settings',
149
+ 'service',
150
+ 'service_settings',
151
+ 'task_settings'
152
+ ],
153
+ query: []
154
+ },
155
+ 'inference.put_cohere': {
156
+ path: [
157
+ 'task_type',
158
+ 'cohere_inference_id'
159
+ ],
160
+ body: [
161
+ 'chunking_settings',
162
+ 'service',
163
+ 'service_settings',
164
+ 'task_settings'
165
+ ],
166
+ query: []
167
+ },
168
+ 'inference.put_elasticsearch': {
169
+ path: [
170
+ 'task_type',
171
+ 'elasticsearch_inference_id'
172
+ ],
173
+ body: [
174
+ 'chunking_settings',
175
+ 'service',
176
+ 'service_settings',
177
+ 'task_settings'
178
+ ],
179
+ query: []
180
+ },
181
+ 'inference.put_elser': {
182
+ path: [
183
+ 'task_type',
184
+ 'elser_inference_id'
185
+ ],
186
+ body: [
187
+ 'chunking_settings',
188
+ 'service',
189
+ 'service_settings'
190
+ ],
191
+ query: []
192
+ },
193
+ 'inference.put_googleaistudio': {
194
+ path: [
195
+ 'task_type',
196
+ 'googleaistudio_inference_id'
197
+ ],
198
+ body: [
199
+ 'chunking_settings',
200
+ 'service',
201
+ 'service_settings'
202
+ ],
203
+ query: []
204
+ },
205
+ 'inference.put_googlevertexai': {
206
+ path: [
207
+ 'task_type',
208
+ 'googlevertexai_inference_id'
209
+ ],
210
+ body: [
211
+ 'chunking_settings',
212
+ 'service',
213
+ 'service_settings',
214
+ 'task_settings'
215
+ ],
216
+ query: []
217
+ },
218
+ 'inference.put_hugging_face': {
219
+ path: [
220
+ 'task_type',
221
+ 'huggingface_inference_id'
222
+ ],
223
+ body: [
224
+ 'chunking_settings',
225
+ 'service',
226
+ 'service_settings'
227
+ ],
228
+ query: []
229
+ },
230
+ 'inference.put_jinaai': {
231
+ path: [
232
+ 'task_type',
233
+ 'jinaai_inference_id'
234
+ ],
235
+ body: [
236
+ 'chunking_settings',
237
+ 'service',
238
+ 'service_settings',
239
+ 'task_settings'
240
+ ],
241
+ query: []
242
+ },
243
+ 'inference.put_mistral': {
244
+ path: [
245
+ 'task_type',
246
+ 'mistral_inference_id'
247
+ ],
248
+ body: [
249
+ 'chunking_settings',
250
+ 'service',
251
+ 'service_settings'
252
+ ],
253
+ query: []
254
+ },
255
+ 'inference.put_openai': {
256
+ path: [
257
+ 'task_type',
258
+ 'openai_inference_id'
259
+ ],
260
+ body: [
261
+ 'chunking_settings',
262
+ 'service',
263
+ 'service_settings',
264
+ 'task_settings'
265
+ ],
266
+ query: []
267
+ },
268
+ 'inference.put_voyageai': {
269
+ path: [
270
+ 'task_type',
271
+ 'voyageai_inference_id'
85
272
  ],
86
273
  body: [
87
- 'input'
274
+ 'chunking_settings',
275
+ 'service',
276
+ 'service_settings',
277
+ 'task_settings'
88
278
  ],
89
279
  query: []
90
280
  },
91
- 'inference.unified_inference': {
281
+ 'inference.put_watsonx': {
92
282
  path: [
93
283
  'task_type',
284
+ 'watsonx_inference_id'
285
+ ],
286
+ body: [
287
+ 'service',
288
+ 'service_settings'
289
+ ],
290
+ query: []
291
+ },
292
+ 'inference.rerank': {
293
+ path: [
294
+ 'inference_id'
295
+ ],
296
+ body: [
297
+ 'query',
298
+ 'input',
299
+ 'task_settings'
300
+ ],
301
+ query: [
302
+ 'timeout'
303
+ ]
304
+ },
305
+ 'inference.sparse_embedding': {
306
+ path: [
307
+ 'inference_id'
308
+ ],
309
+ body: [
310
+ 'input',
311
+ 'task_settings'
312
+ ],
313
+ query: [
314
+ 'timeout'
315
+ ]
316
+ },
317
+ 'inference.stream_completion': {
318
+ path: [
319
+ 'inference_id'
320
+ ],
321
+ body: [
322
+ 'input',
323
+ 'task_settings'
324
+ ],
325
+ query: []
326
+ },
327
+ 'inference.text_embedding': {
328
+ path: [
94
329
  'inference_id'
95
330
  ],
96
331
  body: [
97
- 'messages',
98
- 'model',
99
- 'max_completion_tokens',
100
- 'stop',
101
- 'temperature',
102
- 'tool_choice',
103
- 'tools',
104
- 'top_p'
332
+ 'input',
333
+ 'task_settings'
105
334
  ],
106
335
  query: [
107
336
  'timeout'
@@ -119,6 +348,87 @@ class Inference {
119
348
  }
120
349
  };
121
350
  }
351
+ async chatCompletionUnified(params, options) {
352
+ var _a;
353
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.chat_completion_unified'];
354
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
355
+ const querystring = userQuery != null ? { ...userQuery } : {};
356
+ let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
357
+ for (const key in params) {
358
+ if (acceptedBody.includes(key)) {
359
+ // @ts-expect-error
360
+ body = params[key];
361
+ }
362
+ else if (acceptedPath.includes(key)) {
363
+ continue;
364
+ }
365
+ else if (key !== 'body' && key !== 'querystring') {
366
+ if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
367
+ // @ts-expect-error
368
+ querystring[key] = params[key];
369
+ }
370
+ else {
371
+ body = body !== null && body !== void 0 ? body : {};
372
+ // @ts-expect-error
373
+ body[key] = params[key];
374
+ }
375
+ }
376
+ }
377
+ const method = 'POST';
378
+ const path = `/_inference/chat_completion/${encodeURIComponent(params.inference_id.toString())}/_stream`;
379
+ const meta = {
380
+ name: 'inference.chat_completion_unified',
381
+ pathParts: {
382
+ inference_id: params.inference_id
383
+ }
384
+ };
385
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
386
+ }
387
+ async completion(params, options) {
388
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.completion'];
389
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
390
+ const querystring = userQuery != null ? { ...userQuery } : {};
391
+ let body;
392
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
393
+ if (userBody != null) {
394
+ if (typeof userBody === 'string') {
395
+ body = userBody;
396
+ }
397
+ else {
398
+ body = { ...userBody };
399
+ }
400
+ }
401
+ for (const key in params) {
402
+ if (acceptedBody.includes(key)) {
403
+ body = body !== null && body !== void 0 ? body : {};
404
+ // @ts-expect-error
405
+ body[key] = params[key];
406
+ }
407
+ else if (acceptedPath.includes(key)) {
408
+ continue;
409
+ }
410
+ else if (key !== 'body' && key !== 'querystring') {
411
+ if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
412
+ // @ts-expect-error
413
+ querystring[key] = params[key];
414
+ }
415
+ else {
416
+ body = body !== null && body !== void 0 ? body : {};
417
+ // @ts-expect-error
418
+ body[key] = params[key];
419
+ }
420
+ }
421
+ }
422
+ const method = 'POST';
423
+ const path = `/_inference/completion/${encodeURIComponent(params.inference_id.toString())}`;
424
+ const meta = {
425
+ name: 'inference.completion',
426
+ pathParts: {
427
+ inference_id: params.inference_id
428
+ }
429
+ };
430
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
431
+ }
122
432
  async delete(params, options) {
123
433
  const { path: acceptedPath } = this.acceptedParams['inference.delete'];
124
434
  const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
@@ -307,8 +617,8 @@ class Inference {
307
617
  };
308
618
  return await this.transport.request({ path, method, querystring, body, meta }, options);
309
619
  }
310
- async streamInference(params, options) {
311
- const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.stream_inference'];
620
+ async putAlibabacloud(params, options) {
621
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.put_alibabacloud'];
312
622
  const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
313
623
  const querystring = userQuery != null ? { ...userQuery } : {};
314
624
  let body;
@@ -342,27 +652,19 @@ class Inference {
342
652
  }
343
653
  }
344
654
  }
345
- let method = '';
346
- let path = '';
347
- if (params.task_type != null && params.inference_id != null) {
348
- method = 'POST';
349
- path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.inference_id.toString())}/_stream`;
350
- }
351
- else {
352
- method = 'POST';
353
- path = `/_inference/${encodeURIComponent(params.inference_id.toString())}/_stream`;
354
- }
655
+ const method = 'PUT';
656
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.alibabacloud_inference_id.toString())}`;
355
657
  const meta = {
356
- name: 'inference.stream_inference',
658
+ name: 'inference.put_alibabacloud',
357
659
  pathParts: {
358
- inference_id: params.inference_id,
359
- task_type: params.task_type
660
+ task_type: params.task_type,
661
+ alibabacloud_inference_id: params.alibabacloud_inference_id
360
662
  }
361
663
  };
362
664
  return await this.transport.request({ path, method, querystring, body, meta }, options);
363
665
  }
364
- async unifiedInference(params, options) {
365
- const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.unified_inference'];
666
+ async putAmazonbedrock(params, options) {
667
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.put_amazonbedrock'];
366
668
  const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
367
669
  const querystring = userQuery != null ? { ...userQuery } : {};
368
670
  let body;
@@ -396,20 +698,836 @@ class Inference {
396
698
  }
397
699
  }
398
700
  }
399
- let method = '';
400
- let path = '';
401
- if (params.task_type != null && params.inference_id != null) {
402
- method = 'POST';
403
- path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.inference_id.toString())}/_unified`;
701
+ const method = 'PUT';
702
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.amazonbedrock_inference_id.toString())}`;
703
+ const meta = {
704
+ name: 'inference.put_amazonbedrock',
705
+ pathParts: {
706
+ task_type: params.task_type,
707
+ amazonbedrock_inference_id: params.amazonbedrock_inference_id
708
+ }
709
+ };
710
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
711
+ }
712
+ async putAnthropic(params, options) {
713
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.put_anthropic'];
714
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
715
+ const querystring = userQuery != null ? { ...userQuery } : {};
716
+ let body;
717
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
718
+ if (userBody != null) {
719
+ if (typeof userBody === 'string') {
720
+ body = userBody;
721
+ }
722
+ else {
723
+ body = { ...userBody };
724
+ }
725
+ }
726
+ for (const key in params) {
727
+ if (acceptedBody.includes(key)) {
728
+ body = body !== null && body !== void 0 ? body : {};
729
+ // @ts-expect-error
730
+ body[key] = params[key];
731
+ }
732
+ else if (acceptedPath.includes(key)) {
733
+ continue;
734
+ }
735
+ else if (key !== 'body' && key !== 'querystring') {
736
+ if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
737
+ // @ts-expect-error
738
+ querystring[key] = params[key];
739
+ }
740
+ else {
741
+ body = body !== null && body !== void 0 ? body : {};
742
+ // @ts-expect-error
743
+ body[key] = params[key];
744
+ }
745
+ }
746
+ }
747
+ const method = 'PUT';
748
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.anthropic_inference_id.toString())}`;
749
+ const meta = {
750
+ name: 'inference.put_anthropic',
751
+ pathParts: {
752
+ task_type: params.task_type,
753
+ anthropic_inference_id: params.anthropic_inference_id
754
+ }
755
+ };
756
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
757
+ }
758
+ async putAzureaistudio(params, options) {
759
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.put_azureaistudio'];
760
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
761
+ const querystring = userQuery != null ? { ...userQuery } : {};
762
+ let body;
763
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
764
+ if (userBody != null) {
765
+ if (typeof userBody === 'string') {
766
+ body = userBody;
767
+ }
768
+ else {
769
+ body = { ...userBody };
770
+ }
771
+ }
772
+ for (const key in params) {
773
+ if (acceptedBody.includes(key)) {
774
+ body = body !== null && body !== void 0 ? body : {};
775
+ // @ts-expect-error
776
+ body[key] = params[key];
777
+ }
778
+ else if (acceptedPath.includes(key)) {
779
+ continue;
780
+ }
781
+ else if (key !== 'body' && key !== 'querystring') {
782
+ if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
783
+ // @ts-expect-error
784
+ querystring[key] = params[key];
785
+ }
786
+ else {
787
+ body = body !== null && body !== void 0 ? body : {};
788
+ // @ts-expect-error
789
+ body[key] = params[key];
790
+ }
791
+ }
792
+ }
793
+ const method = 'PUT';
794
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.azureaistudio_inference_id.toString())}`;
795
+ const meta = {
796
+ name: 'inference.put_azureaistudio',
797
+ pathParts: {
798
+ task_type: params.task_type,
799
+ azureaistudio_inference_id: params.azureaistudio_inference_id
800
+ }
801
+ };
802
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
803
+ }
804
+ async putAzureopenai(params, options) {
805
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.put_azureopenai'];
806
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
807
+ const querystring = userQuery != null ? { ...userQuery } : {};
808
+ let body;
809
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
810
+ if (userBody != null) {
811
+ if (typeof userBody === 'string') {
812
+ body = userBody;
813
+ }
814
+ else {
815
+ body = { ...userBody };
816
+ }
817
+ }
818
+ for (const key in params) {
819
+ if (acceptedBody.includes(key)) {
820
+ body = body !== null && body !== void 0 ? body : {};
821
+ // @ts-expect-error
822
+ body[key] = params[key];
823
+ }
824
+ else if (acceptedPath.includes(key)) {
825
+ continue;
826
+ }
827
+ else if (key !== 'body' && key !== 'querystring') {
828
+ if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
829
+ // @ts-expect-error
830
+ querystring[key] = params[key];
831
+ }
832
+ else {
833
+ body = body !== null && body !== void 0 ? body : {};
834
+ // @ts-expect-error
835
+ body[key] = params[key];
836
+ }
837
+ }
838
+ }
839
+ const method = 'PUT';
840
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.azureopenai_inference_id.toString())}`;
841
+ const meta = {
842
+ name: 'inference.put_azureopenai',
843
+ pathParts: {
844
+ task_type: params.task_type,
845
+ azureopenai_inference_id: params.azureopenai_inference_id
846
+ }
847
+ };
848
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
849
+ }
850
+ async putCohere(params, options) {
851
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.put_cohere'];
852
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
853
+ const querystring = userQuery != null ? { ...userQuery } : {};
854
+ let body;
855
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
856
+ if (userBody != null) {
857
+ if (typeof userBody === 'string') {
858
+ body = userBody;
859
+ }
860
+ else {
861
+ body = { ...userBody };
862
+ }
863
+ }
864
+ for (const key in params) {
865
+ if (acceptedBody.includes(key)) {
866
+ body = body !== null && body !== void 0 ? body : {};
867
+ // @ts-expect-error
868
+ body[key] = params[key];
869
+ }
870
+ else if (acceptedPath.includes(key)) {
871
+ continue;
872
+ }
873
+ else if (key !== 'body' && key !== 'querystring') {
874
+ if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
875
+ // @ts-expect-error
876
+ querystring[key] = params[key];
877
+ }
878
+ else {
879
+ body = body !== null && body !== void 0 ? body : {};
880
+ // @ts-expect-error
881
+ body[key] = params[key];
882
+ }
883
+ }
884
+ }
885
+ const method = 'PUT';
886
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.cohere_inference_id.toString())}`;
887
+ const meta = {
888
+ name: 'inference.put_cohere',
889
+ pathParts: {
890
+ task_type: params.task_type,
891
+ cohere_inference_id: params.cohere_inference_id
892
+ }
893
+ };
894
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
895
+ }
896
+ async putElasticsearch(params, options) {
897
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.put_elasticsearch'];
898
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
899
+ const querystring = userQuery != null ? { ...userQuery } : {};
900
+ let body;
901
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
902
+ if (userBody != null) {
903
+ if (typeof userBody === 'string') {
904
+ body = userBody;
905
+ }
906
+ else {
907
+ body = { ...userBody };
908
+ }
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' && key !== 'querystring') {
920
+ if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
921
+ // @ts-expect-error
922
+ querystring[key] = params[key];
923
+ }
924
+ else {
925
+ body = body !== null && body !== void 0 ? body : {};
926
+ // @ts-expect-error
927
+ body[key] = params[key];
928
+ }
929
+ }
930
+ }
931
+ const method = 'PUT';
932
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.elasticsearch_inference_id.toString())}`;
933
+ const meta = {
934
+ name: 'inference.put_elasticsearch',
935
+ pathParts: {
936
+ task_type: params.task_type,
937
+ elasticsearch_inference_id: params.elasticsearch_inference_id
938
+ }
939
+ };
940
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
941
+ }
942
+ async putElser(params, options) {
943
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.put_elser'];
944
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
945
+ const querystring = userQuery != null ? { ...userQuery } : {};
946
+ let body;
947
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
948
+ if (userBody != null) {
949
+ if (typeof userBody === 'string') {
950
+ body = userBody;
951
+ }
952
+ else {
953
+ body = { ...userBody };
954
+ }
955
+ }
956
+ for (const key in params) {
957
+ if (acceptedBody.includes(key)) {
958
+ body = body !== null && body !== void 0 ? body : {};
959
+ // @ts-expect-error
960
+ body[key] = params[key];
961
+ }
962
+ else if (acceptedPath.includes(key)) {
963
+ continue;
964
+ }
965
+ else if (key !== 'body' && key !== 'querystring') {
966
+ if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
967
+ // @ts-expect-error
968
+ querystring[key] = params[key];
969
+ }
970
+ else {
971
+ body = body !== null && body !== void 0 ? body : {};
972
+ // @ts-expect-error
973
+ body[key] = params[key];
974
+ }
975
+ }
976
+ }
977
+ const method = 'PUT';
978
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.elser_inference_id.toString())}`;
979
+ const meta = {
980
+ name: 'inference.put_elser',
981
+ pathParts: {
982
+ task_type: params.task_type,
983
+ elser_inference_id: params.elser_inference_id
984
+ }
985
+ };
986
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
987
+ }
988
+ async putGoogleaistudio(params, options) {
989
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.put_googleaistudio'];
990
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
991
+ const querystring = userQuery != null ? { ...userQuery } : {};
992
+ let body;
993
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
994
+ if (userBody != null) {
995
+ if (typeof userBody === 'string') {
996
+ body = userBody;
997
+ }
998
+ else {
999
+ body = { ...userBody };
1000
+ }
1001
+ }
1002
+ for (const key in params) {
1003
+ if (acceptedBody.includes(key)) {
1004
+ body = body !== null && body !== void 0 ? body : {};
1005
+ // @ts-expect-error
1006
+ body[key] = params[key];
1007
+ }
1008
+ else if (acceptedPath.includes(key)) {
1009
+ continue;
1010
+ }
1011
+ else if (key !== 'body' && key !== 'querystring') {
1012
+ if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
1013
+ // @ts-expect-error
1014
+ querystring[key] = params[key];
1015
+ }
1016
+ else {
1017
+ body = body !== null && body !== void 0 ? body : {};
1018
+ // @ts-expect-error
1019
+ body[key] = params[key];
1020
+ }
1021
+ }
1022
+ }
1023
+ const method = 'PUT';
1024
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.googleaistudio_inference_id.toString())}`;
1025
+ const meta = {
1026
+ name: 'inference.put_googleaistudio',
1027
+ pathParts: {
1028
+ task_type: params.task_type,
1029
+ googleaistudio_inference_id: params.googleaistudio_inference_id
1030
+ }
1031
+ };
1032
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1033
+ }
1034
+ async putGooglevertexai(params, options) {
1035
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.put_googlevertexai'];
1036
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1037
+ const querystring = userQuery != null ? { ...userQuery } : {};
1038
+ let body;
1039
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1040
+ if (userBody != null) {
1041
+ if (typeof userBody === 'string') {
1042
+ body = userBody;
1043
+ }
1044
+ else {
1045
+ body = { ...userBody };
1046
+ }
1047
+ }
1048
+ for (const key in params) {
1049
+ if (acceptedBody.includes(key)) {
1050
+ body = body !== null && body !== void 0 ? body : {};
1051
+ // @ts-expect-error
1052
+ body[key] = params[key];
1053
+ }
1054
+ else if (acceptedPath.includes(key)) {
1055
+ continue;
1056
+ }
1057
+ else if (key !== 'body' && key !== 'querystring') {
1058
+ if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
1059
+ // @ts-expect-error
1060
+ querystring[key] = params[key];
1061
+ }
1062
+ else {
1063
+ body = body !== null && body !== void 0 ? body : {};
1064
+ // @ts-expect-error
1065
+ body[key] = params[key];
1066
+ }
1067
+ }
1068
+ }
1069
+ const method = 'PUT';
1070
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.googlevertexai_inference_id.toString())}`;
1071
+ const meta = {
1072
+ name: 'inference.put_googlevertexai',
1073
+ pathParts: {
1074
+ task_type: params.task_type,
1075
+ googlevertexai_inference_id: params.googlevertexai_inference_id
1076
+ }
1077
+ };
1078
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1079
+ }
1080
+ async putHuggingFace(params, options) {
1081
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.put_hugging_face'];
1082
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1083
+ const querystring = userQuery != null ? { ...userQuery } : {};
1084
+ let body;
1085
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1086
+ if (userBody != null) {
1087
+ if (typeof userBody === 'string') {
1088
+ body = userBody;
1089
+ }
1090
+ else {
1091
+ body = { ...userBody };
1092
+ }
1093
+ }
1094
+ for (const key in params) {
1095
+ if (acceptedBody.includes(key)) {
1096
+ body = body !== null && body !== void 0 ? body : {};
1097
+ // @ts-expect-error
1098
+ body[key] = params[key];
1099
+ }
1100
+ else if (acceptedPath.includes(key)) {
1101
+ continue;
1102
+ }
1103
+ else if (key !== 'body' && key !== 'querystring') {
1104
+ if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
1105
+ // @ts-expect-error
1106
+ querystring[key] = params[key];
1107
+ }
1108
+ else {
1109
+ body = body !== null && body !== void 0 ? body : {};
1110
+ // @ts-expect-error
1111
+ body[key] = params[key];
1112
+ }
1113
+ }
1114
+ }
1115
+ const method = 'PUT';
1116
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.huggingface_inference_id.toString())}`;
1117
+ const meta = {
1118
+ name: 'inference.put_hugging_face',
1119
+ pathParts: {
1120
+ task_type: params.task_type,
1121
+ huggingface_inference_id: params.huggingface_inference_id
1122
+ }
1123
+ };
1124
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1125
+ }
1126
+ async putJinaai(params, options) {
1127
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.put_jinaai'];
1128
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1129
+ const querystring = userQuery != null ? { ...userQuery } : {};
1130
+ let body;
1131
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1132
+ if (userBody != null) {
1133
+ if (typeof userBody === 'string') {
1134
+ body = userBody;
1135
+ }
1136
+ else {
1137
+ body = { ...userBody };
1138
+ }
1139
+ }
1140
+ for (const key in params) {
1141
+ if (acceptedBody.includes(key)) {
1142
+ body = body !== null && body !== void 0 ? body : {};
1143
+ // @ts-expect-error
1144
+ body[key] = params[key];
1145
+ }
1146
+ else if (acceptedPath.includes(key)) {
1147
+ continue;
1148
+ }
1149
+ else if (key !== 'body' && key !== 'querystring') {
1150
+ if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
1151
+ // @ts-expect-error
1152
+ querystring[key] = params[key];
1153
+ }
1154
+ else {
1155
+ body = body !== null && body !== void 0 ? body : {};
1156
+ // @ts-expect-error
1157
+ body[key] = params[key];
1158
+ }
1159
+ }
1160
+ }
1161
+ const method = 'PUT';
1162
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.jinaai_inference_id.toString())}`;
1163
+ const meta = {
1164
+ name: 'inference.put_jinaai',
1165
+ pathParts: {
1166
+ task_type: params.task_type,
1167
+ jinaai_inference_id: params.jinaai_inference_id
1168
+ }
1169
+ };
1170
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1171
+ }
1172
+ async putMistral(params, options) {
1173
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.put_mistral'];
1174
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1175
+ const querystring = userQuery != null ? { ...userQuery } : {};
1176
+ let body;
1177
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1178
+ if (userBody != null) {
1179
+ if (typeof userBody === 'string') {
1180
+ body = userBody;
1181
+ }
1182
+ else {
1183
+ body = { ...userBody };
1184
+ }
1185
+ }
1186
+ for (const key in params) {
1187
+ if (acceptedBody.includes(key)) {
1188
+ body = body !== null && body !== void 0 ? body : {};
1189
+ // @ts-expect-error
1190
+ body[key] = params[key];
1191
+ }
1192
+ else if (acceptedPath.includes(key)) {
1193
+ continue;
1194
+ }
1195
+ else if (key !== 'body' && key !== 'querystring') {
1196
+ if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
1197
+ // @ts-expect-error
1198
+ querystring[key] = params[key];
1199
+ }
1200
+ else {
1201
+ body = body !== null && body !== void 0 ? body : {};
1202
+ // @ts-expect-error
1203
+ body[key] = params[key];
1204
+ }
1205
+ }
1206
+ }
1207
+ const method = 'PUT';
1208
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.mistral_inference_id.toString())}`;
1209
+ const meta = {
1210
+ name: 'inference.put_mistral',
1211
+ pathParts: {
1212
+ task_type: params.task_type,
1213
+ mistral_inference_id: params.mistral_inference_id
1214
+ }
1215
+ };
1216
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1217
+ }
1218
+ async putOpenai(params, options) {
1219
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.put_openai'];
1220
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1221
+ const querystring = userQuery != null ? { ...userQuery } : {};
1222
+ let body;
1223
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1224
+ if (userBody != null) {
1225
+ if (typeof userBody === 'string') {
1226
+ body = userBody;
1227
+ }
1228
+ else {
1229
+ body = { ...userBody };
1230
+ }
1231
+ }
1232
+ for (const key in params) {
1233
+ if (acceptedBody.includes(key)) {
1234
+ body = body !== null && body !== void 0 ? body : {};
1235
+ // @ts-expect-error
1236
+ body[key] = params[key];
1237
+ }
1238
+ else if (acceptedPath.includes(key)) {
1239
+ continue;
1240
+ }
1241
+ else if (key !== 'body' && key !== 'querystring') {
1242
+ if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
1243
+ // @ts-expect-error
1244
+ querystring[key] = params[key];
1245
+ }
1246
+ else {
1247
+ body = body !== null && body !== void 0 ? body : {};
1248
+ // @ts-expect-error
1249
+ body[key] = params[key];
1250
+ }
1251
+ }
404
1252
  }
405
- else {
406
- method = 'POST';
407
- path = `/_inference/${encodeURIComponent(params.inference_id.toString())}/_unified`;
1253
+ const method = 'PUT';
1254
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.openai_inference_id.toString())}`;
1255
+ const meta = {
1256
+ name: 'inference.put_openai',
1257
+ pathParts: {
1258
+ task_type: params.task_type,
1259
+ openai_inference_id: params.openai_inference_id
1260
+ }
1261
+ };
1262
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1263
+ }
1264
+ async putVoyageai(params, options) {
1265
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.put_voyageai'];
1266
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1267
+ const querystring = userQuery != null ? { ...userQuery } : {};
1268
+ let body;
1269
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1270
+ if (userBody != null) {
1271
+ if (typeof userBody === 'string') {
1272
+ body = userBody;
1273
+ }
1274
+ else {
1275
+ body = { ...userBody };
1276
+ }
1277
+ }
1278
+ for (const key in params) {
1279
+ if (acceptedBody.includes(key)) {
1280
+ body = body !== null && body !== void 0 ? body : {};
1281
+ // @ts-expect-error
1282
+ body[key] = params[key];
1283
+ }
1284
+ else if (acceptedPath.includes(key)) {
1285
+ continue;
1286
+ }
1287
+ else if (key !== 'body' && key !== 'querystring') {
1288
+ if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
1289
+ // @ts-expect-error
1290
+ querystring[key] = params[key];
1291
+ }
1292
+ else {
1293
+ body = body !== null && body !== void 0 ? body : {};
1294
+ // @ts-expect-error
1295
+ body[key] = params[key];
1296
+ }
1297
+ }
1298
+ }
1299
+ const method = 'PUT';
1300
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.voyageai_inference_id.toString())}`;
1301
+ const meta = {
1302
+ name: 'inference.put_voyageai',
1303
+ pathParts: {
1304
+ task_type: params.task_type,
1305
+ voyageai_inference_id: params.voyageai_inference_id
1306
+ }
1307
+ };
1308
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1309
+ }
1310
+ async putWatsonx(params, options) {
1311
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.put_watsonx'];
1312
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1313
+ const querystring = userQuery != null ? { ...userQuery } : {};
1314
+ let body;
1315
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1316
+ if (userBody != null) {
1317
+ if (typeof userBody === 'string') {
1318
+ body = userBody;
1319
+ }
1320
+ else {
1321
+ body = { ...userBody };
1322
+ }
1323
+ }
1324
+ for (const key in params) {
1325
+ if (acceptedBody.includes(key)) {
1326
+ body = body !== null && body !== void 0 ? body : {};
1327
+ // @ts-expect-error
1328
+ body[key] = params[key];
1329
+ }
1330
+ else if (acceptedPath.includes(key)) {
1331
+ continue;
1332
+ }
1333
+ else if (key !== 'body' && key !== 'querystring') {
1334
+ if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
1335
+ // @ts-expect-error
1336
+ querystring[key] = params[key];
1337
+ }
1338
+ else {
1339
+ body = body !== null && body !== void 0 ? body : {};
1340
+ // @ts-expect-error
1341
+ body[key] = params[key];
1342
+ }
1343
+ }
408
1344
  }
1345
+ const method = 'PUT';
1346
+ const path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.watsonx_inference_id.toString())}`;
409
1347
  const meta = {
410
- name: 'inference.unified_inference',
1348
+ name: 'inference.put_watsonx',
411
1349
  pathParts: {
412
1350
  task_type: params.task_type,
1351
+ watsonx_inference_id: params.watsonx_inference_id
1352
+ }
1353
+ };
1354
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1355
+ }
1356
+ async rerank(params, options) {
1357
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.rerank'];
1358
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1359
+ const querystring = userQuery != null ? { ...userQuery } : {};
1360
+ let body;
1361
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1362
+ if (userBody != null) {
1363
+ if (typeof userBody === 'string') {
1364
+ body = userBody;
1365
+ }
1366
+ else {
1367
+ body = { ...userBody };
1368
+ }
1369
+ }
1370
+ for (const key in params) {
1371
+ if (acceptedBody.includes(key)) {
1372
+ body = body !== null && body !== void 0 ? body : {};
1373
+ // @ts-expect-error
1374
+ body[key] = params[key];
1375
+ }
1376
+ else if (acceptedPath.includes(key)) {
1377
+ continue;
1378
+ }
1379
+ else if (key !== 'body' && key !== 'querystring') {
1380
+ if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
1381
+ // @ts-expect-error
1382
+ querystring[key] = params[key];
1383
+ }
1384
+ else {
1385
+ body = body !== null && body !== void 0 ? body : {};
1386
+ // @ts-expect-error
1387
+ body[key] = params[key];
1388
+ }
1389
+ }
1390
+ }
1391
+ const method = 'POST';
1392
+ const path = `/_inference/rerank/${encodeURIComponent(params.inference_id.toString())}`;
1393
+ const meta = {
1394
+ name: 'inference.rerank',
1395
+ pathParts: {
1396
+ inference_id: params.inference_id
1397
+ }
1398
+ };
1399
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1400
+ }
1401
+ async sparseEmbedding(params, options) {
1402
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.sparse_embedding'];
1403
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1404
+ const querystring = userQuery != null ? { ...userQuery } : {};
1405
+ let body;
1406
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1407
+ if (userBody != null) {
1408
+ if (typeof userBody === 'string') {
1409
+ body = userBody;
1410
+ }
1411
+ else {
1412
+ body = { ...userBody };
1413
+ }
1414
+ }
1415
+ for (const key in params) {
1416
+ if (acceptedBody.includes(key)) {
1417
+ body = body !== null && body !== void 0 ? body : {};
1418
+ // @ts-expect-error
1419
+ body[key] = params[key];
1420
+ }
1421
+ else if (acceptedPath.includes(key)) {
1422
+ continue;
1423
+ }
1424
+ else if (key !== 'body' && key !== 'querystring') {
1425
+ if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
1426
+ // @ts-expect-error
1427
+ querystring[key] = params[key];
1428
+ }
1429
+ else {
1430
+ body = body !== null && body !== void 0 ? body : {};
1431
+ // @ts-expect-error
1432
+ body[key] = params[key];
1433
+ }
1434
+ }
1435
+ }
1436
+ const method = 'POST';
1437
+ const path = `/_inference/sparse_embedding/${encodeURIComponent(params.inference_id.toString())}`;
1438
+ const meta = {
1439
+ name: 'inference.sparse_embedding',
1440
+ pathParts: {
1441
+ inference_id: params.inference_id
1442
+ }
1443
+ };
1444
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1445
+ }
1446
+ async streamCompletion(params, options) {
1447
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.stream_completion'];
1448
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1449
+ const querystring = userQuery != null ? { ...userQuery } : {};
1450
+ let body;
1451
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1452
+ if (userBody != null) {
1453
+ if (typeof userBody === 'string') {
1454
+ body = userBody;
1455
+ }
1456
+ else {
1457
+ body = { ...userBody };
1458
+ }
1459
+ }
1460
+ for (const key in params) {
1461
+ if (acceptedBody.includes(key)) {
1462
+ body = body !== null && body !== void 0 ? body : {};
1463
+ // @ts-expect-error
1464
+ body[key] = params[key];
1465
+ }
1466
+ else if (acceptedPath.includes(key)) {
1467
+ continue;
1468
+ }
1469
+ else if (key !== 'body' && key !== 'querystring') {
1470
+ if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
1471
+ // @ts-expect-error
1472
+ querystring[key] = params[key];
1473
+ }
1474
+ else {
1475
+ body = body !== null && body !== void 0 ? body : {};
1476
+ // @ts-expect-error
1477
+ body[key] = params[key];
1478
+ }
1479
+ }
1480
+ }
1481
+ const method = 'POST';
1482
+ const path = `/_inference/completion/${encodeURIComponent(params.inference_id.toString())}/_stream`;
1483
+ const meta = {
1484
+ name: 'inference.stream_completion',
1485
+ pathParts: {
1486
+ inference_id: params.inference_id
1487
+ }
1488
+ };
1489
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1490
+ }
1491
+ async textEmbedding(params, options) {
1492
+ const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this.acceptedParams['inference.text_embedding'];
1493
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1494
+ const querystring = userQuery != null ? { ...userQuery } : {};
1495
+ let body;
1496
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1497
+ if (userBody != null) {
1498
+ if (typeof userBody === 'string') {
1499
+ body = userBody;
1500
+ }
1501
+ else {
1502
+ body = { ...userBody };
1503
+ }
1504
+ }
1505
+ for (const key in params) {
1506
+ if (acceptedBody.includes(key)) {
1507
+ body = body !== null && body !== void 0 ? body : {};
1508
+ // @ts-expect-error
1509
+ body[key] = params[key];
1510
+ }
1511
+ else if (acceptedPath.includes(key)) {
1512
+ continue;
1513
+ }
1514
+ else if (key !== 'body' && key !== 'querystring') {
1515
+ if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
1516
+ // @ts-expect-error
1517
+ querystring[key] = params[key];
1518
+ }
1519
+ else {
1520
+ body = body !== null && body !== void 0 ? body : {};
1521
+ // @ts-expect-error
1522
+ body[key] = params[key];
1523
+ }
1524
+ }
1525
+ }
1526
+ const method = 'POST';
1527
+ const path = `/_inference/text_embedding/${encodeURIComponent(params.inference_id.toString())}`;
1528
+ const meta = {
1529
+ name: 'inference.text_embedding',
1530
+ pathParts: {
413
1531
  inference_id: params.inference_id
414
1532
  }
415
1533
  };
@@ -444,11 +1562,11 @@ class Inference {
444
1562
  let method = '';
445
1563
  let path = '';
446
1564
  if (params.task_type != null && params.inference_id != null) {
447
- method = 'POST';
1565
+ method = 'PUT';
448
1566
  path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.inference_id.toString())}/_update`;
449
1567
  }
450
1568
  else {
451
- method = 'POST';
1569
+ method = 'PUT';
452
1570
  path = `/_inference/${encodeURIComponent(params.inference_id.toString())}/_update`;
453
1571
  }
454
1572
  const meta = {