【增加】对话 modal 拉取
This commit is contained in:
parent
20b7403a6a
commit
27569a746e
@ -67,9 +67,19 @@
|
|||||||
标题......
|
标题......
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button>3.5-turbo-0125
|
<!-- <el-button>3.5-turbo-0125-->
|
||||||
<Icon icon="ep:setting"/>
|
<!-- <Icon icon="ep:setting"/>-->
|
||||||
</el-button>
|
<!-- </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>
|
<el-button>
|
||||||
<Icon icon="ep:user"/>
|
<Icon icon="ep:user"/>
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -166,6 +176,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {ChatMessageApi, ChatMessageSendVO, ChatMessageVO} from "@/api/ai/chat/message"
|
import {ChatMessageApi, ChatMessageSendVO, ChatMessageVO} from "@/api/ai/chat/message"
|
||||||
|
import {ChatModelApi, ChatModelVO } from "@/api/ai/model/chatModel"
|
||||||
import {formatDate} from "@/utils/formatTime"
|
import {formatDate} from "@/utils/formatTime"
|
||||||
import {useClipboard} from "@vueuse/core";
|
import {useClipboard} from "@vueuse/core";
|
||||||
// 转换 markdown
|
// 转换 markdown
|
||||||
@ -219,6 +230,8 @@ const isScrolling = ref(false)//用于判断用户是否在滚动
|
|||||||
/** chat message 列表 */
|
/** chat message 列表 */
|
||||||
// defineOptions({ name: 'chatMessageList' })
|
// defineOptions({ name: 'chatMessageList' })
|
||||||
const list = ref<ChatMessageVO[]>([]) // 列表的数据
|
const list = ref<ChatMessageVO[]>([]) // 列表的数据
|
||||||
|
const modalList = ref<ChatModelVO[]>([]) // 列表的数据
|
||||||
|
|
||||||
|
|
||||||
const changeConversation = (conversation) => {
|
const changeConversation = (conversation) => {
|
||||||
console.log(conversation)
|
console.log(conversation)
|
||||||
@ -392,8 +405,19 @@ const stopStream = async () => {
|
|||||||
conversationInProgress.value = false
|
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 () => {
|
onMounted(async () => {
|
||||||
|
// 获取模型
|
||||||
|
getModalList();
|
||||||
// 获取列表数据
|
// 获取列表数据
|
||||||
messageList();
|
messageList();
|
||||||
// scrollToBottom();
|
// scrollToBottom();
|
||||||
@ -411,13 +435,6 @@ onMounted(async () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// marked.use({
|
|
||||||
// async: false,
|
|
||||||
// pedantic: false,
|
|
||||||
// gfm: true,
|
|
||||||
// tokenizer: new Tokenizer(),
|
|
||||||
// renderer: renderer,
|
|
||||||
// });
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user