关于 voice-assist
面向 ServiceNow 团队的配置技能,涵盖语音 Virtual Agent 主题、语音处理、NLU 和电话流程,适用于构建语音自助服务与服务台交互,并提供从设置到监控和排障的指导。
主要功能
- 01配置兼容语音的 Virtual Agent 主题
- 02设置 STT 和 TTS 属性
- 03训练语音输入的 NLU 意图
- 04设计带 DTMF 回退的流程
- 05查看交互记录与分析
适用场景
- 01部署语音 IT 服务台
- 02将 Virtual Agent 主题扩展到语音
- 03配置 IVR 自助服务流程
- 04监控语音交互记录
MCP 相关
说明如何使用 SN-Query-Table、SN-Create-Record 和 SN-Update-Record 等 ServiceNow MCP 工具配置主题、意图、属性和交互记录。
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ happy-technologies-llc/ happy-platform-skills --skill voice-assist安装后在 Claude Code 中输入/voice-assist确认已加载。
详细介绍
AI 语音 Agent 配置
概述
本技能介绍如何在 ServiceNow 中配置 AI 驱动的语音 Agent,以支持电话和语音交互。内容包括:
- 设置兼容语音渠道的 Virtual Agent 主题
- 配置语音转文本(STT)和文本转语音(TTS)引擎集成
- 使用 NLU 训练为语音输入设计意图识别模型
- 构建支持 DTMF 备用方案的语音专用对话流程
- 与 IVR 系统及电话服务提供商(Twilio、Genesys、Amazon Connect)集成
- 管理语音交互记录和分析
- 处理语音特有的挑战:噪声、口音、消歧和超时管理
适用场景:
- 部署支持语音的 IT 帮助台或 HR 服务中心时
- 设置基于 AI 自然语言理解的 IVR 自助服务时
- 扩展现有 Virtual Agent 主题以支持语音渠道时
- 为现场服务或免手操作场景构建语音优先的工作流时
- 配置语音身份验证和来电者验证时
前提条件
- 角色:
admin、sn_va.topic_admin、sn_cs.admin或sn_va.voice_admin - 插件:
com.glide.cs.chatbot(Virtual Agent)、com.sn_va.voice(Voice)、com.glide.interaction(Agent Workspace Interaction) - 访问权限: sys_cs_topic、interaction、sys_cs_intent、sys_properties 表
- 知识: 对话式 AI 设计原则、电话基础知识(SIP、DTMF),以及组织的 IVR 呼叫流程要求
- 集成: 已配置 ServiceNow 的电话服务提供商(Twilio、Genesys Cloud、Amazon Connect)
语音相关的关键表
| 表 | 用途 | 关键字段 |
|---|---|---|
sys_cs_topic | Virtual Agent 对话主题 | name, description, channel, state, nlu_intent, category, order |
interaction | 语音/聊天交互记录 | number, channel, state, opened_for, assignment_group, duration, disposition, recording_url |
sys_cs_topic_detail | 主题流程步骤定义 | topic, step_type, prompt_text, order, variable_name, next_step |
sys_cs_message | 对话消息 | interaction, message_type, body, direction, timestamp |
sys_cs_intent | NLU 意图定义 | name, description, model, training_phrases, confidence_threshold |
sys_cs_context | 对话上下文变量 | name, data_type, scope, default_value |
sys_properties | 系统配置属性 | name, value, description, type |
操作步骤
步骤 1:验证语音插件和电话配置
检查语音功能是否已启用并完成配置。
使用 MCP(Claude Code/Desktop):
Tool: SN-Query-Table
Parameters:
table_name: sys_properties
query: nameLIKEva.voice^ORnameLIKEcs.voice^ORnameLIKEtelephony
fields: name,value,description
limit: 30
使用 REST API:
GET /api/now/table/sys_properties?sysparm_query=nameLIKEva.voice^ORnameLIKEcs.voice^ORnameLIKEtelephony&sysparm_fields=name,value,description&sysparm_limit=30
步骤 2:配置语音转文本设置
设置用于处理语音输入的 STT 引擎属性。
使用 MCP:
Tool: SN-Update-Record
Parameters:
table_name: sys_properties
sys_id: [stt_property_sys_id]
data:
value: "google_cloud_speech"
需要配置的关键 STT 属性:
| 属性 | 用途 | 建议值 |
|---|---|---|
sn.va.voice.stt.provider | STT 引擎提供商 | google_cloud_speech, aws_transcribe, azure_speech |
sn.va.voice.stt.language | 主要识别语言 | en-US |
sn.va.voice.stt.model | 识别模型类型 | phone_call(针对电话通信优化) |
sn.va.voice.stt.profanity_filter | 过滤脏话 | true |
sn.va.voice.stt.interim_results | 启用部分结果 | true |
sn.va.voice.tts.provider | TTS 引擎提供商 | google_cloud_tts, aws_polly, azure_speech |
sn.va.voice.tts.voice | TTS 语音选择 | en-US-Neural2-C(自然语音) |
sn.va.voice.tts.speed | 语速 | 1.0(正常语速) |
步骤 3:创建支持语音的主题
构建针对语音交互优化的 Virtual Agent 主题。
使用 MCP:
Tool: SN-Create-Record
Parameters:
table_name: sys_cs_topic
fields:
name: "Password Reset - Voice"
description: "Voice-optimized password reset flow with caller verification and DTMF fallback"
channel: voice
state: draft
category: it_support
nlu_intent: password_reset
greeting_message: "I can help you reset your password. First, I need to verify your identity. Can you please tell me your employee ID?"
使用 REST API:
POST /api/now/table/sys_cs_topic
Content-Type: application/json
{
"name": "Password Reset - Voice",
"description": "Voice-optimized password reset flow with caller verification",
"channel": "voice",
"state": "draft",
"category": "it_support",
"nlu_intent": "password_reset"
}
步骤 4:设计语音对话流程步骤
为语音对话添加主题详情步骤。
使用 MCP:
Tool: SN-Create-Record
Parameters:
table_name: sys_cs_topic_detail
fields:
topic: [topic_sys_id]
step_type: user_input
prompt_text: "Please say or enter your employee ID number."
order: 100
variable_name: employee_id
input_type: alphanumeric
dtmf_enabled: true
timeout_seconds: 10
retry_count: 3
retry_prompt: "I did not catch that. Please say your employee ID again, or press the numbers on your phone keypad."
no_input_prompt: "Are you still there? Please say your employee ID to continue."
添加验证步骤:
Tool: SN-Create-Record
Parameters:
table_name: sys_cs_topic_detail
fields:
topic: [topic_sys_id]
step_type: script_action
order: 200
script: |
var user = new GlideRecord('sys_user');
user.addQuery('employee_number', vaInputs.employee_id);
user.query();
if (user.next()) {
vaVars.user_sys_id = user.sys_id.toString();
vaVars.user_name = user.name.toString();
vaVars.verified = true;
} else {
vaVars.verified = false;
}
next_step_success: 300
next_step_failure: 250
添加确认提示:
Tool: SN-Create-Record
Parameters:
table_name: sys_cs_topic_detail
fields:
topic: [topic_sys_id]
step_type: user_input
prompt_text: "I found your account. Just to confirm, is your name {user_name}? Please say yes or no."
order: 300
variable_name: name_confirmed
input_type: boolean
dtmf_mapping: "1=yes,2=no"
步骤 5:配置语音 NLU 意图
训练 NLU 模型,使其能够识别语音专属话语。
使用 MCP:
Tool: SN-Create-Record
Parameters:
table_name: sys_cs_intent
fields:
name: password_reset
description: "Intent for password reset requests via voice channel"
model: default_nlu_model
confidence_threshold: 0.7
training_phrases: |
I need to reset my password
my password is not working
I forgot my password
can you help me change my password
I am locked out of my account
password expired
I cannot log in
reset password please
my password does not work anymore
I need a new password
help me with my password
account is locked
使用 REST API:
POST /api/now/table/sys_cs_intent
Content-Type: application/json
{
"name": "password_reset",
"description": "Intent for password reset requests via voice",
"confidence_threshold": "0.7",
"training_phrases": "I need to reset my password\nmy password is not working\nI forgot my password\ncan you help me change my password\nI am locked out"
}
步骤 6:设置 IVR 集成
配置电话服务提供商连接。
使用 MCP:
Tool: SN-Execute-Background-Script
Parameters:
script: |
// Configure Twilio integration properties
var props = {
'sn.va.voice.telephony.provider': 'twilio',
'sn.va.voice.telephony.account_sid': '[twilio_account_sid]',
'sn.va.voice.telephony.phone_number': '+18005551234',
'sn.va.voice.telephony.webhook_url': gs.getProperty('glide.servlet.uri') + 'api/sn_va/voice/webhook',
'sn.va.voice.telephony.recording_enabled': 'true',
'sn.va.voice.telephony.max_call_duration': '1800',
'sn.va.voice.telephony.transfer_number': '+18005555678'
};
for (var key in props) {
var prop = new GlideRecord('sys_properties');
prop.addQuery('name', key);
prop.query();
if (prop.next()) {
prop.value = props[key];
prop.update();
} else {
prop.initialize();
prop.name = key;
prop.value = props[key];
prop.description = 'Voice agent telephony configuration';
prop.insert();
}
}
gs.info('Telephony properties configured: ' + Object.keys(props).length + ' properties set.');
description: "Voice: Configure telephony provider integration properties"
步骤 7:监控语音交互
查询交互记录,获取语音渠道分析数据。
使用 MCP:
Tool: SN-Query-Table
Parameters:
table_name: interaction
query: channel=voice^ORDERBYDESCsys_created_on
fields: sys_id,number,channel,state,opened_for,assignment_group,duration,disposition,topic,sys_created_on,close_notes
limit: 50
生成语音分析数据:
Tool: SN-Execute-Background-Script
Parameters:
script: |
var analytics = {
period: 'Last 30 days',
total_calls: 0,
avg_duration_seconds: 0,
self_service_rate: 0,
transfer_rate: 0,
by_disposition: {},
by_topic: {},
avg_confidence: 0
};
var ga = new GlideAggregate('interaction');
ga.addQuery('channel', 'voice');
ga.addQuery('sys_created_on', '>=', gs.daysAgo(30));
ga.addAggregate('COUNT');
ga.addAggregate('AVG', 'duration');
ga.query();
if (ga.next()) {
analytics.total_calls = parseInt(ga.getAggregate('COUNT'));
analytics.avg_duration_seconds = Math.round(parseFloat(ga.getAggregate('AVG', 'duration')) || 0);
}
var resolved = new GlideAggregate('interaction');
resolved.addQuery('channel', 'voice');
resolved.addQuery('sys_created_on', '>=', gs.daysAgo(30));
resolved.addQuery('disposition', 'resolved');
resolved.addAggregate('COUNT');
resolved.query();
if (resolved.next() && analytics.total_calls > 0) {
analytics.self_service_rate = Math.round((parseInt(resolved.getAggregate('COUNT')) / analytics.total_calls) * 100);
}
gs.info('VOICE ANALYTICS:\n' + JSON.stringify(analytics, null, 2));
description: "Voice: Generate voice interaction analytics for the last 30 days"
工具用法
| 操作 | MCP 工具 | REST 端点 |
|---|---|---|
| 查询主题 | SN-Query-Table | GET /api/now/table/sys_cs_topic |
| 创建主题 | SN-Create-Record | POST /api/now/table/sys_cs_topic |
| 创建流程步骤 | SN-Create-Record | POST /api/now/table/sys_cs_topic_detail |
| 配置意图 | SN-Create-Record | POST /api/now/table/sys_cs_intent |
| 查询交互 | SN-Query-Table | GET /api/now/table/interaction |
| 设置属性 | SN-Execute-Background-Script | POST /api/now/table/sys_properties |
| 发现架构 | SN-Discover-Table-Schema | GET /api/now/table/sys_dictionary |
最佳实践
- 语音优先设计: 撰写适合听而非看的提示词;语音回复应控制在 30 个词以内
- DTMF 后备方案: 每个语音输入步骤都应提供按键输入作为后备方案
- 超时处理: 将超时设为 8-10 秒,并妥善重新提示;失败 3 次后提供转接 Agent 的选项
- 确认步骤: 执行操作前,务必确认关键输入(员工 ID、工单号)
- 插话支持: 启用插话功能,让来电者可以打断提示,从而加快熟练用户的流程
- 等待音乐/消息: 为 Agent 转接队列配置适当的等待体验
- 录音同意: 按司法管辖区要求实施通话录音同意提示
- 错误恢复: 设计每条对话路径,使其都能转接至人工 Agent;切勿让来电者陷入死胡同
- 口音适配: 使用经过多种口音训练的 STT 模型;考虑采用特定区域的语言模型
- 测试: 使用真实电话进行测试,而不只是文本模拟;背景噪声和音频质量差异很大
故障排除
语音识别准确率低
症状: STT 经常误识别来电者的语音
原因: 默认 STT 模型可能未针对电话音频质量(8 kHz 窄带)进行优化
解决方案: 将 STT 模型切换为 phone_call 或 telephony 变体。为公司专属术语添加自定义词汇。检查音频编解码器兼容性(推荐 G.711)。
来电者陷入循环
症状: 来电者反映系统反复询问相同的问题
原因: 主题流程步骤的重试逻辑缺少退出条件或最大重试次数后的转接设置
解决方案: 将所有输入步骤的 retry_count 最多设为 3。达到最大重试次数后,添加明确的“转接至 Agent”步骤。
语音主题未触发
症状: 通话已接通,但语音主题未启动
原因: 主题渠道筛选条件排除了语音,或者 NLU 置信度阈值过高
解决方案: 确认主题记录中设置了 channel=voice。将语音的 NLU 置信度阈值降至 0.6(语音识别会引入噪声)。
集成 Webhook 未收到来电
症状: 已配置电话服务提供商,但来电未到达 ServiceNow
原因: Webhook URL 不正确、防火墙阻止了入站流量,或 SSL 证书存在问题
解决方案: 确认 Webhook URL 与 {instance}/api/sn_va/voice/webhook 一致。检查网络 ACL 和证书有效性。使用服务提供商的 Webhook 验证工具进行测试。
示例
示例 1:IT 服务台语音 Agent
**场景:**部署语音 Agent,以处理常见的 IT 支持请求
要创建的主题:
- 密码重置(针对语音优化,并进行 MFA 验证)
- VPN 连接(通过是/否问题引导排查)
- 软件申请(收集软件名称和申请理由)
- 事件状态查询(通过工单编号或来电者 ID 查询)
- 转接 Agent(无缝交接并传递上下文)
交互示例:
- 来电者:“我需要重置密码。”
- Agent:“我可以帮您。出于安全考虑,我需要验证您的身份。请说出您的员工 ID。”
- 来电者:“一二三四五。”
- Agent:“谢谢。我找到了 John Smith 的账户。信息正确吗?”
- 来电者:“是的。”
- Agent:“密码重置链接已发送到您的注册邮箱。您应该会在 2 分钟内收到。还有什么我可以帮您的吗?”
示例 2:HR 福利语音自助服务
**场景:**配置语音 Agent,以解答福利登记相关问题
Tool: SN-Create-Record
Parameters:
table_name: sys_cs_topic
fields:
name: "Benefits Inquiry - Voice"
description: "Voice self-service for benefits plan information, enrollment status, and coverage details"
channel: voice
state: draft
category: hr_benefits
nlu_intent: benefits_inquiry
相关技能
genai/playbook-generation- 语音工作流的流程自动化genai/flow-generation- 用于语音触发自动化的 Flow Designercsm/chat-recommendation- 基于聊天的建议(可扩展至语音)hrsd/chat-reply-recommendation- 可适配语音的 HR 聊天回复admin/workflow-creation- 构建由语音交互触发的工作流