Skip to content

Commit

Permalink
Fixed merge conflicts, added support for payload properties into the …
Browse files Browse the repository at this point in the history
…prologue, attempted to fix errors in predict.yaml.

Signed-off-by: Nathalie Jonathan <[email protected]>
  • Loading branch information
nathaliellenaa committed Jan 7, 2025
1 parent e199271 commit 9c72a0d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 50 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added the ability to skip an individual chapter test ([#765](https://github.com/opensearch-project/opensearch-api-specification/pull/765))
- Added uploading of test spec logs ([#767](https://github.com/opensearch-project/opensearch-api-specification/pull/767))
- 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
2 changes: 2 additions & 0 deletions json_schemas/test_story.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ definitions:
$ref: '#/definitions/Distributions'
retry:
$ref: '#/definitions/Retry'
response:
$ref: '#/definitions/ExpectedResponse'
required: [method, path]

Output:
Expand Down
50 changes: 1 addition & 49 deletions spec/namespaces/ml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,6 @@ components:
items:
$ref: '../schemas/ml._common.yaml#/components/schemas/Sort'
description: The sort order.
ml.predict:

ml.update_model:
content:
application/json:
Expand Down Expand Up @@ -673,23 +671,12 @@ components:
interface:
type: object
description: The model interface.
ml.train:
ml.undeploy_model:
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:
node_ids:
type: array
items:
Expand All @@ -706,41 +693,6 @@ components:
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'
connector:
type: object
description: The connector to use for the model.
connector_id:
type: string
description: The connector ID.
is_enabled:
type: boolean
description: Whether the model is enabled.
description:
type: string
description: The model description.
model_config:
$ref: '../schemas/ml._common.yaml#/components/schemas/ModelConfig'
name:
type: string
description: The model name.
rate_limiter:
$ref: '../schemas/ml._common.yaml#/components/schemas/RateLimiter'
guardrails:
$ref: '../schemas/ml._common.yaml#/components/schemas/Guardrails'
interface:
type: object
description: The model interface.
node_ids:
type: array
items:
Expand All @@ -766,7 +718,7 @@ components:
type: string
description: The text documents.
required:
- text_docs
- text_docs
ml.predict:
content:
application/json:
Expand Down
8 changes: 8 additions & 0 deletions tests/plugins/ml/ml/models/predict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ prologues:
retry:
count: 3
wait: 10000
response:
status: 200
payload:
state: COMPLETED
output:
model_id: payload.model_id
- path: /_plugins/_ml/models/{model_id}/_deploy
Expand All @@ -54,6 +58,10 @@ prologues:
retry:
count: 3
wait: 10000
response:
status: 200
payload:
state: COMPLETED
output:
model_id: payload.model_id
epilogues:
Expand Down

0 comments on commit 9c72a0d

Please sign in to comment.