Skip to content

Commit 890b575

Browse files
authored
Release 8.13.2 (#2568)
1 parent e7b4360 commit 890b575

28 files changed

+200
-102
lines changed

docs/examples/00fea15cbca83be9d5f1a024ff2ec708.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// inference/put-inference.asciidoc:381
1+
// inference/put-inference.asciidoc:452
22

33
[source, python]
44
----

docs/examples/10c3fe2265bb34964bd1005f9da66773.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// inference/put-inference.asciidoc:488
1+
// inference/put-inference.asciidoc:559
22

33
[source, python]
44
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// inference/put-inference.asciidoc:671
2+
3+
[source, python]
4+
----
5+
resp = client.inference.put_model(
6+
task_type="text_embedding",
7+
inference_id="azure_ai_studio_embeddings",
8+
body={
9+
"service": "azureaistudio",
10+
"service_settings": {
11+
"api_key": "<api_key>",
12+
"target": "<target_uri>",
13+
"provider": "<model_provider>",
14+
"endpoint_type": "<endpoint_type>",
15+
},
16+
},
17+
)
18+
print(resp)
19+
----

docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// health/health.asciidoc:478
1+
// health/health.asciidoc:481
22

33
[source, python]
44
----

docs/examples/36b86b97feedcf5632824eefc251d6ed.asciidoc

-10
This file was deleted.

docs/examples/4ca15672fc5ab1d80a127d086b6d2837.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// cluster/allocation-explain.asciidoc:342
1+
// cluster/allocation-explain.asciidoc:344
22

33
[source, python]
44
----

docs/examples/5553cf7a02c22f616cd994747f2dd5a5.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// mapping/types/nested.asciidoc:58
1+
// mapping/types/nested.asciidoc:60
22

33
[source, python]
44
----

docs/examples/59d736a4d064ed2013c7ead8e32e0998.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// inference/put-inference.asciidoc:529
1+
// inference/put-inference.asciidoc:600
22

33
[source, python]
44
----

docs/examples/6cd083045bf06e80b83889a939a18451.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// mapping/types/nested.asciidoc:85
1+
// mapping/types/nested.asciidoc:87
22

33
[source, python]
44
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// inference/put-inference.asciidoc:689
2+
3+
[source, python]
4+
----
5+
resp = client.inference.put_model(
6+
task_type="completion",
7+
inference_id="azure_ai_studio_completion",
8+
body={
9+
"service": "azureaistudio",
10+
"service_settings": {
11+
"api_key": "<api_key>",
12+
"target": "<target_uri>",
13+
"provider": "<model_provider>",
14+
"endpoint_type": "<endpoint_type>",
15+
},
16+
},
17+
)
18+
print(resp)
19+
----

docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// ml/trained-models/apis/update-trained-model-deployment.asciidoc:55
1+
// ml/trained-models/apis/update-trained-model-deployment.asciidoc:53
22

33
[source, python]
44
----

docs/examples/77b90f6787195767b6da60d8532714b4.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// inference/put-inference.asciidoc:552
1+
// inference/put-inference.asciidoc:623
22

33
[source, python]
44
----

docs/examples/7fef68840761c6982c14ad7af96caf37.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// mapping/types/nested.asciidoc:22
1+
// mapping/types/nested.asciidoc:24
22

33
[source, python]
44
----

docs/examples/8575c966b004fb124c7afd6bb5827b50.asciidoc

-15
This file was deleted.

docs/examples/8619bd17bbfe33490b1f277007f654db.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// inference/put-inference.asciidoc:353
1+
// inference/put-inference.asciidoc:424
22

33
[source, python]
44
----

docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// health/health.asciidoc:471
1+
// health/health.asciidoc:474
22

33
[source, python]
44
----

docs/examples/9a203aae3e1412d919546276fb52a5ca.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// inference/put-inference.asciidoc:335
1+
// inference/put-inference.asciidoc:406
22

33
[source, python]
44
----

docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// health/health.asciidoc:463
1+
// health/health.asciidoc:466
22

33
[source, python]
44
----

docs/examples/9f16fca9813304e398ee052aa857dbcd.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// inference/put-inference.asciidoc:513
1+
// inference/put-inference.asciidoc:584
22

33
[source, python]
44
----

docs/examples/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc

-9
This file was deleted.

docs/examples/cedb56a71cc743d80263ce352bb21720.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// inference/put-inference.asciidoc:406
1+
// inference/put-inference.asciidoc:477
22

33
[source, python]
44
----

docs/examples/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc

-45
This file was deleted.

docs/examples/eee6110831c08b9c1b3f56b24656e95b.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// inference/put-inference.asciidoc:445
1+
// inference/put-inference.asciidoc:516
22

33
[source, python]
44
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// inference/put-inference.asciidoc:641
2+
3+
[source, python]
4+
----
5+
resp = client.inference.put_model(
6+
task_type="completion",
7+
inference_id="azure_openai_completion",
8+
body={
9+
"service": "azureopenai",
10+
"service_settings": {
11+
"api_key": "<api_key>",
12+
"resource_name": "<resource_name>",
13+
"deployment_id": "<deployment_id>",
14+
"api_version": "2024-02-01",
15+
},
16+
},
17+
)
18+
print(resp)
19+
----

docs/guide/release-notes.asciidoc

+13-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[[release-notes]]
22
== Release notes
33

4+
* <<rn-8-13-2>>
45
* <<rn-8-13-1>>
56
* <<rn-8-13-0>>
67
* <<rn-8-12-1>>
@@ -37,21 +38,28 @@
3738
* <<rn-8-1-0>>
3839
* <<rn-8-0-0>>
3940

41+
[discrete]
42+
[[rn-8-13-2]]
43+
=== 8.13.2 (2024-05-24)
44+
45+
- Added the `ml.update_trained_model_deployment` API
46+
- Marked Requests 2.32.2 as incompatible with the Elasticsearch client
47+
4048
[discrete]
4149
[[rn-8-13-1]]
4250
=== 8.13.1 (2024-05-03)
4351

44-
- Added ``force_synthetic_source`` to the Get API
45-
- Added ``wait_for_completion`` to the Create trained model API
46-
- Added ``typed_keys`` to the Query API key information API
52+
- Added `force_synthetic_source` to the Get API
53+
- Added `wait_for_completion` to the Create trained model API
54+
- Added `typed_keys` to the Query API key information API
4755

4856
[discrete]
4957
[[rn-8-13-0]]
5058
=== 8.13.0 (2024-03-22)
5159

5260
- Added native OpenTelemetry support
53-
- Added optional ``orjson`` (a fast, correct JSON library) serialization support
54-
- Added the `text_strcuture.test_grok_pattern` API
61+
- Added optional `orjson` (a fast, correct JSON library) serialization support
62+
- Added the `text_structure.test_grok_pattern` API
5563
- Added the `indices.resolve_cluster` API
5664
- Renamed the `model_id` parameter to `inference_id` in the `inference` APIs
5765
- Changed all `synonyms` APIs from **experimental** to **stable**.

elasticsearch/_async/client/ml.py

+56
Original file line numberDiff line numberDiff line change
@@ -5043,6 +5043,62 @@ async def update_model_snapshot(
50435043
path_parts=__path_parts,
50445044
)
50455045

5046+
@_rewrite_parameters(
5047+
body_fields=("number_of_allocations",),
5048+
)
5049+
async def update_trained_model_deployment(
5050+
self,
5051+
*,
5052+
model_id: str,
5053+
error_trace: t.Optional[bool] = None,
5054+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
5055+
human: t.Optional[bool] = None,
5056+
number_of_allocations: t.Optional[int] = None,
5057+
pretty: t.Optional[bool] = None,
5058+
body: t.Optional[t.Dict[str, t.Any]] = None,
5059+
) -> ObjectApiResponse[t.Any]:
5060+
"""
5061+
Updates certain properties of trained model deployment.
5062+
5063+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/update-trained-model-deployment.html>`_
5064+
5065+
:param model_id: The unique identifier of the trained model. Currently, only
5066+
PyTorch models are supported.
5067+
:param number_of_allocations: The number of model allocations on each node where
5068+
the model is deployed. All allocations on a node share the same copy of the
5069+
model in memory but use a separate set of threads to evaluate the model.
5070+
Increasing this value generally increases the throughput. If this setting
5071+
is greater than the number of hardware threads it will automatically be changed
5072+
to a value less than the number of hardware threads.
5073+
"""
5074+
if model_id in SKIP_IN_PATH:
5075+
raise ValueError("Empty value passed for parameter 'model_id'")
5076+
__path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)}
5077+
__path = f'/_ml/trained_models/{__path_parts["model_id"]}/deployment/_update'
5078+
__query: t.Dict[str, t.Any] = {}
5079+
__body: t.Dict[str, t.Any] = body if body is not None else {}
5080+
if error_trace is not None:
5081+
__query["error_trace"] = error_trace
5082+
if filter_path is not None:
5083+
__query["filter_path"] = filter_path
5084+
if human is not None:
5085+
__query["human"] = human
5086+
if pretty is not None:
5087+
__query["pretty"] = pretty
5088+
if not __body:
5089+
if number_of_allocations is not None:
5090+
__body["number_of_allocations"] = number_of_allocations
5091+
__headers = {"accept": "application/json", "content-type": "application/json"}
5092+
return await self.perform_request( # type: ignore[return-value]
5093+
"POST",
5094+
__path,
5095+
params=__query,
5096+
headers=__headers,
5097+
body=__body,
5098+
endpoint_id="ml.update_trained_model_deployment",
5099+
path_parts=__path_parts,
5100+
)
5101+
50465102
@_rewrite_parameters()
50475103
async def upgrade_job_snapshot(
50485104
self,

0 commit comments

Comments
 (0)