Skip to content

Commit

Permalink
Merged main and resolve conflicts.
Browse files Browse the repository at this point in the history
Signed-off-by: Nathalie Jonathan <[email protected]>
  • Loading branch information
nathaliellenaa committed Dec 31, 2024
1 parent 26e3859 commit 6243151
Show file tree
Hide file tree
Showing 6 changed files with 566 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added 404 response to `/_search/scroll` ([#749](https://github.com/opensearch-project/opensearch-api-specification/pull/749))
- Added `node_failures` to `DELETE /_search/scroll` and `DELETE /_search/scroll/{scroll_id}` ([#749](https://github.com/opensearch-project/opensearch-api-specification/pull/749))
- Added `GET /_plugins/_ml/models/{model_id}`, `POST /_plugins/_ml/models/_search`, `POST /_plugins/_ml/models/_unload`, `_undeploy`, `_upload`, `meta`, `_register_meta`, `POST /_plugins/_ml/models/{model_id}/_load`, `_predict`, `_unload`, `chunk/{chunk_number}`, `upload_chunk/{chunk_number}`, and `PUT /_plugins/_ml/models/{model_id}` ([#733](https://github.com/opensearch-project/opensearch-api-specification/pull/733))
- Added `POST /_plugins/_ml/_train/{algorithm_name}`, `_predict/{algorithm_name}/{model_id}`, and `_train_predict/{algorithm_name}` ([#755](https://github.com/opensearch-project/opensearch-api-specification/pull/755))

### 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))
Expand Down
136 changes: 135 additions & 1 deletion spec/namespaces/ml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,43 @@ paths:
responses:
'200':
$ref: '#/components/responses/ml.search_models@200'
/_plugins/_ml/_predict/{algorithm_name}/{model_id}:
post:
operationId: ml.predict.0
x-operation-group: ml.predict
description: Predicts new data with trained model.
parameters:
- $ref: '#/components/parameters/ml.predict::path.algorithm_name'
- $ref: '#/components/parameters/ml.predict::path.model_id'
requestBody:
$ref: '#/components/requestBodies/ml.predict'
responses:
'200':
$ref: '#/components/responses/ml.predict@200'
/_plugins/_ml/_train/{algorithm_name}:
post:
operationId: ml.train.0
x-operation-group: ml.train
description: Trains a model synchronously.
parameters:
- $ref: '#/components/parameters/ml.train::path.algorithm_name'
requestBody:
$ref: '#/components/requestBodies/ml.train'
responses:
'200':
$ref: '#/components/responses/ml.train@200'
/_plugins/_ml/_train_predict/{algorithm_name}:
post:
operationId: ml.train_predict.0
x-operation-group: ml.train_predict
description: Trains a model and predicts against the same training dataset.
parameters:
- $ref: '#/components/parameters/ml.train_predict::path.algorithm_name'
requestBody:
$ref: '#/components/requestBodies/ml.train_predict'
responses:
'200':
$ref: '#/components/responses/ml.train_predict@200'
/_plugins/_ml/connectors/_create:
post:
operationId: ml.create_connector.0
Expand Down Expand Up @@ -558,7 +595,65 @@ components:
type: string
description: The text documents.
required:
- text_docs
- text_docs
ml.predict:
content:
application/json:
schema:
type: object
properties:
input_query:
$ref: '../schemas/ml._common.yaml#/components/schemas/InputQuery'
input_index:
type: array
items:
type: string
description: The input index.
text_docs:
type: array
items:
type: string
description: The text documents.
return_number:
type: boolean
description: Whether to return bytes in model output.
target_response:
type: array
items:
type: string
description: The target response.
ml.train:
content:
application/json:
schema:
type: object
properties:
parameters:
$ref: '../schemas/ml._common.yaml#/components/schemas/TrainParameters'
input_query:
$ref: '../schemas/ml._common.yaml#/components/schemas/InputQuery'
input_index:
type: array
description: The input index.
items:
type: string
ml.train_predict:
content:
application/json:
schema:
type: object
properties:
parameters:
$ref: '../schemas/ml._common.yaml#/components/schemas/TrainParameters'
input_query:
$ref: '../schemas/ml._common.yaml#/components/schemas/InputQuery'
input_index:
type: array
description: The input index.
items:
type: string
input_data:
$ref: '../schemas/ml._common.yaml#/components/schemas/PredictionResult'
ml.create_connector:
content:
application/json:
Expand Down Expand Up @@ -793,6 +888,21 @@ components:
application/json:
schema:
$ref: '../schemas/ml._common.yaml#/components/schemas/SearchModelsResponse'
ml.predict@200:
content:
application/json:
schema:
$ref: '../schemas/ml._common.yaml#/components/schemas/PredictResponse'
ml.train@200:
content:
application/json:
schema:
$ref: '../schemas/ml._common.yaml#/components/schemas/TrainResponse'
ml.train_predict@200:
content:
application/json:
schema:
$ref: '../schemas/ml._common.yaml#/components/schemas/TrainPredictResponse'
ml.create_connector@200:
content:
application/json:
Expand Down Expand Up @@ -912,6 +1022,30 @@ components:
required: true
schema:
type: string
ml.predict::path.algorithm_name:
name: algorithm_name
in: path
required: true
schema:
type: string
ml.predict::path.model_id:
name: model_id
in: path
required: true
schema:
type: string
ml.train::path.algorithm_name:
name: algorithm_name
in: path
required: true
schema:
type: string
ml.train_predict::path.algorithm_name:
name: algorithm_name
in: path
required: true
schema:
type: string
ml.delete_connector::path.connector_id:
name: connector_id
in: path
Expand Down
Loading

0 comments on commit 6243151

Please sign in to comment.