elasticsearch 8.19.0__py3-none-any.whl → 8.19.1__py3-none-any.whl
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.
- elasticsearch/_async/client/__init__.py +12 -6
- elasticsearch/_async/client/cat.py +124 -10
- elasticsearch/_async/client/cluster.py +7 -2
- elasticsearch/_async/client/esql.py +16 -6
- elasticsearch/_async/client/indices.py +1 -1
- elasticsearch/_async/client/inference.py +112 -4
- elasticsearch/_async/client/snapshot.py +262 -112
- elasticsearch/_async/client/sql.py +1 -1
- elasticsearch/_async/client/transform.py +60 -0
- elasticsearch/_sync/client/__init__.py +12 -6
- elasticsearch/_sync/client/cat.py +124 -10
- elasticsearch/_sync/client/cluster.py +7 -2
- elasticsearch/_sync/client/esql.py +16 -6
- elasticsearch/_sync/client/indices.py +1 -1
- elasticsearch/_sync/client/inference.py +112 -4
- elasticsearch/_sync/client/snapshot.py +262 -112
- elasticsearch/_sync/client/sql.py +1 -1
- elasticsearch/_sync/client/transform.py +60 -0
- elasticsearch/_version.py +1 -1
- elasticsearch/dsl/_async/document.py +84 -0
- elasticsearch/dsl/_sync/document.py +84 -0
- elasticsearch/dsl/aggs.py +20 -0
- elasticsearch/dsl/document_base.py +43 -0
- elasticsearch/dsl/field.py +49 -10
- elasticsearch/dsl/response/aggs.py +1 -1
- elasticsearch/dsl/types.py +140 -11
- elasticsearch/dsl/utils.py +1 -1
- elasticsearch/esql/__init__.py +2 -1
- elasticsearch/esql/esql.py +85 -34
- elasticsearch/esql/functions.py +37 -25
- {elasticsearch-8.19.0.dist-info → elasticsearch-8.19.1.dist-info}/METADATA +1 -3
- {elasticsearch-8.19.0.dist-info → elasticsearch-8.19.1.dist-info}/RECORD +35 -35
- {elasticsearch-8.19.0.dist-info → elasticsearch-8.19.1.dist-info}/WHEEL +0 -0
- {elasticsearch-8.19.0.dist-info → elasticsearch-8.19.1.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.19.0.dist-info → elasticsearch-8.19.1.dist-info}/licenses/NOTICE +0 -0
|
@@ -700,6 +700,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
700
700
|
<li>JavaScript: Check out <code>client.helpers.*</code></li>
|
|
701
701
|
<li>.NET: Check out <code>BulkAllObservable</code></li>
|
|
702
702
|
<li>PHP: Check out bulk indexing.</li>
|
|
703
|
+
<li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
|
|
703
704
|
</ul>
|
|
704
705
|
<p><strong>Submitting bulk requests with cURL</strong></p>
|
|
705
706
|
<p>If you're providing text file input to <code>curl</code>, you must use the <code>--data-binary</code> flag instead of plain <code>-d</code>.
|
|
@@ -1416,7 +1417,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1416
1417
|
)
|
|
1417
1418
|
|
|
1418
1419
|
@_rewrite_parameters(
|
|
1419
|
-
body_fields=("max_docs", "query", "slice"),
|
|
1420
|
+
body_fields=("max_docs", "query", "slice", "sort"),
|
|
1420
1421
|
parameter_aliases={"from": "from_"},
|
|
1421
1422
|
)
|
|
1422
1423
|
async def delete_by_query(
|
|
@@ -1460,7 +1461,12 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1460
1461
|
] = None,
|
|
1461
1462
|
slice: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
1462
1463
|
slices: t.Optional[t.Union[int, t.Union[str, t.Literal["auto"]]]] = None,
|
|
1463
|
-
sort: t.Optional[
|
|
1464
|
+
sort: t.Optional[
|
|
1465
|
+
t.Union[
|
|
1466
|
+
t.Sequence[t.Union[str, t.Mapping[str, t.Any]]],
|
|
1467
|
+
t.Union[str, t.Mapping[str, t.Any]],
|
|
1468
|
+
]
|
|
1469
|
+
] = None,
|
|
1464
1470
|
stats: t.Optional[t.Sequence[str]] = None,
|
|
1465
1471
|
terminate_after: t.Optional[int] = None,
|
|
1466
1472
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
@@ -1592,7 +1598,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1592
1598
|
:param slice: Slice the request manually using the provided slice ID and total
|
|
1593
1599
|
number of slices.
|
|
1594
1600
|
:param slices: The number of slices this task should be divided into.
|
|
1595
|
-
:param sort: A
|
|
1601
|
+
:param sort: A sort object that specifies the order of deleted documents.
|
|
1596
1602
|
:param stats: The specific `tag` of the request for logging and statistical purposes.
|
|
1597
1603
|
:param terminate_after: The maximum number of documents to collect for each shard.
|
|
1598
1604
|
If a query reaches this limit, Elasticsearch terminates the query early.
|
|
@@ -1682,8 +1688,6 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1682
1688
|
__query["search_type"] = search_type
|
|
1683
1689
|
if slices is not None:
|
|
1684
1690
|
__query["slices"] = slices
|
|
1685
|
-
if sort is not None:
|
|
1686
|
-
__query["sort"] = sort
|
|
1687
1691
|
if stats is not None:
|
|
1688
1692
|
__query["stats"] = stats
|
|
1689
1693
|
if terminate_after is not None:
|
|
@@ -1703,6 +1707,8 @@ class AsyncElasticsearch(BaseClient):
|
|
|
1703
1707
|
__body["query"] = query
|
|
1704
1708
|
if slice is not None:
|
|
1705
1709
|
__body["slice"] = slice
|
|
1710
|
+
if sort is not None:
|
|
1711
|
+
__body["sort"] = sort
|
|
1706
1712
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
1707
1713
|
return await self.perform_request( # type: ignore[return-value]
|
|
1708
1714
|
"POST",
|
|
@@ -6010,7 +6016,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
6010
6016
|
doc: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
6011
6017
|
error_trace: t.Optional[bool] = None,
|
|
6012
6018
|
field_statistics: t.Optional[bool] = None,
|
|
6013
|
-
fields: t.Optional[t.
|
|
6019
|
+
fields: t.Optional[t.Sequence[str]] = None,
|
|
6014
6020
|
filter: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
6015
6021
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
6016
6022
|
human: t.Optional[bool] = None,
|
|
@@ -47,7 +47,34 @@ class CatClient(NamespacedClient):
|
|
|
47
47
|
] = None,
|
|
48
48
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
49
49
|
format: t.Optional[str] = None,
|
|
50
|
-
h: t.Optional[
|
|
50
|
+
h: t.Optional[
|
|
51
|
+
t.Union[
|
|
52
|
+
t.Sequence[
|
|
53
|
+
t.Union[
|
|
54
|
+
str,
|
|
55
|
+
t.Literal[
|
|
56
|
+
"alias",
|
|
57
|
+
"filter",
|
|
58
|
+
"index",
|
|
59
|
+
"is_write_index",
|
|
60
|
+
"routing.index",
|
|
61
|
+
"routing.search",
|
|
62
|
+
],
|
|
63
|
+
]
|
|
64
|
+
],
|
|
65
|
+
t.Union[
|
|
66
|
+
str,
|
|
67
|
+
t.Literal[
|
|
68
|
+
"alias",
|
|
69
|
+
"filter",
|
|
70
|
+
"index",
|
|
71
|
+
"is_write_index",
|
|
72
|
+
"routing.index",
|
|
73
|
+
"routing.search",
|
|
74
|
+
],
|
|
75
|
+
],
|
|
76
|
+
]
|
|
77
|
+
] = None,
|
|
51
78
|
help: t.Optional[bool] = None,
|
|
52
79
|
human: t.Optional[bool] = None,
|
|
53
80
|
local: t.Optional[bool] = None,
|
|
@@ -74,7 +101,8 @@ class CatClient(NamespacedClient):
|
|
|
74
101
|
values, such as `open,hidden`.
|
|
75
102
|
:param format: Specifies the format to return the columnar data in, can be set
|
|
76
103
|
to `text`, `json`, `cbor`, `yaml`, or `smile`.
|
|
77
|
-
:param h:
|
|
104
|
+
:param h: A comma-separated list of columns names to display. It supports simple
|
|
105
|
+
wildcards.
|
|
78
106
|
:param help: When set to `true` will output available columns. This option can't
|
|
79
107
|
be combined with any other query string option.
|
|
80
108
|
:param local: If `true`, the request computes the list of selected nodes from
|
|
@@ -137,7 +165,48 @@ class CatClient(NamespacedClient):
|
|
|
137
165
|
error_trace: t.Optional[bool] = None,
|
|
138
166
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
139
167
|
format: t.Optional[str] = None,
|
|
140
|
-
h: t.Optional[
|
|
168
|
+
h: t.Optional[
|
|
169
|
+
t.Union[
|
|
170
|
+
t.Sequence[
|
|
171
|
+
t.Union[
|
|
172
|
+
str,
|
|
173
|
+
t.Literal[
|
|
174
|
+
"disk.avail",
|
|
175
|
+
"disk.indices",
|
|
176
|
+
"disk.indices.forecast",
|
|
177
|
+
"disk.percent",
|
|
178
|
+
"disk.total",
|
|
179
|
+
"disk.used",
|
|
180
|
+
"host",
|
|
181
|
+
"ip",
|
|
182
|
+
"node",
|
|
183
|
+
"node.role",
|
|
184
|
+
"shards",
|
|
185
|
+
"shards.undesired",
|
|
186
|
+
"write_load.forecast",
|
|
187
|
+
],
|
|
188
|
+
]
|
|
189
|
+
],
|
|
190
|
+
t.Union[
|
|
191
|
+
str,
|
|
192
|
+
t.Literal[
|
|
193
|
+
"disk.avail",
|
|
194
|
+
"disk.indices",
|
|
195
|
+
"disk.indices.forecast",
|
|
196
|
+
"disk.percent",
|
|
197
|
+
"disk.total",
|
|
198
|
+
"disk.used",
|
|
199
|
+
"host",
|
|
200
|
+
"ip",
|
|
201
|
+
"node",
|
|
202
|
+
"node.role",
|
|
203
|
+
"shards",
|
|
204
|
+
"shards.undesired",
|
|
205
|
+
"write_load.forecast",
|
|
206
|
+
],
|
|
207
|
+
],
|
|
208
|
+
]
|
|
209
|
+
] = None,
|
|
141
210
|
help: t.Optional[bool] = None,
|
|
142
211
|
human: t.Optional[bool] = None,
|
|
143
212
|
local: t.Optional[bool] = None,
|
|
@@ -161,7 +230,8 @@ class CatClient(NamespacedClient):
|
|
|
161
230
|
:param bytes: The unit used to display byte values.
|
|
162
231
|
:param format: Specifies the format to return the columnar data in, can be set
|
|
163
232
|
to `text`, `json`, `cbor`, `yaml`, or `smile`.
|
|
164
|
-
:param h:
|
|
233
|
+
:param h: A comma-separated list of columns names to display. It supports simple
|
|
234
|
+
wildcards.
|
|
165
235
|
:param help: When set to `true` will output available columns. This option can't
|
|
166
236
|
be combined with any other query string option.
|
|
167
237
|
:param local: If `true`, the request computes the list of selected nodes from
|
|
@@ -224,7 +294,36 @@ class CatClient(NamespacedClient):
|
|
|
224
294
|
error_trace: t.Optional[bool] = None,
|
|
225
295
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
226
296
|
format: t.Optional[str] = None,
|
|
227
|
-
h: t.Optional[
|
|
297
|
+
h: t.Optional[
|
|
298
|
+
t.Union[
|
|
299
|
+
t.Sequence[
|
|
300
|
+
t.Union[
|
|
301
|
+
str,
|
|
302
|
+
t.Literal[
|
|
303
|
+
"alias_count",
|
|
304
|
+
"included_in",
|
|
305
|
+
"mapping_count",
|
|
306
|
+
"metadata_count",
|
|
307
|
+
"name",
|
|
308
|
+
"settings_count",
|
|
309
|
+
"version",
|
|
310
|
+
],
|
|
311
|
+
]
|
|
312
|
+
],
|
|
313
|
+
t.Union[
|
|
314
|
+
str,
|
|
315
|
+
t.Literal[
|
|
316
|
+
"alias_count",
|
|
317
|
+
"included_in",
|
|
318
|
+
"mapping_count",
|
|
319
|
+
"metadata_count",
|
|
320
|
+
"name",
|
|
321
|
+
"settings_count",
|
|
322
|
+
"version",
|
|
323
|
+
],
|
|
324
|
+
],
|
|
325
|
+
]
|
|
326
|
+
] = None,
|
|
228
327
|
help: t.Optional[bool] = None,
|
|
229
328
|
human: t.Optional[bool] = None,
|
|
230
329
|
local: t.Optional[bool] = None,
|
|
@@ -249,7 +348,8 @@ class CatClient(NamespacedClient):
|
|
|
249
348
|
If it is omitted, all component templates are returned.
|
|
250
349
|
:param format: Specifies the format to return the columnar data in, can be set
|
|
251
350
|
to `text`, `json`, `cbor`, `yaml`, or `smile`.
|
|
252
|
-
:param h:
|
|
351
|
+
:param h: A comma-separated list of columns names to display. It supports simple
|
|
352
|
+
wildcards.
|
|
253
353
|
:param help: When set to `true` will output available columns. This option can't
|
|
254
354
|
be combined with any other query string option.
|
|
255
355
|
:param local: If `true`, the request computes the list of selected nodes from
|
|
@@ -310,7 +410,12 @@ class CatClient(NamespacedClient):
|
|
|
310
410
|
error_trace: t.Optional[bool] = None,
|
|
311
411
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
312
412
|
format: t.Optional[str] = None,
|
|
313
|
-
h: t.Optional[
|
|
413
|
+
h: t.Optional[
|
|
414
|
+
t.Union[
|
|
415
|
+
t.Sequence[t.Union[str, t.Literal["count", "epoch", "timestamp"]]],
|
|
416
|
+
t.Union[str, t.Literal["count", "epoch", "timestamp"]],
|
|
417
|
+
]
|
|
418
|
+
] = None,
|
|
314
419
|
help: t.Optional[bool] = None,
|
|
315
420
|
human: t.Optional[bool] = None,
|
|
316
421
|
pretty: t.Optional[bool] = None,
|
|
@@ -334,7 +439,8 @@ class CatClient(NamespacedClient):
|
|
|
334
439
|
and indices, omit this parameter or use `*` or `_all`.
|
|
335
440
|
:param format: Specifies the format to return the columnar data in, can be set
|
|
336
441
|
to `text`, `json`, `cbor`, `yaml`, or `smile`.
|
|
337
|
-
:param h:
|
|
442
|
+
:param h: A comma-separated list of columns names to display. It supports simple
|
|
443
|
+
wildcards.
|
|
338
444
|
:param help: When set to `true` will output available columns. This option can't
|
|
339
445
|
be combined with any other query string option.
|
|
340
446
|
:param s: List of columns that determine how the table should be sorted. Sorting
|
|
@@ -389,7 +495,14 @@ class CatClient(NamespacedClient):
|
|
|
389
495
|
error_trace: t.Optional[bool] = None,
|
|
390
496
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
391
497
|
format: t.Optional[str] = None,
|
|
392
|
-
h: t.Optional[
|
|
498
|
+
h: t.Optional[
|
|
499
|
+
t.Union[
|
|
500
|
+
t.Sequence[
|
|
501
|
+
t.Union[str, t.Literal["field", "host", "id", "ip", "node", "size"]]
|
|
502
|
+
],
|
|
503
|
+
t.Union[str, t.Literal["field", "host", "id", "ip", "node", "size"]],
|
|
504
|
+
]
|
|
505
|
+
] = None,
|
|
393
506
|
help: t.Optional[bool] = None,
|
|
394
507
|
human: t.Optional[bool] = None,
|
|
395
508
|
pretty: t.Optional[bool] = None,
|
|
@@ -412,7 +525,8 @@ class CatClient(NamespacedClient):
|
|
|
412
525
|
:param bytes: The unit used to display byte values.
|
|
413
526
|
:param format: Specifies the format to return the columnar data in, can be set
|
|
414
527
|
to `text`, `json`, `cbor`, `yaml`, or `smile`.
|
|
415
|
-
:param h:
|
|
528
|
+
:param h: A comma-separated list of columns names to display. It supports simple
|
|
529
|
+
wildcards.
|
|
416
530
|
:param help: When set to `true` will output available columns. This option can't
|
|
417
531
|
be combined with any other query string option.
|
|
418
532
|
:param s: List of columns that determine how the table should be sorted. Sorting
|
|
@@ -373,8 +373,13 @@ class ClusterClient(NamespacedClient):
|
|
|
373
373
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.19/cluster-get-settings.html>`_
|
|
374
374
|
|
|
375
375
|
:param flat_settings: If `true`, returns settings in flat format.
|
|
376
|
-
:param include_defaults: If `true`, returns default
|
|
377
|
-
|
|
376
|
+
:param include_defaults: If `true`, also returns default values for all other
|
|
377
|
+
cluster settings, reflecting the values in the `elasticsearch.yml` file of
|
|
378
|
+
one of the nodes in the cluster. If the nodes in your cluster do not all
|
|
379
|
+
have the same values in their `elasticsearch.yml` config files then the values
|
|
380
|
+
returned by this API may vary from invocation to invocation and may not reflect
|
|
381
|
+
the values that Elasticsearch uses in all situations. Use the `GET _nodes/settings`
|
|
382
|
+
API to fetch the settings for each individual node in your cluster.
|
|
378
383
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
379
384
|
no response is received before the timeout expires, the request fails and
|
|
380
385
|
returns an error.
|
|
@@ -22,6 +22,9 @@ from elastic_transport import ObjectApiResponse
|
|
|
22
22
|
from ._base import NamespacedClient
|
|
23
23
|
from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
|
|
24
24
|
|
|
25
|
+
if t.TYPE_CHECKING:
|
|
26
|
+
from elasticsearch.esql import ESQLBase
|
|
27
|
+
|
|
25
28
|
|
|
26
29
|
class EsqlClient(NamespacedClient):
|
|
27
30
|
|
|
@@ -44,7 +47,7 @@ class EsqlClient(NamespacedClient):
|
|
|
44
47
|
async def async_query(
|
|
45
48
|
self,
|
|
46
49
|
*,
|
|
47
|
-
query: t.Optional[str] = None,
|
|
50
|
+
query: t.Optional[t.Union[str, "ESQLBase"]] = None,
|
|
48
51
|
allow_partial_results: t.Optional[bool] = None,
|
|
49
52
|
columnar: t.Optional[bool] = None,
|
|
50
53
|
delimiter: t.Optional[str] = None,
|
|
@@ -107,7 +110,12 @@ class EsqlClient(NamespacedClient):
|
|
|
107
110
|
which has the name of all the columns.
|
|
108
111
|
:param filter: Specify a Query DSL query in the filter parameter to filter the
|
|
109
112
|
set of documents that an ES|QL query runs on.
|
|
110
|
-
:param format: A short version of the Accept header,
|
|
113
|
+
:param format: A short version of the Accept header, e.g. json, yaml. `csv`,
|
|
114
|
+
`tsv`, and `txt` formats will return results in a tabular format, excluding
|
|
115
|
+
other metadata fields from the response. For async requests, nothing will
|
|
116
|
+
be returned if the async query doesn't finish within the timeout. The query
|
|
117
|
+
ID and running status are available in the `X-Elasticsearch-Async-Id` and
|
|
118
|
+
`X-Elasticsearch-Async-Is-Running` HTTP headers of the response, respectively.
|
|
111
119
|
:param include_ccs_metadata: When set to `true` and performing a cross-cluster
|
|
112
120
|
query, the response will include an extra `_clusters` object with information
|
|
113
121
|
about the clusters that participated in the search along with info such as
|
|
@@ -161,7 +169,7 @@ class EsqlClient(NamespacedClient):
|
|
|
161
169
|
__query["pretty"] = pretty
|
|
162
170
|
if not __body:
|
|
163
171
|
if query is not None:
|
|
164
|
-
__body["query"] = query
|
|
172
|
+
__body["query"] = str(query)
|
|
165
173
|
if columnar is not None:
|
|
166
174
|
__body["columnar"] = columnar
|
|
167
175
|
if filter is not None:
|
|
@@ -399,7 +407,7 @@ class EsqlClient(NamespacedClient):
|
|
|
399
407
|
async def query(
|
|
400
408
|
self,
|
|
401
409
|
*,
|
|
402
|
-
query: t.Optional[str] = None,
|
|
410
|
+
query: t.Optional[t.Union[str, "ESQLBase"]] = None,
|
|
403
411
|
allow_partial_results: t.Optional[bool] = None,
|
|
404
412
|
columnar: t.Optional[bool] = None,
|
|
405
413
|
delimiter: t.Optional[str] = None,
|
|
@@ -456,7 +464,9 @@ class EsqlClient(NamespacedClient):
|
|
|
456
464
|
`all_columns` which has the name of all columns.
|
|
457
465
|
:param filter: Specify a Query DSL query in the filter parameter to filter the
|
|
458
466
|
set of documents that an ES|QL query runs on.
|
|
459
|
-
:param format: A short version of the Accept header, e.g. json, yaml.
|
|
467
|
+
:param format: A short version of the Accept header, e.g. json, yaml. `csv`,
|
|
468
|
+
`tsv`, and `txt` formats will return results in a tabular format, excluding
|
|
469
|
+
other metadata fields from the response.
|
|
460
470
|
:param include_ccs_metadata: When set to `true` and performing a cross-cluster
|
|
461
471
|
query, the response will include an extra `_clusters` object with information
|
|
462
472
|
about the clusters that participated in the search along with info such as
|
|
@@ -496,7 +506,7 @@ class EsqlClient(NamespacedClient):
|
|
|
496
506
|
__query["pretty"] = pretty
|
|
497
507
|
if not __body:
|
|
498
508
|
if query is not None:
|
|
499
|
-
__body["query"] = query
|
|
509
|
+
__body["query"] = str(query)
|
|
500
510
|
if columnar is not None:
|
|
501
511
|
__body["columnar"] = columnar
|
|
502
512
|
if filter is not None:
|
|
@@ -4581,7 +4581,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4581
4581
|
.. raw:: html
|
|
4582
4582
|
|
|
4583
4583
|
<p>Roll over to a new index.
|
|
4584
|
-
TIP:
|
|
4584
|
+
TIP: We recommend using the index lifecycle rollover action to automate rollovers. However, Serverless does not support Index Lifecycle Management (ILM), so don't use this approach in the Serverless context.</p>
|
|
4585
4585
|
<p>The rollover API creates a new index for a data stream or index alias.
|
|
4586
4586
|
The API behavior depends on the rollover target.</p>
|
|
4587
4587
|
<p><strong>Roll over a data stream</strong></p>
|
|
@@ -391,21 +391,23 @@ class InferenceClient(NamespacedClient):
|
|
|
391
391
|
<ul>
|
|
392
392
|
<li>AlibabaCloud AI Search (<code>completion</code>, <code>rerank</code>, <code>sparse_embedding</code>, <code>text_embedding</code>)</li>
|
|
393
393
|
<li>Amazon Bedrock (<code>completion</code>, <code>text_embedding</code>)</li>
|
|
394
|
+
<li>Amazon SageMaker (<code>chat_completion</code>, <code>completion</code>, <code>rerank</code>, <code>sparse_embedding</code>, <code>text_embedding</code>)</li>
|
|
394
395
|
<li>Anthropic (<code>completion</code>)</li>
|
|
395
396
|
<li>Azure AI Studio (<code>completion</code>, <code>text_embedding</code>)</li>
|
|
396
397
|
<li>Azure OpenAI (<code>completion</code>, <code>text_embedding</code>)</li>
|
|
397
398
|
<li>Cohere (<code>completion</code>, <code>rerank</code>, <code>text_embedding</code>)</li>
|
|
398
|
-
<li>DeepSeek (<code>
|
|
399
|
+
<li>DeepSeek (<code>chat_completion</code>, <code>completion</code>)</li>
|
|
399
400
|
<li>Elasticsearch (<code>rerank</code>, <code>sparse_embedding</code>, <code>text_embedding</code> - this service is for built-in models and models uploaded through Eland)</li>
|
|
400
401
|
<li>ELSER (<code>sparse_embedding</code>)</li>
|
|
401
402
|
<li>Google AI Studio (<code>completion</code>, <code>text_embedding</code>)</li>
|
|
402
|
-
<li>Google Vertex AI (<code>rerank</code>, <code>text_embedding</code>)</li>
|
|
403
|
+
<li>Google Vertex AI (<code>chat_completion</code>, <code>completion</code>, <code>rerank</code>, <code>text_embedding</code>)</li>
|
|
403
404
|
<li>Hugging Face (<code>chat_completion</code>, <code>completion</code>, <code>rerank</code>, <code>text_embedding</code>)</li>
|
|
405
|
+
<li>JinaAI (<code>rerank</code>, <code>text_embedding</code>)</li>
|
|
406
|
+
<li>Llama (<code>chat_completion</code>, <code>completion</code>, <code>text_embedding</code>)</li>
|
|
404
407
|
<li>Mistral (<code>chat_completion</code>, <code>completion</code>, <code>text_embedding</code>)</li>
|
|
405
408
|
<li>OpenAI (<code>chat_completion</code>, <code>completion</code>, <code>text_embedding</code>)</li>
|
|
406
|
-
<li>VoyageAI (<code>
|
|
409
|
+
<li>VoyageAI (<code>rerank</code>, <code>text_embedding</code>)</li>
|
|
407
410
|
<li>Watsonx inference integration (<code>text_embedding</code>)</li>
|
|
408
|
-
<li>JinaAI (<code>text_embedding</code>, <code>rerank</code>)</li>
|
|
409
411
|
</ul>
|
|
410
412
|
|
|
411
413
|
|
|
@@ -659,6 +661,112 @@ class InferenceClient(NamespacedClient):
|
|
|
659
661
|
path_parts=__path_parts,
|
|
660
662
|
)
|
|
661
663
|
|
|
664
|
+
@_rewrite_parameters(
|
|
665
|
+
body_fields=(
|
|
666
|
+
"service",
|
|
667
|
+
"service_settings",
|
|
668
|
+
"chunking_settings",
|
|
669
|
+
"task_settings",
|
|
670
|
+
),
|
|
671
|
+
)
|
|
672
|
+
async def put_amazonsagemaker(
|
|
673
|
+
self,
|
|
674
|
+
*,
|
|
675
|
+
task_type: t.Union[
|
|
676
|
+
str,
|
|
677
|
+
t.Literal[
|
|
678
|
+
"chat_completion",
|
|
679
|
+
"completion",
|
|
680
|
+
"rerank",
|
|
681
|
+
"sparse_embedding",
|
|
682
|
+
"text_embedding",
|
|
683
|
+
],
|
|
684
|
+
],
|
|
685
|
+
amazonsagemaker_inference_id: str,
|
|
686
|
+
service: t.Optional[t.Union[str, t.Literal["amazon_sagemaker"]]] = None,
|
|
687
|
+
service_settings: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
688
|
+
chunking_settings: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
689
|
+
error_trace: t.Optional[bool] = None,
|
|
690
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
691
|
+
human: t.Optional[bool] = None,
|
|
692
|
+
pretty: t.Optional[bool] = None,
|
|
693
|
+
task_settings: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
694
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
695
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
696
|
+
) -> ObjectApiResponse[t.Any]:
|
|
697
|
+
"""
|
|
698
|
+
.. raw:: html
|
|
699
|
+
|
|
700
|
+
<p>Create an Amazon SageMaker inference endpoint.</p>
|
|
701
|
+
<p>Create an inference endpoint to perform an inference task with the <code>amazon_sagemaker</code> service.</p>
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-amazonsagemaker>`_
|
|
705
|
+
|
|
706
|
+
:param task_type: The type of the inference task that the model will perform.
|
|
707
|
+
:param amazonsagemaker_inference_id: The unique identifier of the inference endpoint.
|
|
708
|
+
:param service: The type of service supported for the specified task type. In
|
|
709
|
+
this case, `amazon_sagemaker`.
|
|
710
|
+
:param service_settings: Settings used to install the inference model. These
|
|
711
|
+
settings are specific to the `amazon_sagemaker` service and `service_settings.api`
|
|
712
|
+
you specified.
|
|
713
|
+
:param chunking_settings: The chunking configuration object.
|
|
714
|
+
:param task_settings: Settings to configure the inference task. These settings
|
|
715
|
+
are specific to the task type and `service_settings.api` you specified.
|
|
716
|
+
:param timeout: Specifies the amount of time to wait for the inference endpoint
|
|
717
|
+
to be created.
|
|
718
|
+
"""
|
|
719
|
+
if task_type in SKIP_IN_PATH:
|
|
720
|
+
raise ValueError("Empty value passed for parameter 'task_type'")
|
|
721
|
+
if amazonsagemaker_inference_id in SKIP_IN_PATH:
|
|
722
|
+
raise ValueError(
|
|
723
|
+
"Empty value passed for parameter 'amazonsagemaker_inference_id'"
|
|
724
|
+
)
|
|
725
|
+
if service is None and body is None:
|
|
726
|
+
raise ValueError("Empty value passed for parameter 'service'")
|
|
727
|
+
if service_settings is None and body is None:
|
|
728
|
+
raise ValueError("Empty value passed for parameter 'service_settings'")
|
|
729
|
+
__path_parts: t.Dict[str, str] = {
|
|
730
|
+
"task_type": _quote(task_type),
|
|
731
|
+
"amazonsagemaker_inference_id": _quote(amazonsagemaker_inference_id),
|
|
732
|
+
}
|
|
733
|
+
__path = f'/_inference/{__path_parts["task_type"]}/{__path_parts["amazonsagemaker_inference_id"]}'
|
|
734
|
+
__query: t.Dict[str, t.Any] = {}
|
|
735
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
736
|
+
if error_trace is not None:
|
|
737
|
+
__query["error_trace"] = error_trace
|
|
738
|
+
if filter_path is not None:
|
|
739
|
+
__query["filter_path"] = filter_path
|
|
740
|
+
if human is not None:
|
|
741
|
+
__query["human"] = human
|
|
742
|
+
if pretty is not None:
|
|
743
|
+
__query["pretty"] = pretty
|
|
744
|
+
if timeout is not None:
|
|
745
|
+
__query["timeout"] = timeout
|
|
746
|
+
if not __body:
|
|
747
|
+
if service is not None:
|
|
748
|
+
__body["service"] = service
|
|
749
|
+
if service_settings is not None:
|
|
750
|
+
__body["service_settings"] = service_settings
|
|
751
|
+
if chunking_settings is not None:
|
|
752
|
+
__body["chunking_settings"] = chunking_settings
|
|
753
|
+
if task_settings is not None:
|
|
754
|
+
__body["task_settings"] = task_settings
|
|
755
|
+
if not __body:
|
|
756
|
+
__body = None # type: ignore[assignment]
|
|
757
|
+
__headers = {"accept": "application/json"}
|
|
758
|
+
if __body is not None:
|
|
759
|
+
__headers["content-type"] = "application/json"
|
|
760
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
761
|
+
"PUT",
|
|
762
|
+
__path,
|
|
763
|
+
params=__query,
|
|
764
|
+
headers=__headers,
|
|
765
|
+
body=__body,
|
|
766
|
+
endpoint_id="inference.put_amazonsagemaker",
|
|
767
|
+
path_parts=__path_parts,
|
|
768
|
+
)
|
|
769
|
+
|
|
662
770
|
@_rewrite_parameters(
|
|
663
771
|
body_fields=(
|
|
664
772
|
"service",
|