Skip to content

Commit

Permalink
Split get_all variants out of ml.get_memory and ml.get_message
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Jan 15, 2025
1 parent 806b25f commit e456a4e
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 132 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Changed `SearchModelsQuery`, `CreateConnectorRequest` & `RegisterAgentsRequest` to be defined inline of request bodies ([#725](https://github.com/opensearch-project/opensearch-api-specification/pull/725))
- Changed `indices.data_streams_stats:DataStreamsStatsItem` to instead be `indices._common:DataStreamStats` ([#725](https://github.com/opensearch-project/opensearch-api-specification/pull/725))
- Changed naming of `snapshot._common`'s `Status`, `ShardsStats`, `ShardsStatsStage`, `ShardsStatsSummary` and `ShardsStatsSummaryItem` schemas to be prefixed with `Snapshot` ([#730](https://github.com/opensearch-project/opensearch-api-specification/pull/730))
- Changed `ml.get_memory` and `ml.get_message` to split out `get_all` variants ([#]())

## [0.1.0] - 2024-10-25

Expand Down
167 changes: 122 additions & 45 deletions spec/namespaces/ml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -428,15 +428,16 @@ paths:
$ref: '#/components/responses/ml.delete_agent@200'
/_plugins/_ml/memory:
get:
operationId: ml.get_memory.0
x-operation-group: ml.get_memory
operationId: ml.get_all_memories.0
x-operation-group: ml.get_all_memories
x-version-added: '2.12'
description: Get a memory.
requestBody:
$ref: '#/components/requestBodies/ml.get_memory'
description: Get all memories.
parameters:
- $ref: '#/components/parameters/ml.get_all_memories::query.max_results'
- $ref: '#/components/parameters/ml.get_all_memories::query.next_token'
responses:
'200':
$ref: '#/components/responses/ml.get_memory@200'
$ref: '#/components/responses/ml.get_all_memories@200'
post:
operationId: ml.create_memory.0
x-operation-group: ml.create_memory
Expand All @@ -449,12 +450,10 @@ paths:
$ref: '#/components/responses/ml.create_memory@200'
/_plugins/_ml/memory/{memory_id}:
get:
operationId: ml.get_memory.1
operationId: ml.get_memory.0
x-operation-group: ml.get_memory
x-version-added: '2.12'
description: Get a memory.
requestBody:
$ref: '#/components/requestBodies/ml.get_memory'
parameters:
- $ref: '#/components/parameters/ml.get_memory::path.memory_id'
responses:
Expand Down Expand Up @@ -505,15 +504,17 @@ paths:
$ref: '#/components/responses/ml.search_memory@200'
/_plugins/_ml/memory/{memory_id}/messages:
get:
operationId: ml.get_message.0
x-operation-group: ml.get_message
operationId: ml.get_all_messages.0
x-operation-group: ml.get_all_messages
x-version-added: '2.12'
description: Get a message.
description: Get all messages in a memory.
parameters:
- $ref: '#/components/parameters/ml.get_message::path.memory_id'
- $ref: '#/components/parameters/ml.get_all_messages::path.memory_id'
- $ref: '#/components/parameters/ml.get_all_messages::query.max_results'
- $ref: '#/components/parameters/ml.get_all_messages::query.next_token'
responses:
'200':
$ref: '#/components/responses/ml.get_message@200'
$ref: '#/components/responses/ml.get_all_messages@200'
post:
operationId: ml.create_message.0
x-operation-group: ml.create_message
Expand All @@ -528,7 +529,7 @@ paths:
$ref: '#/components/responses/ml.create_message@200'
/_plugins/_ml/memory/message/{message_id}:
get:
operationId: ml.get_message.1
operationId: ml.get_message.0
x-operation-group: ml.get_message
x-version-added: '2.12'
description: Get a message.
Expand Down Expand Up @@ -582,6 +583,8 @@ paths:
description: Get a message traces.
parameters:
- $ref: '#/components/parameters/ml.get_message_traces::path.message_id'
- $ref: '#/components/parameters/ml.get_message_traces::query.max_results'
- $ref: '#/components/parameters/ml.get_message_traces::query.next_token'
responses:
'200':
$ref: '#/components/responses/ml.get_message_traces@200'
Expand Down Expand Up @@ -774,7 +777,7 @@ components:
version:
$ref: '../schemas/_common.yaml#/components/schemas/VersionString'
model_format:
$ref: '../schemas/_common.yaml#/components/schemas/ModelFormat'
$ref: '../schemas/ml._common.yaml#/components/schemas/ModelFormat'
description:
type: string
description: The model description.
Expand All @@ -795,7 +798,7 @@ components:
version:
$ref: '../schemas/_common.yaml#/components/schemas/VersionString'
model_format:
$ref: '../schemas/_common.yaml#/components/schemas/ModelFormat'
$ref: '../schemas/ml._common.yaml#/components/schemas/ModelFormat'
model_group_id:
$ref: '../schemas/_common.yaml#/components/schemas/Id'
model_content_hash_value:
Expand Down Expand Up @@ -832,7 +835,7 @@ components:
version:
$ref: '../schemas/_common.yaml#/components/schemas/VersionString'
model_format:
$ref: '../schemas/_common.yaml#/components/schemas/ModelFormat'
$ref: '../schemas/ml._common.yaml#/components/schemas/ModelFormat'
model_group_id:
$ref: '../schemas/_common.yaml#/components/schemas/Id'
model_content_hash_value:
Expand Down Expand Up @@ -891,7 +894,7 @@ components:
version:
$ref: '../schemas/_common.yaml#/components/schemas/VersionString'
model_format:
$ref: '../schemas/_common.yaml#/components/schemas/ModelFormat'
$ref: '../schemas/ml._common.yaml#/components/schemas/ModelFormat'
description:
type: string
description: The model description.
Expand Down Expand Up @@ -962,8 +965,6 @@ components:
type: array
items:
$ref: '../schemas/_common.yaml#/components/schemas/Id'
required:
- model_ids
ml.unload_model:
content:
application/json:
Expand All @@ -978,8 +979,6 @@ components:
type: array
items:
$ref: '../schemas/_common.yaml#/components/schemas/Id'
required:
- model_ids
ml.predict_model:
content:
application/json:
Expand Down Expand Up @@ -1171,20 +1170,6 @@ components:
required:
- name
- type
ml.get_memory:
content:
application/json:
schema:
type: object
properties:
max_results:
type: integer
format: int64
description: The maximum number of results to return.
next_token:
type: integer
format: int64
description: The index of the first memory in the sorted list of memories to return.
ml.create_memory:
content:
application/json:
Expand Down Expand Up @@ -1282,15 +1267,19 @@ components:
type: object
properties:
user_rate_limiter:
$ref: '../schemas/ml._common.yaml#/components/schemas/UserRateLimiter'
type: object
additionalProperties:
$ref: '../schemas/ml._common.yaml#/components/schemas/RateLimiter'
ml.update_controller:
content:
application/json:
schema:
type: object
properties:
user_rate_limiter:
$ref: '../schemas/ml._common.yaml#/components/schemas/UserRateLimiter'
type: object
additionalProperties:
$ref: '../schemas/ml._common.yaml#/components/schemas/RateLimiter'
model_id:
$ref: '../schemas/_common.yaml#/components/schemas/Name'
ml.get_profile:
Expand Down Expand Up @@ -1477,7 +1466,7 @@ components:
content:
application/json:
schema:
$ref: '../schemas/ml._common.yaml#/components/schemas/UpdateModelResponse'
$ref: '../schemas/_common.yaml#/components/schemas/WriteResponseBase'
ml.delete_task@200:
content:
application/json:
Expand Down Expand Up @@ -1553,7 +1542,23 @@ components:
content:
application/json:
schema:
$ref: '../schemas/ml._common.yaml#/components/schemas/GetMemoryResponse'
$ref: '../schemas/ml._common.yaml#/components/schemas/Memory'
ml.get_all_memories@200:
content:
application/json:
schema:
type: object
properties:
memories:
type: array
items:
$ref: '../schemas/ml._common.yaml#/components/schemas/Memory'

Check failure on line 1555 in spec/namespaces/ml.yaml

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 18 spaces but found 20 spaces
next_token:
description: The index of the next memory after the last memory in the returned list.
type: integer
format: int32
required:
- memories
ml.create_memory@200:
content:
application/json:
Expand Down Expand Up @@ -1599,7 +1604,23 @@ components:
content:
application/json:
schema:
$ref: '../schemas/ml._common.yaml#/components/schemas/GetMessageResponse'
$ref: '../schemas/ml._common.yaml#/components/schemas/Message'
ml.get_all_messages@200:
content:
application/json:
schema:
type: object
properties:
messages:
type: array
items:
$ref: '../schemas/ml._common.yaml#/components/schemas/Message'
next_token:
description: The index of the next message after the last message in the returned list.
type: integer
format: int32
required:
- messages
ml.update_message@200:
content:
application/json:
Expand All @@ -1614,15 +1635,27 @@ components:
content:
application/json:
schema:
$ref: '../schemas/ml._common.yaml#/components/schemas/GetMessageTracesResponse'
type: object
properties:
traces:
type: array
items:
$ref: '../schemas/ml._common.yaml#/components/schemas/Message'
next_token:
type: integer
format: int32
required:
- traces
ml.get_controller@200:
content:
application/json:
schema:
type: object
properties:
user_rate_limiter:
$ref: '../schemas/ml._common.yaml#/components/schemas/UserRateLimiter'
type: object
additionalProperties:
$ref: '../schemas/ml._common.yaml#/components/schemas/RateLimiter'
model_id:
$ref: '../schemas/_common.yaml#/components/schemas/Name'
ml.create_controller@200:
Expand Down Expand Up @@ -1661,6 +1694,22 @@ components:
schema:
$ref: '../schemas/ml._common.yaml#/components/schemas/GetProfileResponse'
parameters:
ml.get_all_memories::query.max_results:
name: max_results
in: query
required: false
schema:
description: The maximum number of results to return. If there are fewer memories than the number set in `max_results`, the response returns only the number of memories that exist. Default is `10`.
type: integer
format: int32
ml.get_all_memories::query.next_token:
name: next_token
in: query
required: false
schema:
description: The index of the first memory in the sorted list of memories to return. Memories are ordered by `create_time`. For example, if memories `A`, `B`, and `C` exist, `next_token=1` returns memories `B` and `C`. Default is `0` (return all memories).
type: integer
format: int32
ml.get_model_group::path.model_group_id:
name: model_group_id
in: path
Expand Down Expand Up @@ -1837,12 +1886,26 @@ components:
required: true
schema:
type: string
ml.get_message::path.memory_id:
ml.get_all_messages::path.memory_id:
name: memory_id
in: path
required: true
schema:
type: string
ml.get_all_messages::query.max_results:
name: max_results
in: query
required: false
schema:
type: integer
format: int32
ml.get_all_messages::query.next_token:
name: next_token
in: query
required: false
schema:
type: integer
format: int32
ml.get_message::path.message_id:
name: message_id
in: path
Expand All @@ -1867,6 +1930,20 @@ components:
required: true
schema:
type: string
ml.get_message_traces::query.max_results:
name: max_results
in: query
required: false
schema:
type: integer
format: int32
ml.get_message_traces::query.next_token:
name: next_token
in: query
required: false
schema:
type: integer
format: int32
ml.get_controller::path.model_id:
name: model_id
in: path
Expand Down
7 changes: 1 addition & 6 deletions spec/schemas/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2474,9 +2474,4 @@ components:
type: number
required:
- active_threads
- thread_executions
ModelFormat:
type: string
enum:
- ONNX
- TORCH_SCRIPT
- thread_executions
Loading

0 comments on commit e456a4e

Please sign in to comment.