|
@@ -36,15 +36,12 @@
|
|
|
</div>
|
|
|
<div class="box adfacjb">
|
|
|
<div class="title">声音<span>*</span></div>
|
|
|
- <div class="right adfac" @tap="show=true">
|
|
|
+ <div class="right adfac" @tap="selectVoice">
|
|
|
<div class="mtext" :class="{'active':voiceText!=='请选择音色'}">{{voiceText}}</div>
|
|
|
<image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/05/29/8feb394d-d9f6-4162-9f50-0e79fcf0864b.png"></image>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="zt_btn" @tap="comfirmSure">{{agentId?'编辑角色':'创建角色'}}</div>
|
|
|
- <u-picker :itemHeight="88" title="角色音色" :show="show" :columns="voiceList" keyName="name"
|
|
|
- @cancel="show=false" @confirm="confirm" :immediateChange="true" style="height: 500rpx;">
|
|
|
- </u-picker>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -58,7 +55,6 @@
|
|
|
title:'创建角色',
|
|
|
voiceText:'请选择音色',
|
|
|
fileList:[],
|
|
|
- show:false,
|
|
|
voiceList:[],
|
|
|
modelMap:new Map(),
|
|
|
agentId:'',
|
|
@@ -173,6 +169,17 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ selectVoice(){
|
|
|
+ uni.navigateTo({
|
|
|
+ url:'/pagesRole/voice',
|
|
|
+ events:{
|
|
|
+ selectVoice:data=>{
|
|
|
+ this.agentDto.ttsVoiceId = data.id;
|
|
|
+ this.voiceText = data.name;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
getModelVoiceList(){
|
|
|
this.$api.get(`/models/${'TTS_EdgeTTS'}/voices`).then(res=>{
|
|
|
if(res.data.code!==0) return this.$showToast(res.data.msg)
|
|
@@ -180,11 +187,6 @@
|
|
|
this.voiceText = res.data.data.find(v=>v.id===this.agentDto.ttsVoiceId)?.name||'请选择音色';
|
|
|
})
|
|
|
},
|
|
|
- confirm(e){
|
|
|
- this.show = false;
|
|
|
- this.agentDto.ttsVoiceId = e.value[0].id;
|
|
|
- this.voiceText = e.value[0].name;
|
|
|
- },
|
|
|
comfirmSure(){
|
|
|
if(this.fileList.length===0) return this.$showToast('请上传角色头像')
|
|
|
if(!this.agentDto.agentName) return this.$showToast('请输入角色昵称')
|
|
@@ -202,6 +204,7 @@
|
|
|
dto.chatHistoryConf = 1;
|
|
|
dto.langCode = 'zh';
|
|
|
dto.language = '中文';
|
|
|
+ dto.vllmModelId = 'VLLM_ChatGLMVLLM';
|
|
|
if(this.fileList.length) dto.avatar = this.fileList[0].url;
|
|
|
this.$api.post(this.agentId?`/agent/update/${this.agentId}`:'/agent',dto).then(res=>{
|
|
|
if(res.data.code!==0) return this.$showToast(res.data.msg)
|