|
@@ -6,7 +6,7 @@ import placeImg from './place.png'
|
|
|
import { TTSRecorder } from './sdk/chat'
|
|
|
import { audioPlayer, connectTtsWS } from './sdk/tts'
|
|
|
import { connectIatWS, iatStatus, recorder } from './sdk/iat'
|
|
|
-import { qa_audio, qa_text } from './qa.ts'
|
|
|
+import { qa_audio, qa_text } from './qa'
|
|
|
// const anim = ref(null)
|
|
|
|
|
|
// onMounted(() => {
|
|
@@ -21,7 +21,9 @@ import { qa_audio, qa_text } from './qa.ts'
|
|
|
|
|
|
const isWorking = ref(false)
|
|
|
|
|
|
-const bigModel = $ref(new TTSRecorder())
|
|
|
+const modelVersion = ref('3.1')
|
|
|
+
|
|
|
+let bigModel = $ref(new TTSRecorder({ version: modelVersion.value }))
|
|
|
|
|
|
const videoRef = ref<HTMLVideoElement>()
|
|
|
const videoLoaded = ref(false)
|
|
@@ -203,6 +205,11 @@ function handleStartIat() {
|
|
|
recorder.stop()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+function handleChangeTab() {
|
|
|
+ bigModel.ttsWS?.close()
|
|
|
+ bigModel = new TTSRecorder({ version: modelVersion.value })
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -225,6 +232,10 @@ function handleStartIat() {
|
|
|
/>
|
|
|
</div>
|
|
|
<div class="w-440px flex flex-col justify-between rounded bg-white px-10px py-10px">
|
|
|
+ <el-tabs v-model="modelVersion" stretch @tab-change="handleChangeTab">
|
|
|
+ <el-tab-pane label="5.0" name="3.1" />
|
|
|
+ <el-tab-pane label="6.0" name="3.5" />
|
|
|
+ </el-tabs>
|
|
|
<el-scrollbar ref="scrollbarRef" height="680px" class="px-14px">
|
|
|
<div class="flex flex-col gap-4">
|
|
|
<div class="rounded-4px bg-hex-f0f0f0 p-14px text-gray-500">
|
|
@@ -250,26 +261,18 @@ function handleStartIat() {
|
|
|
>
|
|
|
<Microphone class="h-20px w-20px" />
|
|
|
</div> -->
|
|
|
- <el-tooltip
|
|
|
- class=""
|
|
|
- effect="dark"
|
|
|
- content="一次语音识别时长不能超过60秒"
|
|
|
- placement="top-start"
|
|
|
- >
|
|
|
+ <el-tooltip class="" effect="dark" content="一次语音识别时长不能超过60秒" placement="top-start">
|
|
|
<el-button
|
|
|
- :icon="Microphone" circle :color="(iatStatus === 'UNDEFINED' || iatStatus === 'CLOSED') ? '#626aef' : '#f56c6c'"
|
|
|
- :disabled="isWorking" style="--color: #fff;"
|
|
|
- @click="handleStartIat"
|
|
|
+ :icon="Microphone" circle
|
|
|
+ :color="(iatStatus === 'UNDEFINED' || iatStatus === 'CLOSED') ? '#626aef' : '#f56c6c'"
|
|
|
+ :disabled="isWorking" style="--color: #fff;" @click="handleStartIat"
|
|
|
/>
|
|
|
</el-tooltip>
|
|
|
<el-input
|
|
|
v-model="questionInput" size="large" type="textarea" placeholder="请输入您的问题"
|
|
|
:autosize="{ minRows: 1, maxRows: 4 }"
|
|
|
/>
|
|
|
- <el-button
|
|
|
- color="#626aef" :disabled="isWorking"
|
|
|
- @click="handleSendMessage(questionInput, true)"
|
|
|
- >
|
|
|
+ <el-button color="#626aef" :disabled="isWorking" @click="handleSendMessage(questionInput, true)">
|
|
|
发送
|
|
|
</el-button>
|
|
|
</div>
|