Files
vue-pure-admin/src/views/chatai/components/Speech.vue
2025-03-11 09:45:03 +08:00

36 lines
726 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script setup lang="ts">
import "deep-chat";
import { ref, onMounted } from "vue";
const chatRef = ref();
onMounted(() => {
chatRef.value.demo = {
response: message => {
console.log(message);
return {
text: "仅演示如需AI服务请参考 https://deepchat.dev/docs/connect"
};
}
};
});
</script>
<template>
<deep-chat
ref="chatRef"
style="border-radius: 8px"
:speechToText="{
webSpeech: { language: 'zh-CN' },
button: { position: 'outside-left' }
}"
:textInput="{
placeholder: { text: '发送消息' }
}"
:introMessage="{
text: '单击左下角麦克风开始转录您的讲话。'
}"
:demo="true"
/>
</template>