mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-30 05:13:59 +08:00
fix(manager): align frontend and backend field contracts
This commit is contained in:
@@ -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`, {
|
||||
|
||||
Reference in New Issue
Block a user