在现代呼叫中心中,AI 代理的引入正重塑客服模式。Microsoft 的 Call Center AI 项目提供了一个 API 驱动的电话代理解决方案,用户可以通过简单 POST 请求触发 AI 拨打指定号码,或配置专用号码让用户直拨 bot,实现全自动化对话处理。这种方法特别适用于保险、IT 支持和客户服务场景,能在几小时内定制 bot,处理低到中等复杂度的呼叫,支持 24/7 服务。
核心观点在于 API 的简洁性和实时性:无需复杂框架,直接用 curl 或 HTTP 客户端发起呼叫。举例,一个典型的 API 调用如下(基于项目示例):
curl \
--header 'Content-Type: application/json' \
--request POST \
--url https://your-domain/call \
--data '{
"bot_company": "Contoso",
"bot_name": "Amélie",
"phone_number": "+11234567890",
"task": "Help the customer with their digital workplace...",
"agent_phone_number": "+33612345678",
"claim": [
{"name": "hardware_info", "type": "text"},
{"name": "first_seen", "type": "datetime"},
{"name": "building_location", "type": "text"}
]
}'
这个请求会让 AI 代理立即拨打目标号码,开始流式对话。参数解释:bot_company和bot_name定义代理身份;phone_number为目标客户号码;task是英文任务描述,如 “帮助客户处理 IT 问题并收集 claim 信息”;claim是结构化数据 schema,支持 text、datetime、email、phone_number 类型,并可选添加 description 提示 LLM。证据显示,这种设计确保 bot 遵循任务,直至收集齐全数据,支持敏感信息讨论并生成 to-do 列表。
对于入站呼叫,用户拨打配置的 Azure Communication Services 号码,bot 自动接听。系统架构采用 Azure serverless 容器化部署,包括:Communication Services 处理呼叫 / SMS;Cognitive Services 的 STT(Speech-to-Text)和 TTS(Text-to-Speech)实现实时转录和语音合成;OpenAI GPT-4o-mini(快模型)和 GPT-4o(洞察模型)驱动对话,支持 RAG 检索内部文档;Cosmos DB 存储对话历史、claim 和 reminders;Redis 缓存优化效率;AI Search 提供向量检索。
实时对话的关键参数需工程化调优,以确保低延迟和高可用。推荐配置(基于项目 feature flags,在 App Configuration 中动态调整,每 60 秒刷新):
- 超时阈值:
answer_hard_timeout_sec=15(LLM 硬超时,避免挂起);answer_soft_timeout_sec=4(软超时,发送等待提示);phone_silence_timeout_sec=20(静默警告)。 - 语音活动检测(VAD):
vad_threshold=0.5(0.1-1 间,平衡灵敏度);vad_silence_timeout_ms=500;vad_cutoff_timeout_ms=250。 - STT 重试:
recognition_retry_max=3;recognition_stt_complete_timeout_ms=100。 - 回调与重连:
callback_timeout_hour=3(自动回拨);支持断线续传,历史对话从 DB 加载。 - 模型选择:默认 gpt-4o-mini(10-15x 成本效益高),fallback 到 gpt-4o;自定义 voice via Azure Custom Neural Voice。
落地清单:
- 前提资源:Azure 资源组、Communication Services(系统托管身份)、购买号码(支持 voice/SMS)。
- 配置 YAML:编辑
config.yaml,填入 endpoint、API key、语言(默认 fr-FR,支持多语如 zh-CN,voice=zh-CN-XiaoqiuNeural);自定义 prompts(TTS 用英文占位符,LLM system prompt 注入上下文)。 - 部署:
make deploy name=your-rg(用预建镜像 ghcr.io/clemlesne/call-center-ai:0.1.0);本地用make tunnel+uv 运行。 - RAG 集成:AI Search 索引自定义数据(字段:question/answer/context/vectors@1536),用 ADA embedding。
- 监控:Application Insights 追踪 latency、token、AEC(回声消除)指标,如
call.answer.latency;OpenLLMetry 记录 LLM spans。 - 安全:Content Safety 过滤(0-7 级);jailbreak 检测;录音可选(
recording_enabled=true,存 Azure Storage)。
成本控制至关重要。项目估算 1000 通 10 分钟呼叫每月约 720 USD,主要来自 Cosmos DB RU/s(233 USD)、Speech 服务(152 USD)和 Container Apps(160 USD)。优化策略:PTU(Provisioned Throughput Units)减 LLM 延迟一半;采样日志降 Monitor 成本;Basic AI Search(15GB/index)起步。
风险与回滚:作为 POC,生产需添测试、IaC 多区域、私网 vNET。限流用 Azure Front Door;回滚切 feature flags,如recording_enabled=false。引用项目文档:“Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!”
通过这些参数,Call Center AI 将 API 电话集成推向实用化,支持 claim 自动化填充(如事故描述、位置、保单号)和 reminders 生成。报告 API /report/{phone_number}提供对话合成、满意度分析。未来扩展 IVR、human fallback,进一步落地企业级呼叫中心。
(正文字数:1256)
资料来源: