From d35604ba1b74b972a32146d2e4eeccb8ea05b71b Mon Sep 17 00:00:00 2001 From: Nathalie Jonathan Date: Fri, 3 Jan 2025 13:37:07 -0800 Subject: [PATCH] Added version for train, predict, train and predict ML APIs. Signed-off-by: Nathalie Jonathan --- CHANGELOG.md | 1 + spec/namespaces/ml.yaml | 3 +++ tests/plugins/ml/ml/predict.yaml | 1 + tests/plugins/ml/ml/train.yaml | 1 + tests/plugins/ml/ml/train_predict.yaml | 1 + 5 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3460c6d74..6353c258a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added `GET`, `POST /_plugins/_ml/tasks/_search`, `GET /_plugins/_ml/tools`, `tools/{tool_name}` ([#797](https://github.com/opensearch-project/opensearch-api-specification/pull/797)) - Added `POST /_plugins/_ml/agents/{agent_id}/_execute`, `GET /_plugins/_ml/agents/{agent_id}`, `GET`, `POST /_plugins/_ml/agents/_search` ([#798](https://github.com/opensearch-project/opensearch-api-specification/pull/798)) - Added a warning for test file names that don't match the API being tested ([#793](https://github.com/opensearch-project/opensearch-api-specification/pull/793)) +- Added version for `POST /_plugins/_ml/_train/{algorithm_name}`, `_predict/{algorithm_name}/{model_id}`, and `_train_predict/{algorithm_name}` ([#763](https://github.com/opensearch-project/opensearch-api-specification/pull/763)) ### Removed - Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652)) diff --git a/spec/namespaces/ml.yaml b/spec/namespaces/ml.yaml index 5307dec64..d0062aed7 100644 --- a/spec/namespaces/ml.yaml +++ b/spec/namespaces/ml.yaml @@ -333,6 +333,7 @@ paths: post: operationId: ml.predict.0 x-operation-group: ml.predict + x-version-added: '1.3' description: Predicts new data with trained model. parameters: - $ref: '#/components/parameters/ml.predict::path.algorithm_name' @@ -346,6 +347,7 @@ paths: post: operationId: ml.train.0 x-operation-group: ml.train + x-version-added: '1.3' description: Trains a model synchronously. parameters: - $ref: '#/components/parameters/ml.train::path.algorithm_name' @@ -358,6 +360,7 @@ paths: post: operationId: ml.train_predict.0 x-operation-group: ml.train_predict + x-version-added: '1.3' description: Trains a model and predicts against the same training dataset. parameters: - $ref: '#/components/parameters/ml.train_predict::path.algorithm_name' diff --git a/tests/plugins/ml/ml/predict.yaml b/tests/plugins/ml/ml/predict.yaml index cf2072f0b..1e23620a4 100644 --- a/tests/plugins/ml/ml/predict.yaml +++ b/tests/plugins/ml/ml/predict.yaml @@ -1,6 +1,7 @@ $schema: ../../../../json_schemas/test_story.schema.yaml description: Test the prediction of new data with trained model. +version: '>= 1.3' prologues: - path: /_bulk method: POST diff --git a/tests/plugins/ml/ml/train.yaml b/tests/plugins/ml/ml/train.yaml index 25a0ed723..042f750cf 100644 --- a/tests/plugins/ml/ml/train.yaml +++ b/tests/plugins/ml/ml/train.yaml @@ -1,6 +1,7 @@ $schema: ../../../../json_schemas/test_story.schema.yaml description: Test the training of a model synchronously. +version: '>= 1.3' prologues: - path: /_bulk method: POST diff --git a/tests/plugins/ml/ml/train_predict.yaml b/tests/plugins/ml/ml/train_predict.yaml index 5da035c74..3a53c93e1 100644 --- a/tests/plugins/ml/ml/train_predict.yaml +++ b/tests/plugins/ml/ml/train_predict.yaml @@ -1,6 +1,7 @@ $schema: ../../../../json_schemas/test_story.schema.yaml description: Test training a model, then immediately predict against the same training dataset. +version: '>= 1.3' prologues: - path: /_bulk method: POST