Skip to content

Commit b073571

Browse files
Added ML create, update, get, search message, and get message traces APIs, updated max_score schema type and test description in memory/update.yaml.
Signed-off-by: Nathalie Jonathan <[email protected]>
1 parent 5f0367a commit b073571

File tree

9 files changed

+540
-6
lines changed

9 files changed

+540
-6
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
4545
- Added `GET /_plugins/_ml/connectors/{connector_id}`, `_search`, `POST /_plugins/_ml/connectors/_search`, and `PUT /_plugins/_ml/connectors/{connector_id}` ([#764](https://github.com/opensearch-project/opensearch-api-specification/pull/764))
4646
- Added the ability to skip an individual chapter test ([#765](https://github.com/opensearch-project/opensearch-api-specification/pull/765))
4747
- Added uploading of test spec logs ([#767](https://github.com/opensearch-project/opensearch-api-specification/pull/767))
48-
- Added `POST /_plugins/_ml/memory`, `PUT /_plugins/_ml/memory/{memory_id}`, `GET /_plugins/_ml/memory`, `GET /_plugins/_ml/memory/{memory_id}`, `_search`, `POST /_plugins/_ml/memory/_search`, and `DELETE /_plugins/_ml/memory/{memory_id}` ([#771](https://github.com/opensearch-project/opensearch-api-specification/pull/771))
48+
- Added `POST /_plugins/_ml/memory`, `POST /_plugins/_ml/memory/_search`, `{memory_id}/_search`, `{memory_id}/messages`, `PUT /_plugins/_ml/memory/{memory_id}`, `message/{message_id}`, `GET /_plugins/_ml/memory`, `GET /_plugins/_ml/memory/{memory_id}`, `_search`, `message/{message_id}`, `{memory_id}/messages`, `{memory_id}/_search`, `message/{message_id}/traces`, and `DELETE /_plugins/_ml/memory/{memory_id}` ([#771](https://github.com/opensearch-project/opensearch-api-specification/pull/771))
4949

5050
### Removed
5151
- 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))

spec/namespaces/ml.yaml

+208-1
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,88 @@ paths:
332332
responses:
333333
'200':
334334
$ref: '#/components/responses/ml.search_memory@200'
335+
/_plugins/_ml/memory/{memory_id}/messages:
336+
get:
337+
operationId: ml.get_message.0
338+
x-operation-group: ml.get_message
339+
x-version-added: '2.12'
340+
description: Get a message.
341+
parameters:
342+
- $ref: '#/components/parameters/ml.get_message::path.memory_id'
343+
responses:
344+
'200':
345+
$ref: '#/components/responses/ml.get_message@200'
346+
post:
347+
operationId: ml.create_message.0
348+
x-operation-group: ml.create_message
349+
x-version-added: '2.12'
350+
description: Create a message.
351+
parameters:
352+
- $ref: '#/components/parameters/ml.create_message::path.memory_id'
353+
requestBody:
354+
$ref: '#/components/requestBodies/ml.create_message'
355+
responses:
356+
'200':
357+
$ref: '#/components/responses/ml.create_message@200'
358+
/_plugins/_ml/memory/message/{message_id}:
359+
get:
360+
operationId: ml.get_message.1
361+
x-operation-group: ml.get_message
362+
x-version-added: '2.12'
363+
description: Get a message.
364+
parameters:
365+
- $ref: '#/components/parameters/ml.get_message::path.message_id'
366+
responses:
367+
'200':
368+
$ref: '#/components/responses/ml.get_message@200'
369+
put:
370+
operationId: ml.update_message.0
371+
x-operation-group: ml.update_message
372+
x-version-added: '2.12'
373+
description: Update a message.
374+
parameters:
375+
- $ref: '#/components/parameters/ml.update_message::path.message_id'
376+
requestBody:
377+
$ref: '#/components/requestBodies/ml.update_message'
378+
responses:
379+
'200':
380+
$ref: '#/components/responses/ml.update_message@200'
381+
/_plugins/_ml/memory/{memory_id}/_search:
382+
get:
383+
operationId: ml.search_message.0
384+
x-operation-group: ml.search_message
385+
x-version-added: '2.12'
386+
description: Search messages.
387+
parameters:
388+
- $ref: '#/components/parameters/ml.search_message::path.memory_id'
389+
requestBody:
390+
$ref: '#/components/requestBodies/ml.search_message'
391+
responses:
392+
'200':
393+
$ref: '#/components/responses/ml.search_message@200'
394+
post:
395+
operationId: ml.search_message.1
396+
x-operation-group: ml.search_message
397+
x-version-added: '2.12'
398+
description: Search messages.
399+
parameters:
400+
- $ref: '#/components/parameters/ml.search_message::path.memory_id'
401+
requestBody:
402+
$ref: '#/components/requestBodies/ml.search_message'
403+
responses:
404+
'200':
405+
$ref: '#/components/responses/ml.search_message@200'
406+
/_plugins/_ml/memory/message/{message_id}/traces:
407+
get:
408+
operationId: ml.get_message_traces.0
409+
x-operation-group: ml.get_message_traces
410+
x-version-added: '2.12'
411+
description: Get a message traces.
412+
parameters:
413+
- $ref: '#/components/parameters/ml.get_message_traces::path.message_id'
414+
responses:
415+
'200':
416+
$ref: '#/components/responses/ml.get_message_traces@200'
335417
components:
336418
requestBodies:
337419
ml.register_model_group:
@@ -671,6 +753,63 @@ components:
671753
items:
672754
$ref: '../schemas/ml._common.yaml#/components/schemas/SortMemory'
673755
description: The sort order.
756+
ml.create_message:
757+
content:
758+
application/json:
759+
schema:
760+
type: object
761+
properties:
762+
input:
763+
type: string
764+
description: The question in the message.
765+
prompt_template:
766+
type: string
767+
description: The prompt template.
768+
response:
769+
type: string
770+
description: The answer to the question.
771+
origin:
772+
type: string
773+
description: The system name that generated the response.
774+
additional_info:
775+
$ref: '../schemas/ml._common.yaml#/components/schemas/AdditionalInfo'
776+
ml.update_message:
777+
content:
778+
application/json:
779+
schema:
780+
type: object
781+
properties:
782+
input:
783+
type: string
784+
description: The question in the message.
785+
prompt_template:
786+
type: string
787+
description: The prompt template.
788+
response:
789+
type: string
790+
description: The answer to the question.
791+
origin:
792+
type: string
793+
description: The system name that generated the response.
794+
additional_info:
795+
$ref: '../schemas/ml._common.yaml#/components/schemas/AdditionalInfo'
796+
ml.search_message:
797+
content:
798+
application/json:
799+
schema:
800+
type: object
801+
properties:
802+
query:
803+
$ref: '../schemas/ml._common.yaml#/components/schemas/Query'
804+
size:
805+
type: integer
806+
format: int64
807+
description: The number of messages to return.
808+
sort:
809+
type: array
810+
items:
811+
$ref: '../schemas/ml._common.yaml#/components/schemas/SortMessage'
812+
description: The sort order.
674813
responses:
675814
ml.register_model_group@200:
676815
content:
@@ -818,7 +957,9 @@ components:
818957
type: object
819958
properties:
820959
memory_id:
821-
type: string
960+
$ref: '../schemas/_common.yaml#/components/schemas/Name'
961+
required:
962+
- memory_id
822963
ml.update_memory@200:
823964
content:
824965
application/json:
@@ -840,6 +981,36 @@ components:
840981
application/json:
841982
schema:
842983
$ref: '../schemas/ml._common.yaml#/components/schemas/SearchMemoryResponse'
984+
ml.create_message@200:
985+
content:
986+
application/json:
987+
schema:
988+
type: object
989+
properties:
990+
message_id:
991+
$ref: '../schemas/_common.yaml#/components/schemas/Name'
992+
required:
993+
- message_id
994+
ml.get_message@200:
995+
content:
996+
application/json:
997+
schema:
998+
$ref: '../schemas/ml._common.yaml#/components/schemas/GetMessageResponse'
999+
ml.update_message@200:
1000+
content:
1001+
application/json:
1002+
schema:
1003+
$ref: '../schemas/_common.yaml#/components/schemas/WriteResponseBase'
1004+
ml.search_message@200:
1005+
content:
1006+
application/json:
1007+
schema:
1008+
$ref: '../schemas/ml._common.yaml#/components/schemas/SearchMessageResponse'
1009+
ml.get_message_traces@200:
1010+
content:
1011+
application/json:
1012+
schema:
1013+
$ref: '../schemas/ml._common.yaml#/components/schemas/GetMessageTracesResponse'
8431014
parameters:
8441015
ml.get_model_group::path.model_group_id:
8451016
name: model_group_id
@@ -953,5 +1124,41 @@ components:
9531124
name: memory_id
9541125
in: path
9551126
required: true
1127+
schema:
1128+
type: string
1129+
ml.create_message::path.memory_id:
1130+
name: memory_id
1131+
in: path
1132+
required: true
1133+
schema:
1134+
type: string
1135+
ml.get_message::path.memory_id:
1136+
name: memory_id
1137+
in: path
1138+
required: true
1139+
schema:
1140+
type: string
1141+
ml.get_message::path.message_id:
1142+
name: message_id
1143+
in: path
1144+
required: true
1145+
schema:
1146+
type: string
1147+
ml.update_message::path.message_id:
1148+
name: message_id
1149+
in: path
1150+
required: true
1151+
schema:
1152+
type: string
1153+
ml.search_message::path.memory_id:
1154+
name: memory_id
1155+
in: path
1156+
required: true
1157+
schema:
1158+
type: string
1159+
ml.get_message_traces::path.message_id:
1160+
name: message_id
1161+
in: path
1162+
required: true
9561163
schema:
9571164
type: string

0 commit comments

Comments
 (0)