elastic / elasticsearch-py

Official Python client for Elasticsearch
https://ela.st/es-python
Apache License 2.0
4.17k stars 1.17k forks source link

Add update_trained_model_deployment to ML client #2562

Closed jeffvestal closed 1 month ago

jeffvestal commented 1 month ago

Describe the feature:

Elasticsearch version (bin/elasticsearch --version): 8.13.2

elasticsearch-py version (elasticsearch.__versionstr__):
8.13.2 & serverless

Description of the problem including expected versus actual behavior:

To update a trained model allocations, the main docs have the example:

resp = client.ml.update_trained_model_deployment(
    model_id="elastic__distilbert-base-uncased-finetuned-conll03-english",
    body={"number_of_allocations": 4},
)
print(resp)

Steps to reproduce: The ml client doesn't to have that actual function.

<ipython-input-24-790add7c67c1> in <cell line: 1>()
----> 1 resp = es.ml.update_trained_model_deployment(
      2     model_id="my-elser-model",
      3     body={
      4         "number_of_allocations": 1
      5         },

AttributeError: 'MlClient' object has no attribute '<ipython-input-24-790add7c67c1> in <cell line: 1>()
----> 1 resp = es.ml.update_trained_model_deployment(
      2     model_id="my-elser-model",
      3     body={
      4         "number_of_allocations": 1
      5         },

AttributeError: 'MlClient' object has no attribute 'update_trained_model_deployment''
pquentin commented 1 month ago

Closed in https://github.com/elastic/elasticsearch-py/pull/2568, thanks.