mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-31 00:03:55 +08:00
update:调整文件夹
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
import type {
|
||||
ChatHistory,
|
||||
CreateSpeakerData,
|
||||
VoicePrint,
|
||||
} from './types'
|
||||
import { http } from '@/http/request/alova'
|
||||
|
||||
// 获取声纹列表
|
||||
export function getVoicePrintList(agentId: string) {
|
||||
return http.Get<VoicePrint[]>(`/agent/voice-print/list/${agentId}`, {
|
||||
meta: {
|
||||
ignoreAuth: false,
|
||||
toast: false,
|
||||
},
|
||||
cacheFor: {
|
||||
expire: 0,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 获取语音对话记录(用于选择声纹向量)
|
||||
export function getChatHistory(agentId: string) {
|
||||
return http.Get<ChatHistory[]>(`/agent/${agentId}/chat-history/user`, {
|
||||
meta: {
|
||||
ignoreAuth: false,
|
||||
toast: false,
|
||||
},
|
||||
cacheFor: {
|
||||
expire: 0,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 新增说话人
|
||||
export function createVoicePrint(data: CreateSpeakerData) {
|
||||
return http.Post<null>('/agent/voice-print', data, {
|
||||
meta: {
|
||||
ignoreAuth: false,
|
||||
toast: true,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 删除声纹
|
||||
export function deleteVoicePrint(id: string) {
|
||||
return http.Delete<null>(`/agent/voice-print/${id}`, {
|
||||
meta: {
|
||||
ignoreAuth: false,
|
||||
toast: true,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 更新声纹信息
|
||||
export function updateVoicePrint(data: VoicePrint) {
|
||||
return http.Put<null>('/agent/voice-print', data, {
|
||||
meta: {
|
||||
ignoreAuth: false,
|
||||
toast: true,
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user