Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion _ml-commons-plugin/api/memory-apis/create-message.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,24 @@ Field | Data type | Required/Optional | Updatable | Description
To create or update a message successfully, you must provide at least one of the preceding fields. The provided field(s) cannot be null or empty.
{: .note}

## Response body fields

The following table lists the available response fields.

| Field | Data type | Description |
| :--- | :--- | :--- |
| `memory_id` | String | The memory ID. |
| `message_id` | String | The message ID. |
| `create_time` | String | The time at which the message was created. |
| `updated_time` | String | The time at which the message was last updated. |
| `input` | String | The question in the message (human input). |
| `prompt_template` | String | The prompt template that was used for the message. |
| `response` | String | The answer to the question (generative AI output). |
| `origin` | String | The name of the AI or other system that generated the response. |
| `additional_info` | Object | Any other information that was sent to the `origin`. |
| `parent_message_id` | String | The ID of the parent message (for trace messages). |
| `trace_number` | Integer | The trace number (for trace messages). |

## Example request: Create a message

```json
Expand All @@ -73,7 +91,7 @@ POST /_plugins/_ml/memory/SXA2cY0BfUsSoeNTz-8m/messages

```json
{
"memory_id": "WnA3cY0BfUsSoeNTI-_J"
"message_id": "WnA3cY0BfUsSoeNTI-_J"
}
```

Expand Down Expand Up @@ -115,6 +133,7 @@ The updated message contains an additional `feedback` field:
"memory_id": "SXA2cY0BfUsSoeNTz-8m",
"message_id": "WnA3cY0BfUsSoeNTI-_J",
"create_time": "2024-02-03T23:04:15.554370024Z",
"updated_time": "2024-02-03T23:05:20.123456789Z",
"input": "How do I make an interaction?",
"prompt_template": "Hello OpenAI, can you answer this question?",
"response": "Hello, this is OpenAI. Here is the answer to your question.",
Expand Down Expand Up @@ -164,6 +183,7 @@ The updated message contains the updated `feedback` field:
"memory_id": "SXA2cY0BfUsSoeNTz-8m",
"message_id": "WnA3cY0BfUsSoeNTI-_J",
"create_time": "2024-02-03T23:04:15.554370024Z",
"updated_time": "2024-02-03T23:06:45.987654321Z",
"input": "How do I make an interaction?",
"prompt_template": "Hello OpenAI, can you answer this question?",
"response": "Hello, this is OpenAI. Here is the answer to your question.",
Expand Down
29 changes: 24 additions & 5 deletions _ml-commons-plugin/api/memory-apis/get-message-traces.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@ Parameter | Data type | Description
:--- | :--- | :---
`message_id` | String | The ID of the message to trace.

## Response body fields

The following table lists the available response fields.

| Field | Data type | Description |
| :--- | :--- | :--- |
| `memory_id` | String | The memory ID. |
| `message_id` | String | The message ID. |
| `create_time` | String | The time at which the message was created. |
| `updated_time` | String | The time at which the message was last updated. |
| `input` | String | The question in the message (human input). |
| `prompt_template` | String | The prompt template that was used for the message. |
| `response` | String | The answer to the question (generative AI output). |
| `origin` | String | The name of the AI or other system that generated the response. |
| `additional_info` | Object | Any other information that was sent to the `origin`. |
| `parent_message_id` | String | The ID of the parent message (for trace messages). |
| `trace_number` | Integer | The trace number (for trace messages). |

## Example request

```json
Expand All @@ -48,6 +66,7 @@ GET /_plugins/_ml/memory/message/TAuCZY0BT2tRrkdmCPqZ/traces
"memory_id": "7Qt4ZY0BT2tRrkdmSPlo",
"message_id": "TQuCZY0BT2tRrkdmEvpp",
"create_time": "2024-02-01T16:30:39.719968032Z",
"updated_time": "2024-02-01T16:30:39.719968032Z",
"input": "Which index has most documents",
"prompt_template": null,
"response": "Let me check the document counts of each index",
Expand All @@ -60,6 +79,7 @@ GET /_plugins/_ml/memory/message/TAuCZY0BT2tRrkdmCPqZ/traces
"memory_id": "7Qt4ZY0BT2tRrkdmSPlo",
"message_id": "TguCZY0BT2tRrkdmEvp7",
"create_time": "2024-02-01T16:30:39.732979687Z",
"updated_time": "2024-02-01T16:30:39.732979687Z",
"input": "",
"prompt_template": null,
"response": """health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
Expand Down Expand Up @@ -101,6 +121,7 @@ green open .opendistro-job-scheduler-lock XjgmXAVKQ4e8Y-ac54VBzg 1
"memory_id": "7Qt4ZY0BT2tRrkdmSPlo",
"message_id": "UwuCZY0BT2tRrkdmHPos",
"create_time": "2024-02-01T16:30:42.217897656Z",
"updated_time": "2024-02-01T16:30:42.217897656Z",
"input": "Which index has most documents",
"prompt_template": null,
"response": "Based on the cluster health information provided, the index with the most documents is .plugins-ml-model with 191 documents",
Expand All @@ -113,6 +134,7 @@ green open .opendistro-job-scheduler-lock XjgmXAVKQ4e8Y-ac54VBzg 1
"memory_id": "7Qt4ZY0BT2tRrkdmSPlo",
"message_id": "UQuCZY0BT2tRrkdmHPos",
"create_time": "2024-02-01T16:30:42.218120716Z",
"updated_time": "2024-02-01T16:30:42.218120716Z",
"input": "Which index has most documents",
"prompt_template": null,
"response": "The index with the most documents is the .plugins-ml-model index, which contains 191 documents based on the cluster health information provided.",
Expand All @@ -125,6 +147,7 @@ green open .opendistro-job-scheduler-lock XjgmXAVKQ4e8Y-ac54VBzg 1
"memory_id": "7Qt4ZY0BT2tRrkdmSPlo",
"message_id": "UguCZY0BT2tRrkdmHPos",
"create_time": "2024-02-01T16:30:42.218240713Z",
"updated_time": "2024-02-01T16:30:42.218240713Z",
"input": "Which index has most documents",
"prompt_template": null,
"response": "The index with the most documents is the .plugins-ml-model index, which contains 191 documents based on the cluster health information provided.",
Expand All @@ -135,8 +158,4 @@ green open .opendistro-job-scheduler-lock XjgmXAVKQ4e8Y-ac54VBzg 1
}
]
}
```

## Response body fields

For information about response fields, see [Create Message request fields]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/memory-apis/create-message#request-body-fields).
```
26 changes: 21 additions & 5 deletions _ml-commons-plugin/api/memory-apis/get-message.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ GET /_plugins/_ml/memory/message/0m8ya40BfUsSoeNTj-pU
"memory_id": "gW8Aa40BfUsSoeNTvOKI",
"message_id": "0m8ya40BfUsSoeNTj-pU",
"create_time": "2024-02-02T19:01:32.113621539Z",
"updated_time": "2024-02-02T19:01:32.113621539Z",
"input": null,
"prompt_template": null,
"response": "Hello, this is OpenAI. Here is the answer to your question.",
Expand Down Expand Up @@ -82,6 +83,24 @@ Parameter | Data type | Description
:--- | :--- | :---
`memory_id` | String | The ID of the memory for which to retrieve messages.

## Response body fields

The following table lists the available response fields.

| Field | Data type | Description |
| :--- | :--- | :--- |
| `memory_id` | String | The memory ID. |
| `message_id` | String | The message ID. |
| `create_time` | String | The time at which the message was created. |
| `updated_time` | String | The time at which the message was last updated. |
| `input` | String | The question in the message (human input). |
| `prompt_template` | String | The prompt template that was used for the message. |
| `response` | String | The answer to the question (generative AI output). |
| `origin` | String | The name of the AI or other system that generated the response. |
| `additional_info` | Object | Any other information that was sent to the `origin`. |
| `parent_message_id` | String | The ID of the parent message (for trace messages). |
| `trace_number` | Integer | The trace number (for trace messages). |

## Example request

```json
Expand Down Expand Up @@ -109,6 +128,7 @@ POST /_plugins/_ml/message/_search
"memory_id": "gW8Aa40BfUsSoeNTvOKI",
"message_id": "BW8ha40BfUsSoeNT8-i3",
"create_time": "2024-02-02T18:43:23.566994302Z",
"updated_time": "2024-02-02T18:43:23.566994302Z",
"input": "How do I make an interaction?",
"prompt_template": "Hello OpenAI, can you answer this question?",
"response": "Hello, this is OpenAI. Here is the answer to your question.",
Expand All @@ -121,6 +141,7 @@ POST /_plugins/_ml/message/_search
"memory_id": "gW8Aa40BfUsSoeNTvOKI",
"message_id": "0m8ya40BfUsSoeNTj-pU",
"create_time": "2024-02-02T19:01:32.113621539Z",
"updated_time": "2024-02-02T19:01:32.113621539Z",
"input": null,
"prompt_template": null,
"response": "Hello, this is OpenAI. Here is the answer to your question.",
Expand All @@ -132,8 +153,3 @@ POST /_plugins/_ml/message/_search
]
}
```

## Response body fields

For information about response fields, see [Create Message request fields]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/memory-apis/create-message#request-body-fields).

23 changes: 19 additions & 4 deletions _ml-commons-plugin/api/memory-apis/search-message.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,24 @@ Parameter | Data type | Description
:--- | :--- | :---
`memory_id` | String | The ID of the memory used to search for messages matching the query.

## Response body fields

The following table lists the available response fields.

| Field | Data type | Description |
| :--- | :--- | :--- |
| `memory_id` | String | The memory ID. |
| `message_id` | String | The message ID. |
| `create_time` | String | The time at which the message was created. |
| `updated_time` | String | The time at which the message was last updated. |
| `input` | String | The question in the message (human input). |
| `prompt_template` | String | The prompt template that was used for the message. |
| `response` | String | The answer to the question (generative AI output). |
| `origin` | String | The name of the AI or other system that generated the response. |
| `additional_info` | Object | Any other information that was sent to the `origin`. |
| `parent_message_id` | String | The ID of the parent message (for trace messages). |
| `trace_number` | Integer | The trace number (for trace messages). |

## Example request

```json
Expand Down Expand Up @@ -75,6 +93,7 @@ GET /_plugins/_ml/memory/gW8Aa40BfUsSoeNTvOKI/_search
"memory_id": "gW8Aa40BfUsSoeNTvOKI",
"trace_number": null,
"create_time": "2024-02-02T18:43:23.566994302Z",
"updated_time": "2024-02-02T18:43:23.566994302Z",
"additional_info": {
"suggestion": "api.openai.com"
},
Expand All @@ -88,7 +107,3 @@ GET /_plugins/_ml/memory/gW8Aa40BfUsSoeNTvOKI/_search
}
}
```

## Response body fields

For information about response fields, see [Create Message request fields]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/memory-apis/create-message#request-body-fields).
Loading