【增加】对话 modal 拉取

This commit is contained in:
cherishsince 2024-05-14 13:43:56 +08:00
parent 20b7403a6a
commit 27569a746e

View File

@ -67,9 +67,19 @@
标题......
</div>
<div>
<el-button>3.5-turbo-0125
<Icon icon="ep:setting"/>
<!-- <el-button>3.5-turbo-0125-->
<!-- <Icon icon="ep:setting"/>-->
<!-- </el-button>-->
<el-dropdown style="margin-right: 12px;" @command="modalClick" >
<el-button type="primary">
GPT3.5 <Icon icon="ep:setting" style="margin-left: 10px;"/>
</el-button>
<template #dropdown>
<el-dropdown-menu v-for="(item, index) in modalList" :key="index" >
<el-dropdown-item :command="item.model" >{{item.model}}</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
<el-button>
<Icon icon="ep:user"/>
</el-button>
@ -166,6 +176,7 @@
<script setup lang="ts">
import {ChatMessageApi, ChatMessageSendVO, ChatMessageVO} from "@/api/ai/chat/message"
import {ChatModelApi, ChatModelVO } from "@/api/ai/model/chatModel"
import {formatDate} from "@/utils/formatTime"
import {useClipboard} from "@vueuse/core";
// markdown
@ -219,6 +230,8 @@ const isScrolling = ref(false)//用于判断用户是否在滚动
/** chat message 列表 */
// defineOptions({ name: 'chatMessageList' })
const list = ref<ChatMessageVO[]>([]) //
const modalList = ref<ChatModelVO[]>([]) //
const changeConversation = (conversation) => {
console.log(conversation)
@ -392,8 +405,19 @@ const stopStream = async () => {
conversationInProgress.value = false
}
const modalClick = async (command) => {
console.log('22', command)
}
const getModalList = async () => {
// as unknown as ChatModelVO
modalList.value = await ChatModelApi.getChatModelSimpleList(0) as unknown as ChatModelVO[]
}
/** 初始化 **/
onMounted(async () => {
//
getModalList();
//
messageList();
// scrollToBottom();
@ -411,13 +435,6 @@ onMounted(async () => {
})
}
})
// marked.use({
// async: false,
// pedantic: false,
// gfm: true,
// tokenizer: new Tokenizer(),
// renderer: renderer,
// });
})