mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-23 07:33:53 +08:00
添加新接口方法
--agent.js 添加关于声纹和获取用户列表的接口 1.添加智能体的声纹 2.获取指定智能体声纹列表 3.删除智能体声纹 4.更新智能体声纹 5.获取指定智能体用户类型聊天记录
This commit is contained in:
@@ -173,4 +173,81 @@ export default {
|
||||
});
|
||||
}).send();
|
||||
},
|
||||
// 添加智能体的声纹
|
||||
addAgentVoicePrint(voicePrintData, callback) {
|
||||
RequestService.sendRequest()
|
||||
.url(`${getServiceUrl()}/agent/voice-print`)
|
||||
.method('POST')
|
||||
.data(voicePrintData)
|
||||
.success((res) => {
|
||||
RequestService.clearRequestTime();
|
||||
callback(res);
|
||||
})
|
||||
.networkFail(() => {
|
||||
RequestService.reAjaxFun(() => {
|
||||
this.addAgentVoicePrint(voicePrintData, callback);
|
||||
});
|
||||
}).send();
|
||||
},
|
||||
// 获取指定智能体声纹列表
|
||||
getAgentVoicePrintList(id,callback) {
|
||||
RequestService.sendRequest()
|
||||
.url(`${getServiceUrl()}/agent/voice-print/list/${id}`)
|
||||
.method('GET')
|
||||
.success((res) => {
|
||||
RequestService.clearRequestTime();
|
||||
callback(res);
|
||||
})
|
||||
.networkFail(() => {
|
||||
RequestService.reAjaxFun(() => {
|
||||
this.getAgentVoicePrintList(id,callback);
|
||||
});
|
||||
}).send();
|
||||
},
|
||||
// 删除智能体声纹
|
||||
deleteAgentVoicePrint(id, callback) {
|
||||
RequestService.sendRequest()
|
||||
.url(`${getServiceUrl()}/agent/voice-print/${id}`)
|
||||
.method('DELETE')
|
||||
.success((res) => {
|
||||
RequestService.clearRequestTime();
|
||||
callback(res);
|
||||
})
|
||||
.networkFail(() => {
|
||||
RequestService.reAjaxFun(() => {
|
||||
this.deleteAgentVoicePrint(id, callback);
|
||||
});
|
||||
}).send();
|
||||
},
|
||||
// 更新智能体声纹
|
||||
updateAgentVoicePrint(voicePrintData, callback) {
|
||||
RequestService.sendRequest()
|
||||
.url(`${getServiceUrl()}/agent/voice-print`)
|
||||
.method('PUT')
|
||||
.data(voicePrintData)
|
||||
.success((res) => {
|
||||
RequestService.clearRequestTime();
|
||||
callback(res);
|
||||
})
|
||||
.networkFail(() => {
|
||||
RequestService.reAjaxFun(() => {
|
||||
this.updateAgentVoicePrint(voicePrintData, callback);
|
||||
});
|
||||
}).send();
|
||||
},
|
||||
// 获取指定智能体用户类型聊天记录
|
||||
getRecentlyFiftyByAgentId(id,callback) {
|
||||
RequestService.sendRequest()
|
||||
.url(`${getServiceUrl()}/agent/${id}/chat-history/user`)
|
||||
.method('GET')
|
||||
.success((res) => {
|
||||
RequestService.clearRequestTime();
|
||||
callback(res);
|
||||
})
|
||||
.networkFail(() => {
|
||||
RequestService.reAjaxFun(() => {
|
||||
this.getRecentlyFiftyByAgentId(id,callback);
|
||||
});
|
||||
}).send();
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user