DingRtmAgentClient接口

通过阅读本文,您可以了解到Android SDKAI实时对话智能体组件接口详情。

接口说明

目录

API

描述

支持的最低版本

setListener

设置智能体消息服务的回调。

3.9.0

sendGreetingReady

发送greetingready消息。

3.9.0

sendInterrupt

发送interrupt消息。

3.9.0

sendPushToTalk

发送对讲机模式命令。

3.9.0

接口详情

  • setListener: 设置智能体消息服务的回调。

     public abstract void setListener (DingRtmAgentEventListener listener)

    参数

    类型

    描述

    listener

    DingRtmAgentEventListener

    用于接收来自RTM智能体服务的回调事件。

    重要

    需要在入会前设置监听,否则可能丢失部分RTM智能体事件回调。

  • sendGreetingReady: 发送greetingready消息。

     public abstract int sendGreetingReady (String sessionId, String agentId)

    参数

    类型

    描述

    sessionId

    String

    SessionID。

    agentId

    String

    智能体用户ID。

    返回说明

    • RtmErrorCode
    • 0:成功;
    • <0:失败。
    重要

    需要在 onAgentUserReady 后调用。

  • sendInterrupt: 发送interrupt消息。

     public abstract int sendInterrupt (String sessionId, String agentId)

    参数

    类型

    描述

    sessionId

    String

    SessionID。

    agentId

    String

    智能体用户ID。

    返回说明

    • RtmErrorCode
    • 0:成功;
    • <0:失败。
    重要

    需要在 onAgentUserReady 后调用, 仅支持在自然对话模式下调用。

  • sendPushToTalk: 发送对讲机模式命令。

     public abstract int sendPushToTalk (String sessionId, String agentId, AgentPushToTalkCmd cmd)

    参数

    类型

    描述

    sessionId

    String

    SessionID。

    agentId

    String

    智能体用户ID。

    cmd

    AgentPushToTalkCmd

    对讲机模式命令。

    返回说明

    • RtmErrorCode
    • 0:成功;
    • <0:失败。
    重要

    需要在 onAgentUserReady 后调用, 仅支持在对讲机对话模式下调用。