Skip to content

Commit 94ca75b

Browse files
Auto-generated API code
1 parent 1c9b51f commit 94ca75b

13 files changed

Lines changed: 857 additions & 19 deletions

File tree

‎elasticsearch/_async/client/cat.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3204,6 +3204,7 @@ async def recovery(
32043204
t.Union[
32053205
str,
32063206
t.Literal[
3207+
"blocked_for_millis",
32073208
"bytes",
32083209
"bytes_percent",
32093210
"bytes_recovered",
@@ -3212,6 +3213,7 @@ async def recovery(
32123213
"files_percent",
32133214
"files_recovered",
32143215
"files_total",
3216+
"gate",
32153217
"index",
32163218
"local_retries",
32173219
"priority",
@@ -3238,6 +3240,7 @@ async def recovery(
32383240
t.Union[
32393241
str,
32403242
t.Literal[
3243+
"blocked_for_millis",
32413244
"bytes",
32423245
"bytes_percent",
32433246
"bytes_recovered",
@@ -3246,6 +3249,7 @@ async def recovery(
32463249
"files_percent",
32473250
"files_recovered",
32483251
"files_total",
3252+
"gate",
32493253
"index",
32503254
"local_retries",
32513255
"priority",
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Licensed to Elasticsearch B.V. under one or more contributor
2+
# license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright
4+
# ownership. Elasticsearch B.V. licenses this file to you under
5+
# the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
class C:
19+
20+
@_rewrite_parameters()
21+
@_availability_warning(Stability.STABLE, Visibility.PRIVATE)
22+
async def get_recovery_points(
23+
self,
24+
*,
25+
end_time_before: t.Optional[t.Union[str, t.Any]] = None,
26+
error_trace: t.Optional[bool] = None,
27+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
28+
human: t.Optional[bool] = None,
29+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
30+
pretty: t.Optional[bool] = None,
31+
size: t.Optional[int] = None,
32+
) -> ObjectApiResponse[t.Any]:
33+
"""
34+
.. raw:: html
35+
36+
<p>Get recovery points.</p>
37+
<p>Get recovery points from the platform-managed data recovery repository.
38+
This API is intended for internal operator use.
39+
Recovery points are returned in descending order by end time. Repository,
40+
snapshot, and policy identifiers are not exposed.</p>
41+
42+
43+
:param end_time_before: Return only recovery points whose end time is earlier
44+
than this value. The boundary is exclusive and can be set to the last recovery
45+
point's end time to retrieve the next page.
46+
:param master_timeout: The period to wait for a connection to the master node.
47+
If no response is received before the timeout expires, the request fails
48+
and returns an error.
49+
:param size: The maximum number of recovery points to return. The value must
50+
be between 1 and 1000.
51+
"""
52+
__path_parts: t.Dict[str, str] = {}
53+
__path = "/_data_recovery/points"
54+
__query: t.Dict[str, t.Any] = {}
55+
if end_time_before is not None:
56+
__query["end_time_before"] = end_time_before
57+
if error_trace is not None:
58+
__query["error_trace"] = error_trace
59+
if filter_path is not None:
60+
__query["filter_path"] = filter_path
61+
if human is not None:
62+
__query["human"] = human
63+
if master_timeout is not None:
64+
__query["master_timeout"] = master_timeout
65+
if pretty is not None:
66+
__query["pretty"] = pretty
67+
if size is not None:
68+
__query["size"] = size
69+
__headers = {"accept": "application/json"}
70+
return await self.perform_request( # type: ignore[return-value]
71+
"GET",
72+
__path,
73+
params=__query,
74+
headers=__headers,
75+
endpoint_id="data_recovery.get_recovery_points",
76+
path_parts=__path_parts,
77+
)

‎elasticsearch/_async/client/inference.py‎

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,90 @@ async def inference(
506506
path_parts=__path_parts,
507507
)
508508

509+
@_rewrite_parameters(
510+
body_name="chat_completion_request",
511+
)
512+
async def non_streaming_chat_completion(
513+
self,
514+
*,
515+
inference_id: str,
516+
chat_completion_request: t.Optional[t.Mapping[str, t.Any]] = None,
517+
body: t.Optional[t.Mapping[str, t.Any]] = None,
518+
error_trace: t.Optional[bool] = None,
519+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
520+
human: t.Optional[bool] = None,
521+
pretty: t.Optional[bool] = None,
522+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
523+
) -> ObjectApiResponse[t.Any]:
524+
"""
525+
.. raw:: html
526+
527+
<p>Perform non-streaming chat completion inference on the service.</p>
528+
<p>The chat completion inference API enables rich responses for chat completion tasks.
529+
It only works with the <code>chat_completion</code> task type.</p>
530+
<p>NOTE: The <code>chat_completion</code> task type supports both streaming and non-streaming.
531+
The Chat completion inference API provides more comprehensive customization options through more fields and function calling support.
532+
To determine whether a given inference service supports this task type, please see the page for that service.</p>
533+
<p>These services support non-streaming chat completion inference:</p>
534+
<ul>
535+
<li>AI21</li>
536+
<li>Azure OpenAI</li>
537+
<li>Deepseek</li>
538+
<li>Elastic</li>
539+
<li>FireworksAI</li>
540+
<li>Groq</li>
541+
<li>Huggingface</li>
542+
<li>IBMWatsonX</li>
543+
<li>Llama</li>
544+
<li>Mistral</li>
545+
<li>NVIDIA</li>
546+
<li>OpenAI</li>
547+
<li>OpenShiftAI</li>
548+
</ul>
549+
550+
551+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-non-streaming-chat-completion>`_
552+
553+
:param inference_id: The inference Id
554+
:param chat_completion_request:
555+
:param timeout: Specifies the amount of time to wait for the inference request
556+
to complete.
557+
"""
558+
if inference_id in SKIP_IN_PATH:
559+
raise ValueError("Empty value passed for parameter 'inference_id'")
560+
if chat_completion_request is None and body is None:
561+
raise ValueError(
562+
"Empty value passed for parameters 'chat_completion_request' and 'body', one of them should be set."
563+
)
564+
elif chat_completion_request is not None and body is not None:
565+
raise ValueError("Cannot set both 'chat_completion_request' and 'body'")
566+
__path_parts: t.Dict[str, str] = {"inference_id": _quote(inference_id)}
567+
__path = f'/_inference/chat_completion/{__path_parts["inference_id"]}'
568+
__query: t.Dict[str, t.Any] = {}
569+
if error_trace is not None:
570+
__query["error_trace"] = error_trace
571+
if filter_path is not None:
572+
__query["filter_path"] = filter_path
573+
if human is not None:
574+
__query["human"] = human
575+
if pretty is not None:
576+
__query["pretty"] = pretty
577+
if timeout is not None:
578+
__query["timeout"] = timeout
579+
__body = (
580+
chat_completion_request if chat_completion_request is not None else body
581+
)
582+
__headers = {"accept": "application/json", "content-type": "application/json"}
583+
return await self.perform_request( # type: ignore[return-value]
584+
"POST",
585+
__path,
586+
params=__query,
587+
headers=__headers,
588+
body=__body,
589+
endpoint_id="inference.non_streaming_chat_completion",
590+
path_parts=__path_parts,
591+
)
592+
509593
@_rewrite_parameters(
510594
body_name="inference_config",
511595
)
@@ -3186,13 +3270,17 @@ async def rerank(
31863270
example: ``` "input": { "type": "image", "format": "base64", "value": "data:image/jpeg;base64,..."
31873271
} ``` object array example: ``` "input": [ { "type": "text", "format": "text",
31883272
"value": "some document text" }, { "type": "image", "format": "base64", "value":
3189-
"data:image/jpeg;base64,..." } ] ```
3273+
"data:image/jpeg;base64,..." } ] ``` object array example using the `url`
3274+
format (available in Elasticsearch 9.6.0 and later): ``` "input": [ { "type":
3275+
"image", "format": "url", "value": "https://example.com/image.jpg" } ] ```
31903276
:param query: Query input. The query can be specified as a single string, or
31913277
as an object. The object form additionally allows specifying non-text inputs,
31923278
such as images. > info > Only the `elastic` service currently supports non-text
31933279
queries for the `rerank` task. For all other services, the query must be
31943280
a string. string example: ``` "query": "some query text" ``` object example:
31953281
``` "query": { "type": "image", "format": "base64", "value": "data:image/jpeg;base64,..."
3282+
} ``` object example using the `url` format (available in Elasticsearch 9.6.0
3283+
and later): ``` "query": { "type": "image", "format": "url", "value": "https://example.com/image.jpg"
31963284
} ```
31973285
:param return_documents: Include the document text in the response.
31983286
:param task_settings: Task settings for the individual inference request. These

‎elasticsearch/_async/client/ml.py‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3468,6 +3468,7 @@ async def put_data_frame_analytics(
34683468
"indices",
34693469
"indices_options",
34703470
"job_id",
3471+
"max_consecutive_extraction_failures",
34713472
"max_empty_searches",
34723473
"project_routing",
34733474
"query",
@@ -3506,6 +3507,7 @@ async def put_datafeed(
35063507
indices: t.Optional[t.Union[str, t.Sequence[str]]] = None,
35073508
indices_options: t.Optional[t.Mapping[str, t.Any]] = None,
35083509
job_id: t.Optional[str] = None,
3510+
max_consecutive_extraction_failures: t.Optional[int] = None,
35093511
max_empty_searches: t.Optional[int] = None,
35103512
pretty: t.Optional[bool] = None,
35113513
project_routing: t.Optional[str] = None,
@@ -3586,6 +3588,13 @@ async def put_datafeed(
35863588
:param indices_options: Specifies index expansion options that are used during
35873589
search
35883590
:param job_id: Identifier for the anomaly detection job.
3591+
:param max_consecutive_extraction_failures: The maximum number of consecutive
3592+
real-time data extraction failures the datafeed tolerates before it automatically
3593+
stops itself, leaving the associated job open. The consecutive-failure counter
3594+
resets on any cycle that extracts successfully, including empty-data cycles.
3595+
If not set, the threshold defaults to roughly one day's worth of searches
3596+
based on the datafeed `frequency` (floored at 1). Set to `-1` to disable
3597+
auto-stop and retry indefinitely. Values of `0` or less than `-1` are rejected.
35893598
:param max_empty_searches: If a real-time datafeed has never seen any data (including
35903599
during any initial training period), it automatically stops and closes the
35913600
associated job after this many real-time searches return no documents. In
@@ -3656,6 +3665,10 @@ async def put_datafeed(
36563665
__body["indices_options"] = indices_options
36573666
if job_id is not None:
36583667
__body["job_id"] = job_id
3668+
if max_consecutive_extraction_failures is not None:
3669+
__body["max_consecutive_extraction_failures"] = (
3670+
max_consecutive_extraction_failures
3671+
)
36593672
if max_empty_searches is not None:
36603673
__body["max_empty_searches"] = max_empty_searches
36613674
if project_routing is not None:
@@ -5069,6 +5082,7 @@ async def update_data_frame_analytics(
50695082
"indices",
50705083
"indices_options",
50715084
"job_id",
5085+
"max_consecutive_extraction_failures",
50725086
"max_empty_searches",
50735087
"project_routing",
50745088
"query",
@@ -5106,6 +5120,7 @@ async def update_datafeed(
51065120
indices: t.Optional[t.Sequence[str]] = None,
51075121
indices_options: t.Optional[t.Mapping[str, t.Any]] = None,
51085122
job_id: t.Optional[str] = None,
5123+
max_consecutive_extraction_failures: t.Optional[int] = None,
51095124
max_empty_searches: t.Optional[int] = None,
51105125
pretty: t.Optional[bool] = None,
51115126
project_routing: t.Optional[str] = None,
@@ -5183,6 +5198,13 @@ async def update_datafeed(
51835198
:param indices_options: Specifies index expansion options that are used during
51845199
search.
51855200
:param job_id:
5201+
:param max_consecutive_extraction_failures: The maximum number of consecutive
5202+
real-time data extraction failures the datafeed tolerates before it automatically
5203+
stops itself, leaving the associated job open. The consecutive-failure counter
5204+
resets on any cycle that extracts successfully, including empty-data cycles.
5205+
If not set, the threshold defaults to roughly one day's worth of searches
5206+
based on the datafeed `frequency` (floored at 1). Set to `-1` to disable
5207+
auto-stop and retry indefinitely. Values of `0` or less than `-1` are rejected.
51865208
:param max_empty_searches: If a real-time datafeed has never seen any data (including
51875209
during any initial training period), it automatically stops and closes the
51885210
associated job after this many real-time searches return no documents. In
@@ -5257,6 +5279,10 @@ async def update_datafeed(
52575279
__body["indices_options"] = indices_options
52585280
if job_id is not None:
52595281
__body["job_id"] = job_id
5282+
if max_consecutive_extraction_failures is not None:
5283+
__body["max_consecutive_extraction_failures"] = (
5284+
max_consecutive_extraction_failures
5285+
)
52605286
if max_empty_searches is not None:
52615287
__body["max_empty_searches"] = max_empty_searches
52625288
if project_routing is not None:

0 commit comments

Comments
 (0)