diff --git a/images/reasoning.png b/images/reasoning.png new file mode 100644 index 00000000..54522a06 Binary files /dev/null and b/images/reasoning.png differ diff --git a/web/src/components/ChatComponent.vue b/web/src/components/ChatComponent.vue index 6fb4e256..8e8197de 100644 --- a/web/src/components/ChatComponent.vue +++ b/web/src/components/ChatComponent.vue @@ -110,6 +110,24 @@ class="message-box" :class="message.role" > +
+ + + +

{{ message.reasoning_content }}

+
+
+

{{ message.text }}

@@ -117,9 +135,8 @@
正在检索……
-
正在思考…… {{ message.reasoning_content }}
@@ -170,6 +187,7 @@ import { GlobalOutlined, FileTextOutlined, RobotOutlined, + CaretRightOutlined, } from '@ant-design/icons-vue' import { onClickOutside } from '@vueuse/core' import { Marked } from 'marked'; @@ -324,6 +342,7 @@ const appendAiMessage = (text, refs=null) => { refs, status: "init", meta: {}, + showThinking: "show" }) scrollToBottom() } @@ -362,6 +381,11 @@ const updateMessage = (info) => { if (info.message !== null && info.message !== undefined) { msg.message = info.message; } + + if (info.showThinking !== null && info.showThinking !== undefined) { + msg.showThinking = info.showThinking; + } + scrollToBottom(); } catch (error) { console.error('Error updating message:', error); @@ -442,6 +466,7 @@ const fetchChatResponse = (user_input, cur_res_id) => { console.log("fetching refs") groupRefs(cur_res_id); } + updateMessage({showThinking: "no", id: cur_res_id}); isStreaming.value = false; if (conv.value.messages.length === 2) { renameTitle(); } return;