From 11f98b4bc67107a5f5556d8df1ae39dd612acbaf Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Sun, 6 Apr 2025 14:23:20 +0800 Subject: [PATCH] save --- app/src/components/main-panel/chat/index.vue | 281 ++++++++++--------- test/src/controller/llm.ts | 2 +- test/tabs.json | 9 + 3 files changed, 156 insertions(+), 136 deletions(-) diff --git a/app/src/components/main-panel/chat/index.vue b/app/src/components/main-panel/chat/index.vue index ea0ec9f..c82100b 100644 --- a/app/src/components/main-panel/chat/index.vue +++ b/app/src/components/main-panel/chat/index.vue @@ -1,63 +1,59 @@ - - - - AI 对话 - + + + + + + + + + {{ message.role === 'user' ? '你' : 'AI' }} + {{ message.content }} + + - - - - - - - - {{ message.role === 'user' ? '你' : 'AI' }} - {{ message.content }} - - + + + + + + AI + {{ streamingContent }}| + + + + - - - - - - AI - {{ streamingContent }}| - - - - - - - - - - 发送 - - - - - + + + + + 发送 + + + + \ No newline at end of file diff --git a/test/src/controller/llm.ts b/test/src/controller/llm.ts index d7b17c6..a8ebb1b 100644 --- a/test/src/controller/llm.ts +++ b/test/src/controller/llm.ts @@ -58,7 +58,7 @@ export async function chatCompletionHandler(client: MCPClient | undefined, data: } catch (error) { webview.postMessage({ - command: 'llm/chat/completions/error', + command: 'llm/chat/completions/chunk', data: { code: 500, msg: `OpenAI API error: ${(error as Error).message}` diff --git a/test/tabs.json b/test/tabs.json index 2a00242..3294cfb 100644 --- a/test/tabs.json +++ b/test/tabs.json @@ -7,6 +7,15 @@ "type": "blank", "componentIndex": 3, "storage": {} + }, + { + "name": "资源", + "icon": "icon-file", + "type": "blank", + "componentIndex": 0, + "storage": { + "currentResourceName": "greeting" + } } ] } \ No newline at end of file