diff --git a/_ml-commons-plugin/api/memory-apis/create-message.md b/_ml-commons-plugin/api/memory-apis/create-message.md index 51abdb0cb2..fa183bac0c 100644 --- a/_ml-commons-plugin/api/memory-apis/create-message.md +++ b/_ml-commons-plugin/api/memory-apis/create-message.md @@ -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 @@ -73,7 +91,7 @@ POST /_plugins/_ml/memory/SXA2cY0BfUsSoeNTz-8m/messages ```json { - "memory_id": "WnA3cY0BfUsSoeNTI-_J" + "message_id": "WnA3cY0BfUsSoeNTI-_J" } ``` @@ -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.", @@ -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.", diff --git a/_ml-commons-plugin/api/memory-apis/get-message-traces.md b/_ml-commons-plugin/api/memory-apis/get-message-traces.md index a909685f2f..54b470c1b4 100644 --- a/_ml-commons-plugin/api/memory-apis/get-message-traces.md +++ b/_ml-commons-plugin/api/memory-apis/get-message-traces.md @@ -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 @@ -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", @@ -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 @@ -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", @@ -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.", @@ -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.", @@ -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). \ No newline at end of file +``` \ No newline at end of file diff --git a/_ml-commons-plugin/api/memory-apis/get-message.md b/_ml-commons-plugin/api/memory-apis/get-message.md index 6a25dd3fdf..f905a13d56 100644 --- a/_ml-commons-plugin/api/memory-apis/get-message.md +++ b/_ml-commons-plugin/api/memory-apis/get-message.md @@ -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.", @@ -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 @@ -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.", @@ -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.", @@ -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). - diff --git a/_ml-commons-plugin/api/memory-apis/search-message.md b/_ml-commons-plugin/api/memory-apis/search-message.md index 2c0d23db24..2407765c92 100644 --- a/_ml-commons-plugin/api/memory-apis/search-message.md +++ b/_ml-commons-plugin/api/memory-apis/search-message.md @@ -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 @@ -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" }, @@ -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). \ No newline at end of file