1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
| 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,
| },
| })
| }
|
| // 获取音频下载ID
| export function getAudioDownloadId(audioId: string) {
| return http.Post<string>(`/agent/audio/${audioId}`, {}, {
| meta: {
| ignoreAuth: false,
| toast: false,
| },
| })
| }
|
|