获取消息追踪
2.12 版本引入
使用此 API 检索 会话搜索 的消息跟踪信息。这对于调试非常有用。
对于每条消息,智能体可能需要运行不同的工具。您可以使用获取跟踪 API 来获取消息的所有跟踪数据。跟踪数据包括消息执行的详细步骤。
当安全插件启用时,所有内存都以私有
安全模式存在。只有创建内存的用户才能与该内存及其消息进行交互。
端点
GET /_plugins/_ml/memory/message/<message_id>/traces
路径参数
下表列出了可用的路径参数。
参数 | 数据类型 | 描述 |
---|---|---|
message_id | 字符串 | 要跟踪的消息 ID。 |
请求示例
GET /_plugins/_ml/memory/message/TAuCZY0BT2tRrkdmCPqZ/traces
示例响应
{
"traces": [
{
"memory_id": "7Qt4ZY0BT2tRrkdmSPlo",
"message_id": "TQuCZY0BT2tRrkdmEvpp",
"create_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",
"origin": null,
"additional_info": {},
"parent_message_id": "TAuCZY0BT2tRrkdmCPqZ",
"trace_number": 1
},
{
"memory_id": "7Qt4ZY0BT2tRrkdmSPlo",
"message_id": "TguCZY0BT2tRrkdmEvp7",
"create_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
green open .plugins-ml-model-group lHgGEgJhT_mpADyOZoXl2g 1 1 9 2 33.4kb 16.7kb
green open .plugins-ml-memory-meta b2LEpv0QS8K60QBjXtRm6g 1 1 13 0 117.5kb 58.7kb
green open .ql-datasources 9NXm_tMXQc6s_4uRToSNkQ 1 1 0 0 416b 208b
green open sample-ecommerce UPYOQcAfRGqFAlSxcZlRjw 1 1 40320 0 4.1mb 2mb
green open .plugins-ml-task xYTlprYCQnaaYici69SOjA 1 1 117 0 115.5kb 57.6kb
green open .opendistro_security 7DAqhm9QQmeEsQYhA40cJg 1 1 10 0 117kb 58.5kb
green open sample-host-health Na5tq6UiTt6r_qYME1vV-w 1 1 40320 0 2.6mb 1.3mb
green open .opensearch-observability 6PthtLluSKyYCdZR3Mw0iw 1 1 0 0 416b 208b
green open .plugins-ml-model WYcjBHcnRuSDHeVWPVupoA 1 1 191 45 4.2gb 2.1gb
green open index_for_neural_sparse GQswGabQRIazM_trnqaDrw 1 1 5 0 28.4kb 14.2kb
green open security-auditlog-2024.01.30 BhXR7Nd3QVOVGxJNpR0-jw 1 1 27768 0 13.8mb 7mb
green open sample-http-responses 0gmYYYdOTiCbVUvl_uDL0w 1 1 40320 0 2.5mb 1.2mb
green open security-auditlog-2024.02.01 2VD1ieDGS5m-TfjIdfT8Eg 1 1 36386 0 37mb 18.2mb
green open opensearch_dashboards_sample_data_ecommerce wnE6r7OvSPqc5YHj8wHSLA 1 1 4675 0 8.8mb 4.4mb
green open security-auditlog-2024.01.31 cNRK5-2eTwes0SRlXTl0RQ 1 1 34520 0 20.5mb 9.8mb
green open .plugins-ml-memory-message wTNBU4BBQVSFcFhNlUdfBQ 1 1 88 1 399.7kb 205kb
green open .plugins-flow-framework-state dJUNDv9MSJ2jjwKbzXPlrw 1 1 39 0 114.1kb 57kb
green open .plugins-ml-agent 7X1IzoLuSGmIujOh9i5mmg 1 1 27 0 146.6kb 73.3kb
green open .plugins-flow-framework-templates _ecC0KahTlmG_3tFUst7Uw 1 1 18 0 175.8kb 87.9kb
green open .plugins-ml-connector q45iJfVjQ5KgxeNC65DLSw 1 1 11 0 313.1kb 156.5kb
green open .kibana_1 vRjXK4bHSUueB_4iXiQ8yw 1 1 257 0 264kb 132kb
green open .plugins-ml-config G7gxGQB7TZeQzBasHd5PUg 1 1 1 0 7.8kb 3.9kb
green open .plugins-ml-controller NQTZPREZRhWoDdjCglRLFg 1 1 0 0 50.1kb 49.9kb
green open opensearch_dashboards_sample_data_logs 9gpOTB3rRgqBLvqis_k5LQ 1 1 14074 0 18mb 9mb
green open .plugins-flow-framework-config JlKPsCh6SEq-Jh6rPL_x9Q 1 1 1 0 7.8kb 3.9kb
green open opensearch_dashboards_sample_data_flights pJde0irnTce4-uobHwYmMQ 1 1 13059 0 11.9mb 5.9mb
green open my_test_data T4hwNs7CTJGIfw2QpCqQ_Q 1 1 6 0 91.7kb 45.8kb
green open .opendistro-job-scheduler-lock XjgmXAVKQ4e8Y-ac54VBzg 1 1 3 0 38.7kb 19.4kb
""",
"origin": "ListIndexTool",
"additional_info": {},
"parent_message_id": "TAuCZY0BT2tRrkdmCPqZ",
"trace_number": 2
},
{
"memory_id": "7Qt4ZY0BT2tRrkdmSPlo",
"message_id": "UwuCZY0BT2tRrkdmHPos",
"create_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",
"origin": null,
"additional_info": {},
"parent_message_id": "TAuCZY0BT2tRrkdmCPqZ",
"trace_number": 3
},
{
"memory_id": "7Qt4ZY0BT2tRrkdmSPlo",
"message_id": "UQuCZY0BT2tRrkdmHPos",
"create_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.",
"origin": null,
"additional_info": {},
"parent_message_id": "TAuCZY0BT2tRrkdmCPqZ",
"trace_number": 4
},
{
"memory_id": "7Qt4ZY0BT2tRrkdmSPlo",
"message_id": "UguCZY0BT2tRrkdmHPos",
"create_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.",
"origin": null,
"additional_info": {},
"parent_message_id": "TAuCZY0BT2tRrkdmCPqZ",
"trace_number": 5
}
]
}
响应正文字段
有关响应字段的信息,请参阅创建消息请求字段。