跳转至

接口文档

1. 业务背景

针对坐席与用户的催收录音,基于规则+大模型的方式识别沟通内容是否触发高风险预警,通过将命中高风险的用户进行易诉处置,避免升级为重大投诉,从而降低业务客诉量。

2. 业务流程

flowchart LR
    A[通话结束生成录音] --> B[准实时/T+1离线的转写文本] --> C[调用模型接口] --> D[生成复核任务]

为了提高模型接口处理数据的并发能力,需要通话时长低于30秒或者无转写文本直接过滤掉,不请求到对应模型接口。

2. 接口地址

建议部署测试和生产的两套服务,以便正式上线前的联调。

3. 接口入参

参数 类型 是否必填 描述 示例
task_id str 任务ID 1234
cust_no str 客户编号 C202409170120616153570
call_id str 通话ID
call_time str 通话时间 2024-09-17 10:20:30
call_duration int 通话时长 60
dialog list[SentenceInfo] 对话内容
time string 请求时间 2024-09-17 10:20:30

其中 SentenceInfo 定义如下:

参数 类型 是否必填 描述 示例
index int 句子索引 0
role string 角色: user/agent agent
text string 句子内容 你好
请求参数示例
{
    "cust_no": "C202409170120616153570",
    "sign_id":  "xxxx",
    "call_time": "2026-01-01 10:00:01.123",
    "duration": 40,
    "dialog": [
        {"index": 0, "role": "agent", "text": "xxxx"},
        {"index": 1, "role": "user", "text": "xxxx"},
        {"index": 2, "role": "agent", "text": "xxxx"}
    ],
    "time": "2026-05-01 10:00:01.123"
}

4. 接口出参

参数 类型 是否必填 描述 示例
task_id string 任务ID 1234
cust_no string 客户编号 C202409170120616153570
call_id string 通话ID
call_time string 通话时间 2024-09-17 10:20:30
call_duration int 通话时长 60
is_hit bool 是否命中高风险 false
result list[SceneResultInfo] 模型命中结果
time string 返回时间 2024-09-17 10:20:30

其中 SceneResultInfo 定义如下:

返回参数示例
{
    "cust_no": "C202409170120616153570",
    "call_id":  "xxxx",
    "call_time": "2026-01-01 10:00:01.123",
    "duration": "xxxx",
    "is_hit": true,
    "result": [
        {
            "scene_id": "COMPLAINT_001",
            "intent": "complaint_nfra",
            "description": "监管投诉",
            "hit": true,
            "risk_level": "高", 
            "rule_details": [
                {"index": 1, "role": "user", "match_snippet": "监管投诉"},
            ]
        },
        {
            "scene_id": "COMPLAINT_002",
            "intent": "complaint_network",
            "description": "网络投诉",
            "hit": true,
            "risk_level": "高", 
            "rule_details": [
                {"index": 1, "role": "user", "match_snippet": "黑猫"}
            ]
        }
    ]
    "time": "2026-05-01 10:00:01.123"
}

5. 复核任务