From 1bfdcd0054e97e5fc39742ec9166e689e9fcbb66 Mon Sep 17 00:00:00 2001 From: Yurun Date: Sat, 16 Mar 2024 10:32:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8AI=E4=BF=A1=E6=81=AF=E4=B8=8A=E6=96=B9?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=A8=A1=E5=9E=8B=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/typings/chat.d.ts | 1 + web/src/views/chat/components/Message/index.vue | 4 ++++ web/src/views/chat/index.vue | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/web/src/typings/chat.d.ts b/web/src/typings/chat.d.ts index a79d862..c1baf47 100644 --- a/web/src/typings/chat.d.ts +++ b/web/src/typings/chat.d.ts @@ -9,6 +9,7 @@ declare namespace Chat { loading?: boolean conversationOptions?: ConversationRequest | null tokens?: number + model?: string } interface History { diff --git a/web/src/views/chat/components/Message/index.vue b/web/src/views/chat/components/Message/index.vue index 867d340..3225650 100644 --- a/web/src/views/chat/components/Message/index.vue +++ b/web/src/views/chat/components/Message/index.vue @@ -17,6 +17,7 @@ interface Props { loading?: boolean tokens?: number tokenPrefix?: string + model?: string } interface Emit { @@ -106,6 +107,9 @@ async function handleCopy() {

{{ (new Date((dateTime ?? 0) * 1000)).toLocaleString() }} + diff --git a/web/src/views/chat/index.vue b/web/src/views/chat/index.vue index 2643d4d..9ad09d0 100644 --- a/web/src/views/chat/index.vue +++ b/web/src/views/chat/index.vue @@ -245,6 +245,7 @@ async function fetchStream() { error: false, loading: true, tokens: data.message.tokens, + model: data.message.config.model ?? null, }, ) } @@ -468,6 +469,7 @@ async function handleMessageNextPage() { const response = await messageList(id, lastMessageId, messagePageSize) for (const item of response.list) { const resultItem: Chat.Chat = { ...item } + resultItem.model = item.config.model ?? null resultItem.inversion = item.role === 'user' chatStore.addChatByUuid(id, resultItem, 'unshift') lastMessageId = item.recordId @@ -520,6 +522,7 @@ onMounted(async () => { const result: Chat.Chat[] = [] for (const item of messageResponse.list) { const resultItem: Chat.Chat = { ...item } + resultItem.model = item.config.model ?? null resultItem.inversion = item.role === 'user' result.push(resultItem) lastMessageId = item.recordId @@ -602,6 +605,7 @@ onUnmounted(() => { :error="item.error" :loading="item.loading" :tokens="item.tokens" + :model="item.model" @delete="handleDelete(index)" />