fix(manager): align frontend and backend field contracts

This commit is contained in:
Tyke Chen
2026-07-24 10:21:05 +08:00
parent 27e57631a7
commit 18e5c47a06
20 changed files with 455 additions and 64 deletions
+16 -2
View File
@@ -8,6 +8,7 @@ import type {
ModelOption,
PageData,
RoleTemplate,
TtsVoice,
} from './types'
import { http } from '@/http/request/alova'
@@ -89,7 +90,7 @@ export function deleteAgent(id: string) {
// 获取TTS音色列表
export function getTTSVoices(ttsModelId: string, voiceName: string = '') {
return http.Get<{ id: string, name: string }[]>(`/models/${ttsModelId}/voices`, {
return http.Get<TtsVoice[]>(`/models/${ttsModelId}/voices`, {
params: {
voiceName,
},
@@ -214,7 +215,7 @@ export function updateAgentTags(agentId: string, data) {
// 获取所有语言
export function getAllLanguage(modelId: string) {
return http.Get<{ id: string, name: string, languages: string }[]>(`/models/${modelId}/voices`, {
return http.Get<TtsVoice[]>(`/models/${modelId}/voices`, {
meta: {
ignoreAuth: false,
toast: false,
@@ -225,6 +226,19 @@ export function getAllLanguage(modelId: string) {
})
}
/**
* 获取克隆音色的临时播放ID
* @param cloneId 克隆音色记录ID
*/
export function getVoiceCloneAudioId(cloneId: string) {
return http.Post<string>(`/voiceClone/audio/${cloneId}`, {}, {
meta: {
ignoreAuth: false,
toast: false,
},
})
}
// 获取智能体历史版本列表
export function getAgentSnapshots(agentId: string, params: AgentSnapshotPageParams) {
return http.Get<PageData<AgentSnapshot>>(`/agent/${agentId}/snapshots`, {