GetMessages - 查看对话消息

更新时间:
复制 MD 格式

该接口用于来查看具体对话消息。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

rdsai:GetMessages

none

*全部资源

*

无 无

请求语法

GET  HTTP/1.1

请求参数

名称

类型

必填

描述

示例值

ConversationId

string

否

对话 Id。

941c6f59-acf5-4e11-9adc-31e52e1f****

FlowId

string

否

Flow 实例 ID

flow-90ea18a8254645968325

FirstId

string

否

首条消息 Id。

038866af-a050-4bc5-bfad-b7bfc838****

Limit

integer

否

分页查询时设置的每页行数。取值范围:1~100。默认值:100。

10

EventMode

string

否

事件输出类型,支持 inline 和 separate,默认 inline。inline 时,工具调用事件、子任务事件、文档事件会统一放到 event = message 的 answer 字段中。separate 时,工具调用时间、子任务事件、文档事件,有各自的 event。

inline

WorkspaceId

string

否

ContextDB 工作空间 ID

00000000-0000-4000-8000-000000000001

返回参数

名称

类型

描述

示例值

object

对象。

RequestId

string

请求 Id。

FE9C65D7-930F-57A5-A207-8C396329****

Data

array<object>

查询结果。

array<object>

查询结果。

Id

string

消息 Id。

84dc9f9b-424a-404d-9c36-35e9d000****

ConversationId

string

会话 id。

9cbbe885-b240-4803-9d15-6781a3fd****

Query

string

查询语句。

实例rm-bp14as9914vd3**** 磁盘使用率,是否需要扩容

Answer

string

回复。

您询问的实例rm-bp14as9914vd3**** 磁盘使用率为23%,暂时不需要进行扩容。如果您需要进一步查看某个实例的详细配置、性能监控或进行其他操作,请告诉我具体需求!

CreatedAt

string

消息创建时间,Unix 时间戳,单位为秒。

1763986004

Feedback

string

反馈。

like

RetrieverResources

array

检索资源。

any

资源。

测试字段,不用关注。

Events

array<object>

事件列表

array<object>

事件列表

event

string

answer

string

ConversationId

string

会话 ID

conversation-example

MessageId

string

消息 ID

message-example

RoundId

string

工具审批轮次 ID

round-example

CallId

string

工具调用 ID

call-example

ToolName

string

工具名称

contextdb.search

ToolArguments

object

工具调用参数

Description

string

工具调用说明

Search ContextDB records

ApprovalStatus

string

工具调用审批状态

pending

GenerationStatus

string

GenerationStartedAt

string

GenerationFinishedAt

string

LastSentEntryId

string

StreamKey

string

MessageFiles

array<object>

object

Id

string

Type

string

PreviewUrl

string

UploadFileId

string

上传文件 ID

file-example

HasMore

boolean

是否有下一页。

true

Limit

integer

查询结果条数上限。

100

示例

正常返回示例

JSON格式

{
  "RequestId": "FE9C65D7-930F-57A5-A207-8C396329****",
  "Data": [
    {
      "Id": "84dc9f9b-424a-404d-9c36-35e9d000****",
      "ConversationId": "9cbbe885-b240-4803-9d15-6781a3fd****",
      "Query": "实例rm-bp14as9914vd3**** 磁盘使用率,是否需要扩容",
      "Answer": "您询问的实例rm-bp14as9914vd3**** 磁盘使用率为23%,暂时不需要进行扩容。如果您需要进一步查看某个实例的详细配置、性能监控或进行其他操作,请告诉我具体需求!",
      "CreatedAt": "1763986004",
      "Feedback": "like",
      "RetrieverResources": [
        "测试字段,不用关注。"
      ],
      "Events": [
        {
          "event": "",
          "answer": "",
          "ConversationId": "conversation-example",
          "MessageId": "message-example",
          "RoundId": "round-example",
          "CallId": "call-example",
          "ToolName": "contextdb.search",
          "ToolArguments": {
            "test": "test",
            "test2": 1
          },
          "Description": "Search ContextDB records",
          "ApprovalStatus": "pending"
        }
      ],
      "GenerationStatus": "",
      "GenerationStartedAt": "",
      "GenerationFinishedAt": "",
      "LastSentEntryId": "",
      "StreamKey": "",
      "MessageFiles": [
        {
          "Id": "",
          "Type": "",
          "PreviewUrl": "",
          "UploadFileId": "file-example"
        }
      ]
    }
  ],
  "HasMore": true,
  "Limit": 100
}

错误码

HTTP status code

错误码

错误信息

描述

400 InvalidParameter The provided parameter is invalid. 无效的参数。
400 InvalidWorkspaceId.Missing WorkspaceId is required for the ContextDB management App. 使用 ContextDB 管理应用时必须提供 WorkspaceId。请指定本次请求所属的 ContextDB 工作空间后重试。
400 InvalidWorkspaceId.Conflict The request contains conflicting WorkspaceId values. 请求中提供的 WorkspaceId 相互冲突。请确保请求中各位置的工作空间标识一致后重试。
400 InvalidWorkspaceId.Value WorkspaceId is invalid. WorkspaceId 无效。请检查工作空间标识,指定有效的 ContextDB WorkspaceId 后重试。
403 PermissionDenied User has no operation permission. 用户无操作权限
404 UserNotFound User does not exist. 用户不存在。
404 ConversationNotFound Conversation does not exist. 会话不存在。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。