系统工具

系统工具是内置工具,智能体可利用这些工具来执行常见任务。这些角色无法修改。

与其他工具类似,使用系统工具时,请提供智能体指令,说明何时使用该工具并提供工具参数。

customize_response

生成智能体语音回答,并能对各个形参进行精细控制,包括停用打断和 DTMF 形参。

参数:

参数值 必需/可选 说明 默认
内容 必填 代理回答的文本内容。
enable_dtmf 可选 是否启用键盘输入 (DTMF)。 由智能体应用设置决定
dtmf_endpointing_timeout_modes 可选 等待用户输入回复的时间,可从“短”“中”和“长”中选择。 "mid"
dtmf_finish_digit 可选 用于结束 DTMF 收集的 DTMF 数字。例如“#”。 空字符串
disable_barge_in 可选 不允许用户在代理说话时插话。 False

用于通过 DTMF 收集手机号码的示例指令,其中 DTMF 已明确启用,可能会覆盖代理应用设置:

make the tool call customize_response(content="Please type your phone number",
enable_dtmf=True,
dtmf_endpointing_timeout_modes='short')

或者,您可以将 enable_dtmf 显式设置为 False,也可以省略此参数并依赖于代理应用设置。

使用 DTMF 收集信用卡号的示例指令:

make the tool call customize_response(
content="Using your keypad, please enter your 16-digit credit card number, then press the pound key when you are finished.",
enable_dtmf=True,
dtmf_finish_digit='#',
dtmf_endpointing_timeout_modes='mid')

以下示例指令用于读取条款,同时不允许插话:

make the tool call customize_response(
content="By proceeding, you agree to the terms and condition...",
disable_barge_in=True)

end_session

结束会话。 此工具用于结束对话,以便在用户没有更多请求时转接给人工客服或结束会话。

如果会话因问题而结束,并且用户必须上报,请为 session_escalated 参数提供值 True。使用 params 实参将数据转发到最终回答的结束会话元数据中。

参数:

参数值 必需/可选 说明 默认
reason 必填 结束会话的原因。
session_escalated 可选 会话是否已上报给人工客服。 False
params 可选 要传递给结束会话处理程序的其他参数。 无

结束对话的指令示例:

If the user has no more questions execute the tool end_session(reason="success")

当用户想要人工客服时上报的示例指令:

If the user wants to talk to a human, execute the tool
end_session(reason="escalate_to_human", session_escalated=True)

用于检查用户输入语言的指令示例:

If the user speaks a language that is not English or Spanish, escalate by
calling: end_session(
reason='Encountered an unsupported language, escalating to a human agent.',
session_escalated=true).