diff --git a/elasticsearch/_async/client/ml.py b/elasticsearch/_async/client/ml.py index 78820b6d3..3116a71c7 100644 --- a/elasticsearch/_async/client/ml.py +++ b/elasticsearch/_async/client/ml.py @@ -3303,6 +3303,7 @@ async def put_trained_model_vocabulary( human: t.Optional[bool] = None, merges: t.Optional[t.Sequence[str]] = None, pretty: t.Optional[bool] = None, + scores: t.Optional[t.Sequence[float]] = None, ) -> ObjectApiResponse[t.Any]: """ Creates a trained model vocabulary @@ -3312,6 +3313,7 @@ async def put_trained_model_vocabulary( :param model_id: The unique identifier of the trained model. :param vocabulary: The model vocabulary, which must not be empty. :param merges: The optional model merges if required by the tokenizer. + :param scores: The optional vocabulary value scores if required by the tokenizer. """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_id'") @@ -3332,6 +3334,8 @@ async def put_trained_model_vocabulary( __body["merges"] = merges if pretty is not None: __query["pretty"] = pretty + if scores is not None: + __body["scores"] = scores __headers = {"accept": "application/json", "content-type": "application/json"} return await self.perform_request( # type: ignore[return-value] "PUT", __path, params=__query, headers=__headers, body=__body diff --git a/elasticsearch/_async/client/transform.py b/elasticsearch/_async/client/transform.py index 768d670ab..0143883aa 100644 --- a/elasticsearch/_async/client/transform.py +++ b/elasticsearch/_async/client/transform.py @@ -29,6 +29,7 @@ async def delete_transform( self, *, transform_id: str, + delete_dest_index: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, @@ -42,6 +43,9 @@ async def delete_transform( ``_ :param transform_id: Identifier for the transform. + :param delete_dest_index: If this value is true, the destination index is deleted + together with the transform. If false, the destination index will not be + deleted :param force: If this value is false, the transform must be stopped before it can be deleted. If true, the transform is deleted regardless of its current state. @@ -52,6 +56,8 @@ async def delete_transform( raise ValueError("Empty value passed for parameter 'transform_id'") __path = f"/_transform/{_quote(transform_id)}" __query: t.Dict[str, t.Any] = {} + if delete_dest_index is not None: + __query["delete_dest_index"] = delete_dest_index if error_trace is not None: __query["error_trace"] = error_trace if filter_path is not None: diff --git a/elasticsearch/_sync/client/ml.py b/elasticsearch/_sync/client/ml.py index e1b91b8c2..bb72ef725 100644 --- a/elasticsearch/_sync/client/ml.py +++ b/elasticsearch/_sync/client/ml.py @@ -3303,6 +3303,7 @@ def put_trained_model_vocabulary( human: t.Optional[bool] = None, merges: t.Optional[t.Sequence[str]] = None, pretty: t.Optional[bool] = None, + scores: t.Optional[t.Sequence[float]] = None, ) -> ObjectApiResponse[t.Any]: """ Creates a trained model vocabulary @@ -3312,6 +3313,7 @@ def put_trained_model_vocabulary( :param model_id: The unique identifier of the trained model. :param vocabulary: The model vocabulary, which must not be empty. :param merges: The optional model merges if required by the tokenizer. + :param scores: The optional vocabulary value scores if required by the tokenizer. """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_id'") @@ -3332,6 +3334,8 @@ def put_trained_model_vocabulary( __body["merges"] = merges if pretty is not None: __query["pretty"] = pretty + if scores is not None: + __body["scores"] = scores __headers = {"accept": "application/json", "content-type": "application/json"} return self.perform_request( # type: ignore[return-value] "PUT", __path, params=__query, headers=__headers, body=__body diff --git a/elasticsearch/_sync/client/transform.py b/elasticsearch/_sync/client/transform.py index 422654f90..d97e81573 100644 --- a/elasticsearch/_sync/client/transform.py +++ b/elasticsearch/_sync/client/transform.py @@ -29,6 +29,7 @@ def delete_transform( self, *, transform_id: str, + delete_dest_index: t.Optional[bool] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, force: t.Optional[bool] = None, @@ -42,6 +43,9 @@ def delete_transform( ``_ :param transform_id: Identifier for the transform. + :param delete_dest_index: If this value is true, the destination index is deleted + together with the transform. If false, the destination index will not be + deleted :param force: If this value is false, the transform must be stopped before it can be deleted. If true, the transform is deleted regardless of its current state. @@ -52,6 +56,8 @@ def delete_transform( raise ValueError("Empty value passed for parameter 'transform_id'") __path = f"/_transform/{_quote(transform_id)}" __query: t.Dict[str, t.Any] = {} + if delete_dest_index is not None: + __query["delete_dest_index"] = delete_dest_index if error_trace is not None: __query["error_trace"] = error_trace if filter_path is not None: