From 6328418e641f2f080258114caa7dcbdeefb34829 Mon Sep 17 00:00:00 2001 From: Iulia Feroli Date: Mon, 25 Mar 2024 15:19:08 +0100 Subject: [PATCH 1/5] initial generation of examples --- .../095e3f21941a9cc75f398389a075152d.asciidoc | 22 +++++++++++++++++++ .../0e5d25c7bb738c42d471020d678e2966.asciidoc | 10 +++++++++ .../147d341cb212dcc015c129a9c5dcf9c9.asciidoc | 10 +++++++++ .../2d633b7f346b828d01f923ce9dbf6ad5.asciidoc | 10 +++++++++ .../3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc | 2 +- .../35a272df8c919a12d7c3106a18245748.asciidoc | 16 ++++++++++++++ .../3c345feb7c52fd54bcb5d5505fd8bc3b.asciidoc | 15 +++++++++++++ .../3d1ff6097e2359f927c88c2ccdb36252.asciidoc | 7 ------ .../4c174e228b6b74497b73ef2be80de7ad.asciidoc | 7 ++++++ .../5837d5f50665ac0a26181d3aaeb3f204.asciidoc | 10 +++++++++ .../70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc | 10 +++++++++ .../73be1f93d789264e5b972ddb5991bc66.asciidoc | 2 +- .../776b553df0e507c96dbdbaedecaca0cc.asciidoc | 10 +++++++++ .../7e4cb3de3e3c75646b60f9f81ddc59cc.asciidoc | 9 ++++++++ .../821422f8a03dc98d024a15fc737fe9eb.asciidoc | 10 +++++++++ .../87733deeea4b441b595d19a0f97346f0.asciidoc | 2 +- .../8e286a205a1f84f888a6d99f2620c80e.asciidoc | 2 +- .../9225841fdcddaf83ebdb90c2b0399e20.asciidoc | 7 ++++++ .../9cbb097e5498a9fde39e3b1d3b62a4d2.asciidoc | 18 +++++++++++++++ .../9d79645ab3a9da3f63c54a1516214a5a.asciidoc | 2 +- .../aa6282d4bc92c753c4bd7a5b166abece.asciidoc | 11 ++++++++++ .../b7a9f60b3646efe3834ca8381f8aa560.asciidoc | 2 +- .../be6b0bfcdce1ef100af89f74da5d4748.asciidoc | 15 +++++++++++++ .../cc90639f2e65bd89cb73296cac6135cf.asciidoc | 9 ++++++++ .../cee491dd0a8d10ed0cb11a2faa0c99f0.asciidoc | 19 ++++++++++++++++ .../d50b030edfe6d1128eb76aa5ba9d4e27.asciidoc | 11 ++++++++++ .../dbf93d02ab86a09929a21232b19709cc.asciidoc | 9 ++++++++ .../ff776c0fccf93e1c7050f7cb7efbae0b.asciidoc | 12 ++++++++++ utils/generate-examples.py | 15 +++++++++++++ 29 files changed, 271 insertions(+), 13 deletions(-) create mode 100644 docs/examples/095e3f21941a9cc75f398389a075152d.asciidoc create mode 100644 docs/examples/0e5d25c7bb738c42d471020d678e2966.asciidoc create mode 100644 docs/examples/147d341cb212dcc015c129a9c5dcf9c9.asciidoc create mode 100644 docs/examples/2d633b7f346b828d01f923ce9dbf6ad5.asciidoc create mode 100644 docs/examples/35a272df8c919a12d7c3106a18245748.asciidoc create mode 100644 docs/examples/3c345feb7c52fd54bcb5d5505fd8bc3b.asciidoc delete mode 100644 docs/examples/3d1ff6097e2359f927c88c2ccdb36252.asciidoc create mode 100644 docs/examples/4c174e228b6b74497b73ef2be80de7ad.asciidoc create mode 100644 docs/examples/5837d5f50665ac0a26181d3aaeb3f204.asciidoc create mode 100644 docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc create mode 100644 docs/examples/776b553df0e507c96dbdbaedecaca0cc.asciidoc create mode 100644 docs/examples/7e4cb3de3e3c75646b60f9f81ddc59cc.asciidoc create mode 100644 docs/examples/821422f8a03dc98d024a15fc737fe9eb.asciidoc create mode 100644 docs/examples/9225841fdcddaf83ebdb90c2b0399e20.asciidoc create mode 100644 docs/examples/9cbb097e5498a9fde39e3b1d3b62a4d2.asciidoc create mode 100644 docs/examples/aa6282d4bc92c753c4bd7a5b166abece.asciidoc create mode 100644 docs/examples/be6b0bfcdce1ef100af89f74da5d4748.asciidoc create mode 100644 docs/examples/cc90639f2e65bd89cb73296cac6135cf.asciidoc create mode 100644 docs/examples/cee491dd0a8d10ed0cb11a2faa0c99f0.asciidoc create mode 100644 docs/examples/d50b030edfe6d1128eb76aa5ba9d4e27.asciidoc create mode 100644 docs/examples/dbf93d02ab86a09929a21232b19709cc.asciidoc create mode 100644 docs/examples/ff776c0fccf93e1c7050f7cb7efbae0b.asciidoc diff --git a/docs/examples/095e3f21941a9cc75f398389a075152d.asciidoc b/docs/examples/095e3f21941a9cc75f398389a075152d.asciidoc new file mode 100644 index 000000000..223e062c7 --- /dev/null +++ b/docs/examples/095e3f21941a9cc75f398389a075152d.asciidoc @@ -0,0 +1,22 @@ +// ml/trained-models/apis/infer-trained-model.asciidoc:1043 + +[source, python] +---- +resp = client.ml.infer_trained_model( + model_id="cross-encoder__ms-marco-tinybert-l-2-v2", + body={ + "docs": [ + { + "text_field": "Berlin has a population of 3,520,031 registered inhabitants in an area of 891.82 square kilometers." + }, + { + "text_field": "New York City is famous for the Metropolitan Museum of Art." + }, + ], + "inference_config": { + "text_similarity": {"text": "How many people live in Berlin?"} + }, + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/0e5d25c7bb738c42d471020d678e2966.asciidoc b/docs/examples/0e5d25c7bb738c42d471020d678e2966.asciidoc new file mode 100644 index 000000000..aff06a881 --- /dev/null +++ b/docs/examples/0e5d25c7bb738c42d471020d678e2966.asciidoc @@ -0,0 +1,10 @@ +// ml/trained-models/apis/start-trained-model-deployment.asciidoc:173 + +[source, python] +---- +resp = client.ml.start_trained_model_deployment( + model_id="my_model", + deployment_id="my_model_for_ingest", +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/147d341cb212dcc015c129a9c5dcf9c9.asciidoc b/docs/examples/147d341cb212dcc015c129a9c5dcf9c9.asciidoc new file mode 100644 index 000000000..18e2e1d8a --- /dev/null +++ b/docs/examples/147d341cb212dcc015c129a9c5dcf9c9.asciidoc @@ -0,0 +1,10 @@ +// ml/trained-models/apis/put-trained-models-aliases.asciidoc:82 + +[source, python] +---- +resp = client.ml.put_trained_model_alias( + model_id="flight-delay-prediction-1574775339910", + model_alias="flight_delay_model", +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/2d633b7f346b828d01f923ce9dbf6ad5.asciidoc b/docs/examples/2d633b7f346b828d01f923ce9dbf6ad5.asciidoc new file mode 100644 index 000000000..b2e874fd0 --- /dev/null +++ b/docs/examples/2d633b7f346b828d01f923ce9dbf6ad5.asciidoc @@ -0,0 +1,10 @@ +// ml/trained-models/apis/put-trained-model-vocabulary.asciidoc:63 + +[source, python] +---- +resp = client.ml.put_trained_model_vocabulary( + model_id="elastic__distilbert-base-uncased-finetuned-conll03-english", + body={"vocabulary": ["[PAD]", "[unused0]", ...]}, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc b/docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc index e189b1def..2c5244e74 100644 --- a/docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc +++ b/docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc @@ -1,4 +1,4 @@ -// health/health.asciidoc:470 +// health/health.asciidoc:478 [source, python] ---- diff --git a/docs/examples/35a272df8c919a12d7c3106a18245748.asciidoc b/docs/examples/35a272df8c919a12d7c3106a18245748.asciidoc new file mode 100644 index 000000000..9351c75e5 --- /dev/null +++ b/docs/examples/35a272df8c919a12d7c3106a18245748.asciidoc @@ -0,0 +1,16 @@ +// ml/trained-models/apis/infer-trained-model.asciidoc:849 + +[source, python] +---- +resp = client.ml.infer_trained_model( + model_id="lang_ident_model_1", + body={ + "docs": [ + { + "text": "The fool doth think he is wise, but the wise man knows himself to be a fool." + } + ] + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/3c345feb7c52fd54bcb5d5505fd8bc3b.asciidoc b/docs/examples/3c345feb7c52fd54bcb5d5505fd8bc3b.asciidoc new file mode 100644 index 000000000..6e2840b65 --- /dev/null +++ b/docs/examples/3c345feb7c52fd54bcb5d5505fd8bc3b.asciidoc @@ -0,0 +1,15 @@ +// ml/trained-models/apis/infer-trained-model.asciidoc:1008 + +[source, python] +---- +resp = client.ml.infer_trained_model( + model_id="model2", + body={ + "docs": [{"text_field": ""}], + "inference_config": { + "question_answering": {"question": ""} + }, + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/3d1ff6097e2359f927c88c2ccdb36252.asciidoc b/docs/examples/3d1ff6097e2359f927c88c2ccdb36252.asciidoc deleted file mode 100644 index 93e97eaeb..000000000 --- a/docs/examples/3d1ff6097e2359f927c88c2ccdb36252.asciidoc +++ /dev/null @@ -1,7 +0,0 @@ -// tab-widgets/api-call.asciidoc:13 - -[source, python] ----- -resp = es.info() -print(resp) ----- diff --git a/docs/examples/4c174e228b6b74497b73ef2be80de7ad.asciidoc b/docs/examples/4c174e228b6b74497b73ef2be80de7ad.asciidoc new file mode 100644 index 000000000..64d7ae76e --- /dev/null +++ b/docs/examples/4c174e228b6b74497b73ef2be80de7ad.asciidoc @@ -0,0 +1,7 @@ +// ml/trained-models/apis/get-trained-models.asciidoc:1460 + +[source, python] +---- +resp = client.ml.get_trained_models() +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/5837d5f50665ac0a26181d3aaeb3f204.asciidoc b/docs/examples/5837d5f50665ac0a26181d3aaeb3f204.asciidoc new file mode 100644 index 000000000..55b2e0e72 --- /dev/null +++ b/docs/examples/5837d5f50665ac0a26181d3aaeb3f204.asciidoc @@ -0,0 +1,10 @@ +// ml/trained-models/apis/start-trained-model-deployment.asciidoc:181 + +[source, python] +---- +resp = client.ml.start_trained_model_deployment( + model_id="my_model", + deployment_id="my_model_for_search", +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc b/docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc new file mode 100644 index 000000000..59c20f5d1 --- /dev/null +++ b/docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc @@ -0,0 +1,10 @@ +// ml/trained-models/apis/update-trained-model-deployment.asciidoc:55 + +[source, python] +---- +resp = client.ml.update_trained_model_deployment( + model_id="elastic__distilbert-base-uncased-finetuned-conll03-english", + body={"number_of_allocations": 4}, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/73be1f93d789264e5b972ddb5991bc66.asciidoc b/docs/examples/73be1f93d789264e5b972ddb5991bc66.asciidoc index d405994df..23c119b2a 100644 --- a/docs/examples/73be1f93d789264e5b972ddb5991bc66.asciidoc +++ b/docs/examples/73be1f93d789264e5b972ddb5991bc66.asciidoc @@ -1,4 +1,4 @@ -// setup/logging-config.asciidoc:156 +// setup/logging-config.asciidoc:158 [source, python] ---- diff --git a/docs/examples/776b553df0e507c96dbdbaedecaca0cc.asciidoc b/docs/examples/776b553df0e507c96dbdbaedecaca0cc.asciidoc new file mode 100644 index 000000000..2246fd547 --- /dev/null +++ b/docs/examples/776b553df0e507c96dbdbaedecaca0cc.asciidoc @@ -0,0 +1,10 @@ +// ml/trained-models/apis/infer-trained-model.asciidoc:880 + +[source, python] +---- +resp = client.ml.infer_trained_model( + model_id="model2", + body={"docs": [{"text_field": "The movie was awesome!!"}]}, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/7e4cb3de3e3c75646b60f9f81ddc59cc.asciidoc b/docs/examples/7e4cb3de3e3c75646b60f9f81ddc59cc.asciidoc new file mode 100644 index 000000000..c150b3e98 --- /dev/null +++ b/docs/examples/7e4cb3de3e3c75646b60f9f81ddc59cc.asciidoc @@ -0,0 +1,9 @@ +// ml/trained-models/apis/clear-trained-model-deployment-cache.asciidoc:43 + +[source, python] +---- +resp = client.ml.clear_trained_model_deployment_cache( + model_id="elastic__distilbert-base-uncased-finetuned-conll03-english", +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/821422f8a03dc98d024a15fc737fe9eb.asciidoc b/docs/examples/821422f8a03dc98d024a15fc737fe9eb.asciidoc new file mode 100644 index 000000000..7ebb1d83a --- /dev/null +++ b/docs/examples/821422f8a03dc98d024a15fc737fe9eb.asciidoc @@ -0,0 +1,10 @@ +// ml/trained-models/apis/delete-trained-models-aliases.asciidoc:51 + +[source, python] +---- +resp = client.ml.delete_trained_model_alias( + model_id="flight-delay-prediction-1574775339910", + model_alias="flight_delay_model", +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc b/docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc index 7dce86873..63e252c69 100644 --- a/docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc +++ b/docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc @@ -1,4 +1,4 @@ -// health/health.asciidoc:463 +// health/health.asciidoc:471 [source, python] ---- diff --git a/docs/examples/8e286a205a1f84f888a6d99f2620c80e.asciidoc b/docs/examples/8e286a205a1f84f888a6d99f2620c80e.asciidoc index a3b8bd6e5..0d10bc179 100644 --- a/docs/examples/8e286a205a1f84f888a6d99f2620c80e.asciidoc +++ b/docs/examples/8e286a205a1f84f888a6d99f2620c80e.asciidoc @@ -1,4 +1,4 @@ -// setup/logging-config.asciidoc:233 +// setup/logging-config.asciidoc:235 [source, python] ---- diff --git a/docs/examples/9225841fdcddaf83ebdb90c2b0399e20.asciidoc b/docs/examples/9225841fdcddaf83ebdb90c2b0399e20.asciidoc new file mode 100644 index 000000000..13ca7d4e0 --- /dev/null +++ b/docs/examples/9225841fdcddaf83ebdb90c2b0399e20.asciidoc @@ -0,0 +1,7 @@ +// ml/trained-models/apis/get-trained-models-stats.asciidoc:405 + +[source, python] +---- +resp = client.ml.get_trained_models_stats() +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/9cbb097e5498a9fde39e3b1d3b62a4d2.asciidoc b/docs/examples/9cbb097e5498a9fde39e3b1d3b62a4d2.asciidoc new file mode 100644 index 000000000..f8fde02c8 --- /dev/null +++ b/docs/examples/9cbb097e5498a9fde39e3b1d3b62a4d2.asciidoc @@ -0,0 +1,18 @@ +// ml/trained-models/apis/infer-trained-model.asciidoc:945 + +[source, python] +---- +resp = client.ml.infer_trained_model( + model_id="model2", + body={ + "docs": [{"text_field": "This is a very happy person"}], + "inference_config": { + "zero_shot_classification": { + "labels": ["glad", "sad", "bad", "rad"], + "multi_label": False, + } + }, + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc b/docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc index 974117af4..68c134d0a 100644 --- a/docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc +++ b/docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc @@ -1,4 +1,4 @@ -// health/health.asciidoc:455 +// health/health.asciidoc:463 [source, python] ---- diff --git a/docs/examples/aa6282d4bc92c753c4bd7a5b166abece.asciidoc b/docs/examples/aa6282d4bc92c753c4bd7a5b166abece.asciidoc new file mode 100644 index 000000000..cf00e978a --- /dev/null +++ b/docs/examples/aa6282d4bc92c753c4bd7a5b166abece.asciidoc @@ -0,0 +1,11 @@ +// ml/trained-models/apis/start-trained-model-deployment.asciidoc:133 + +[source, python] +---- +resp = client.ml.start_trained_model_deployment( + model_id="elastic__distilbert-base-uncased-finetuned-conll03-english", + wait_for="started", + timeout="1m", +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/b7a9f60b3646efe3834ca8381f8aa560.asciidoc b/docs/examples/b7a9f60b3646efe3834ca8381f8aa560.asciidoc index ca29f3a8f..7077a812f 100644 --- a/docs/examples/b7a9f60b3646efe3834ca8381f8aa560.asciidoc +++ b/docs/examples/b7a9f60b3646efe3834ca8381f8aa560.asciidoc @@ -1,4 +1,4 @@ -// setup/logging-config.asciidoc:169 +// setup/logging-config.asciidoc:171 [source, python] ---- diff --git a/docs/examples/be6b0bfcdce1ef100af89f74da5d4748.asciidoc b/docs/examples/be6b0bfcdce1ef100af89f74da5d4748.asciidoc new file mode 100644 index 000000000..c917e5a53 --- /dev/null +++ b/docs/examples/be6b0bfcdce1ef100af89f74da5d4748.asciidoc @@ -0,0 +1,15 @@ +// ml/trained-models/apis/put-trained-model-definition-part.asciidoc:64 + +[source, python] +---- +resp = client.ml.put_trained_model_definition_part( + model_id="elastic__distilbert-base-uncased-finetuned-conll03-english", + part="0", + body={ + "definition": "...", + "total_definition_length": 265632637, + "total_parts": 64, + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/cc90639f2e65bd89cb73296cac6135cf.asciidoc b/docs/examples/cc90639f2e65bd89cb73296cac6135cf.asciidoc new file mode 100644 index 000000000..f8c8da8cd --- /dev/null +++ b/docs/examples/cc90639f2e65bd89cb73296cac6135cf.asciidoc @@ -0,0 +1,9 @@ +// ml/trained-models/apis/delete-trained-models.asciidoc:54 + +[source, python] +---- +resp = client.ml.delete_trained_model( + model_id="regression-job-one-1574775307356", +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/cee491dd0a8d10ed0cb11a2faa0c99f0.asciidoc b/docs/examples/cee491dd0a8d10ed0cb11a2faa0c99f0.asciidoc new file mode 100644 index 000000000..785bf070d --- /dev/null +++ b/docs/examples/cee491dd0a8d10ed0cb11a2faa0c99f0.asciidoc @@ -0,0 +1,19 @@ +// ml/trained-models/apis/infer-trained-model.asciidoc:1078 + +[source, python] +---- +resp = client.ml.infer_trained_model( + model_id="model2", + body={ + "docs": [ + { + "text_field": "The Amazon rainforest covers most of the Amazon basin in South America" + } + ], + "inference_config": { + "ner": {"tokenization": {"bert": {"truncate": "first"}}} + }, + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/d50b030edfe6d1128eb76aa5ba9d4e27.asciidoc b/docs/examples/d50b030edfe6d1128eb76aa5ba9d4e27.asciidoc new file mode 100644 index 000000000..d16117294 --- /dev/null +++ b/docs/examples/d50b030edfe6d1128eb76aa5ba9d4e27.asciidoc @@ -0,0 +1,11 @@ +// ml/trained-models/apis/put-trained-models-aliases.asciidoc:94 + +[source, python] +---- +resp = client.ml.put_trained_model_alias( + model_id="flight-delay-prediction-1580004349800", + model_alias="flight_delay_model", + reassign="true", +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/dbf93d02ab86a09929a21232b19709cc.asciidoc b/docs/examples/dbf93d02ab86a09929a21232b19709cc.asciidoc new file mode 100644 index 000000000..165dcd621 --- /dev/null +++ b/docs/examples/dbf93d02ab86a09929a21232b19709cc.asciidoc @@ -0,0 +1,9 @@ +// ml/trained-models/apis/stop-trained-model-deployment.asciidoc:67 + +[source, python] +---- +resp = client.ml.stop_trained_model_deployment( + model_id="my_model_for_search", +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/ff776c0fccf93e1c7050f7cb7efbae0b.asciidoc b/docs/examples/ff776c0fccf93e1c7050f7cb7efbae0b.asciidoc new file mode 100644 index 000000000..864363aea --- /dev/null +++ b/docs/examples/ff776c0fccf93e1c7050f7cb7efbae0b.asciidoc @@ -0,0 +1,12 @@ +// ml/trained-models/apis/infer-trained-model.asciidoc:905 + +[source, python] +---- +resp = client.ml.infer_trained_model( + model_id="model2", + body={ + "docs": [{"text_field": "Hi my name is Josh and I live in Berlin"}] + }, +) +print(resp) +---- \ No newline at end of file diff --git a/utils/generate-examples.py b/utils/generate-examples.py index fedfd1c4d..09a5fa052 100644 --- a/utils/generate-examples.py +++ b/utils/generate-examples.py @@ -106,6 +106,21 @@ "cluster/update-settings.asciidoc", "health/health.asciidoc", "cluster/reroute.asciidoc", + "ml/trained-models/apis/clear-trained-model-deployment-cache.asciidoc", + "ml/trained-models/apis/delete-trained-models-aliases.asciidoc", + "ml/trained-models/apis/delete-trained-models.asciidoc", + "ml/trained-models/apis/get-trained-models-stats.asciidoc", + "ml/trained-models/apis/get-trained-models.asciidoc", + "ml/trained-models/apis/infer-trained-model-deployment.asciidoc", + "ml/trained-models/apis/infer-trained-model.asciidoc", + "ml/trained-models/apis/put-trained-model-definition-part.asciidoc", + "ml/trained-models/apis/put-trained-model-vocabulary.asciidoc", + "ml/trained-models/apis/put-trained-models-aliases.asciidoc", + "ml/trained-models/apis/put-trained-models.asciidoc", + "ml/trained-models/apis/start-trained-model-deployment.asciidoc", + "ml/trained-models/apis/stop-trained-model-deployment.asciidoc", + "ml/trained-models/apis/update-trained-model-deployment.asciidoc", + ] From 7dc87c9befaaf1cf34405990688ea42baa213ecc Mon Sep 17 00:00:00 2001 From: Iulia Feroli Date: Mon, 25 Mar 2024 16:54:13 +0100 Subject: [PATCH 2/5] added some parameters, same as in the Curl example Without the timout increase, the default 10s is usually not enough for this not timeout with an error --- docs/examples/0e5d25c7bb738c42d471020d678e2966.asciidoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/examples/0e5d25c7bb738c42d471020d678e2966.asciidoc b/docs/examples/0e5d25c7bb738c42d471020d678e2966.asciidoc index aff06a881..d4550057e 100644 --- a/docs/examples/0e5d25c7bb738c42d471020d678e2966.asciidoc +++ b/docs/examples/0e5d25c7bb738c42d471020d678e2966.asciidoc @@ -5,6 +5,8 @@ resp = client.ml.start_trained_model_deployment( model_id="my_model", deployment_id="my_model_for_ingest", + wait_for="started", + timeout="1m", ) print(resp) ---- \ No newline at end of file From 7ab3761126395135befa3f7bd45ce30127b1afd8 Mon Sep 17 00:00:00 2001 From: Iulia Feroli Date: Mon, 25 Mar 2024 16:56:05 +0100 Subject: [PATCH 3/5] this function didn't work in the test - waiting for feedback if we remove the example or update the spec --- docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc b/docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc index 59c20f5d1..ba870a270 100644 --- a/docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc +++ b/docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc @@ -2,6 +2,7 @@ [source, python] ---- +# @iulia This functionis currently missing in the spec so it doesn't run resp = client.ml.update_trained_model_deployment( model_id="elastic__distilbert-base-uncased-finetuned-conll03-english", body={"number_of_allocations": 4}, From 3f56ee5dbcc3dba5abef562f948baf04981fe63a Mon Sep 17 00:00:00 2001 From: Iulia Feroli Date: Mon, 25 Mar 2024 17:07:16 +0100 Subject: [PATCH 4/5] removed update_trained_model_deployment function that isn't implemented --- .../70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc diff --git a/docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc b/docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc deleted file mode 100644 index ba870a270..000000000 --- a/docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc +++ /dev/null @@ -1,11 +0,0 @@ -// ml/trained-models/apis/update-trained-model-deployment.asciidoc:55 - -[source, python] ----- -# @iulia This functionis currently missing in the spec so it doesn't run -resp = client.ml.update_trained_model_deployment( - model_id="elastic__distilbert-base-uncased-finetuned-conll03-english", - body={"number_of_allocations": 4}, -) -print(resp) ----- \ No newline at end of file From a83ecb7ea3cc27d1d89106d433af536763ab1c21 Mon Sep 17 00:00:00 2001 From: Iulia Feroli Date: Tue, 26 Mar 2024 16:11:10 +0100 Subject: [PATCH 5/5] fixed linting --- utils/generate-examples.py | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/generate-examples.py b/utils/generate-examples.py index 09a5fa052..6024948eb 100644 --- a/utils/generate-examples.py +++ b/utils/generate-examples.py @@ -120,7 +120,6 @@ "ml/trained-models/apis/start-trained-model-deployment.asciidoc", "ml/trained-models/apis/stop-trained-model-deployment.asciidoc", "ml/trained-models/apis/update-trained-model-deployment.asciidoc", - ]