Skip to content

Commit

Permalink
Release 8.13.2 (#2568)
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin committed May 24, 2024
1 parent e7b4360 commit 890b575
Show file tree
Hide file tree
Showing 28 changed files with 200 additions and 102 deletions.
2 changes: 1 addition & 1 deletion docs/examples/00fea15cbca83be9d5f1a024ff2ec708.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// inference/put-inference.asciidoc:381
// inference/put-inference.asciidoc:452

[source, python]
----
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/10c3fe2265bb34964bd1005f9da66773.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// inference/put-inference.asciidoc:488
// inference/put-inference.asciidoc:559

[source, python]
----
Expand Down
19 changes: 19 additions & 0 deletions docs/examples/1dadb7efe27b6c0c231eb6535e413bd9.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// inference/put-inference.asciidoc:671

[source, python]
----
resp = client.inference.put_model(
task_type="text_embedding",
inference_id="azure_ai_studio_embeddings",
body={
"service": "azureaistudio",
"service_settings": {
"api_key": "<api_key>",
"target": "<target_uri>",
"provider": "<model_provider>",
"endpoint_type": "<endpoint_type>",
},
},
)
print(resp)
----
2 changes: 1 addition & 1 deletion docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// health/health.asciidoc:478
// health/health.asciidoc:481

[source, python]
----
Expand Down
10 changes: 0 additions & 10 deletions docs/examples/36b86b97feedcf5632824eefc251d6ed.asciidoc

This file was deleted.

2 changes: 1 addition & 1 deletion docs/examples/4ca15672fc5ab1d80a127d086b6d2837.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// cluster/allocation-explain.asciidoc:342
// cluster/allocation-explain.asciidoc:344

[source, python]
----
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/5553cf7a02c22f616cd994747f2dd5a5.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// mapping/types/nested.asciidoc:58
// mapping/types/nested.asciidoc:60

[source, python]
----
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/59d736a4d064ed2013c7ead8e32e0998.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// inference/put-inference.asciidoc:529
// inference/put-inference.asciidoc:600

[source, python]
----
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/6cd083045bf06e80b83889a939a18451.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// mapping/types/nested.asciidoc:85
// mapping/types/nested.asciidoc:87

[source, python]
----
Expand Down
19 changes: 19 additions & 0 deletions docs/examples/6ddd4e657efbf45def430a6419825796.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// inference/put-inference.asciidoc:689

[source, python]
----
resp = client.inference.put_model(
task_type="completion",
inference_id="azure_ai_studio_completion",
body={
"service": "azureaistudio",
"service_settings": {
"api_key": "<api_key>",
"target": "<target_uri>",
"provider": "<model_provider>",
"endpoint_type": "<endpoint_type>",
},
},
)
print(resp)
----
2 changes: 1 addition & 1 deletion docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ml/trained-models/apis/update-trained-model-deployment.asciidoc:55
// ml/trained-models/apis/update-trained-model-deployment.asciidoc:53

[source, python]
----
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/77b90f6787195767b6da60d8532714b4.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// inference/put-inference.asciidoc:552
// inference/put-inference.asciidoc:623

[source, python]
----
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/7fef68840761c6982c14ad7af96caf37.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// mapping/types/nested.asciidoc:22
// mapping/types/nested.asciidoc:24

[source, python]
----
Expand Down
15 changes: 0 additions & 15 deletions docs/examples/8575c966b004fb124c7afd6bb5827b50.asciidoc

This file was deleted.

2 changes: 1 addition & 1 deletion docs/examples/8619bd17bbfe33490b1f277007f654db.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// inference/put-inference.asciidoc:353
// inference/put-inference.asciidoc:424

[source, python]
----
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// health/health.asciidoc:471
// health/health.asciidoc:474

[source, python]
----
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/9a203aae3e1412d919546276fb52a5ca.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// inference/put-inference.asciidoc:335
// inference/put-inference.asciidoc:406

[source, python]
----
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// health/health.asciidoc:463
// health/health.asciidoc:466

[source, python]
----
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/9f16fca9813304e398ee052aa857dbcd.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// inference/put-inference.asciidoc:513
// inference/put-inference.asciidoc:584

[source, python]
----
Expand Down
9 changes: 0 additions & 9 deletions docs/examples/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc

This file was deleted.

2 changes: 1 addition & 1 deletion docs/examples/cedb56a71cc743d80263ce352bb21720.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// inference/put-inference.asciidoc:406
// inference/put-inference.asciidoc:477

[source, python]
----
Expand Down
45 changes: 0 additions & 45 deletions docs/examples/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc

This file was deleted.

2 changes: 1 addition & 1 deletion docs/examples/eee6110831c08b9c1b3f56b24656e95b.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// inference/put-inference.asciidoc:445
// inference/put-inference.asciidoc:516

[source, python]
----
Expand Down
19 changes: 19 additions & 0 deletions docs/examples/f57ce7de0946e9416ddb9150e95f4b74.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// inference/put-inference.asciidoc:641

[source, python]
----
resp = client.inference.put_model(
task_type="completion",
inference_id="azure_openai_completion",
body={
"service": "azureopenai",
"service_settings": {
"api_key": "<api_key>",
"resource_name": "<resource_name>",
"deployment_id": "<deployment_id>",
"api_version": "2024-02-01",
},
},
)
print(resp)
----
18 changes: 13 additions & 5 deletions docs/guide/release-notes.asciidoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[[release-notes]]
== Release notes

* <<rn-8-13-2>>
* <<rn-8-13-1>>
* <<rn-8-13-0>>
* <<rn-8-12-1>>
Expand Down Expand Up @@ -37,21 +38,28 @@
* <<rn-8-1-0>>
* <<rn-8-0-0>>

[discrete]
[[rn-8-13-2]]
=== 8.13.2 (2024-05-24)

- Added the `ml.update_trained_model_deployment` API
- Marked Requests 2.32.2 as incompatible with the Elasticsearch client

[discrete]
[[rn-8-13-1]]
=== 8.13.1 (2024-05-03)

- Added ``force_synthetic_source`` to the Get API
- Added ``wait_for_completion`` to the Create trained model API
- Added ``typed_keys`` to the Query API key information API
- Added `force_synthetic_source` to the Get API
- Added `wait_for_completion` to the Create trained model API
- Added `typed_keys` to the Query API key information API

[discrete]
[[rn-8-13-0]]
=== 8.13.0 (2024-03-22)

- Added native OpenTelemetry support
- Added optional ``orjson`` (a fast, correct JSON library) serialization support
- Added the `text_strcuture.test_grok_pattern` API
- Added optional `orjson` (a fast, correct JSON library) serialization support
- Added the `text_structure.test_grok_pattern` API
- Added the `indices.resolve_cluster` API
- Renamed the `model_id` parameter to `inference_id` in the `inference` APIs
- Changed all `synonyms` APIs from **experimental** to **stable**.
Expand Down
56 changes: 56 additions & 0 deletions elasticsearch/_async/client/ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -5043,6 +5043,62 @@ async def update_model_snapshot(
path_parts=__path_parts,
)

@_rewrite_parameters(
body_fields=("number_of_allocations",),
)
async def update_trained_model_deployment(
self,
*,
model_id: str,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
number_of_allocations: t.Optional[int] = None,
pretty: t.Optional[bool] = None,
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Updates certain properties of trained model deployment.
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/update-trained-model-deployment.html>`_
:param model_id: The unique identifier of the trained model. Currently, only
PyTorch models are supported.
:param number_of_allocations: The number of model allocations on each node where
the model is deployed. All allocations on a node share the same copy of the
model in memory but use a separate set of threads to evaluate the model.
Increasing this value generally increases the throughput. If this setting
is greater than the number of hardware threads it will automatically be changed
to a value less than the number of hardware threads.
"""
if model_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'model_id'")
__path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)}
__path = f'/_ml/trained_models/{__path_parts["model_id"]}/deployment/_update'
__query: t.Dict[str, t.Any] = {}
__body: t.Dict[str, t.Any] = body if body is not None else {}
if error_trace is not None:
__query["error_trace"] = error_trace
if filter_path is not None:
__query["filter_path"] = filter_path
if human is not None:
__query["human"] = human
if pretty is not None:
__query["pretty"] = pretty
if not __body:
if number_of_allocations is not None:
__body["number_of_allocations"] = number_of_allocations
__headers = {"accept": "application/json", "content-type": "application/json"}
return await self.perform_request( # type: ignore[return-value]
"POST",
__path,
params=__query,
headers=__headers,
body=__body,
endpoint_id="ml.update_trained_model_deployment",
path_parts=__path_parts,
)

@_rewrite_parameters()
async def upgrade_job_snapshot(
self,
Expand Down

0 comments on commit 890b575

Please sign in to comment.