POST
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| question | 是 | string | 对方(债务人或其亲属等)说的话 1、max-lenght:300字 |
| userProp | 是 | object | 用户参数 |
| chatHistory | 是 | array | 历史聊天记录 1、暂时先传历史2轮记录,后期可调整; 2、需要传递客服实际回复的内容。 |
| questionRole | 是 | string | 对方角色(债务人或其亲属、朋友等) |
| answerRole | 是 | string | 客服角色(如调解专员) |
| employeeId | 否 | string | 员工编号(如”160101“,用于调用私有话术库。不传则默认线上话术库) |
| process | 否 | DesideProcess | 当前流程 |
| isSingleQuestion | 否 | boolean | 为true时,不会带历史聊天记录(不带上下文) 注意:默认聊天场景不用带上该参数 |
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| userName | 是 | string | 债务人称呼 |
| delayDays | 是 | number | 逾期天数 |
| debt | 是 | number | 债务金额 |
| proxyName | 否 | string | 委托授权方,也叫项目(不传则不过滤该参数) |
| product | 否 | string | 产品名称(不传则不过滤该参数) |
| interest | 否 | number | 利息 |
| rates | 否 | number | 利息可减免比例 |
| character | 否 | string | 债务人性格 |
| gender | 否 | string | 性别 |
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| processEnum | 是 | ProcessEnum | 决策流程Enum(如下定义) |
| count | 是 | number | 节点轮数 |
export enum ProcessEnum {
start=0, whyDebt=1, repayWilling=2, repayAbility=3, getResult=4
}
---流式文字
xconst postData = JSON.stringify({ "question": "喂,你好", "userProp": { "proxyName": "中国银行", "userName": "黄先生", "delayDays": 13, "debt": 123, "character": "ok", "gender": "男", }, "chatHistory": [{"question": "喂,哪位"}, {"answer": "您好,我是蚂蚁金服的调解专员,请问您是金先生吗?"}], "questionRole": "债务人", "answerRole": "调解专员", "process": { "processEnum":3, "count":0 }});
const options = { hostname: 'goo-ai.vip', path: '/api/docs', method: 'POST', headers: { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(postData) }};
const req = http.request(options, res => { console.log('json', options); res.pipe(process.stdout);});
req.on('error', error => { console.error(error);});
const readable = new Readable();readable._read = () => {};readable.push(postData);readable.push(null);
readable.pipe(req);以流式文字形式输出回复