From 0acd0d9edea1ef6746e2244ceb720b26f49a34e8 Mon Sep 17 00:00:00 2001 From: ivamp Date: Fri, 27 Sep 2024 23:04:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E8=A6=86=E7=9B=96?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E9=BB=98=E8=AE=A4=20prompt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/chat/Chat.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/chat/Chat.vue b/src/components/chat/Chat.vue index 14c5d91..354e22b 100644 --- a/src/components/chat/Chat.vue +++ b/src/components/chat/Chat.vue @@ -30,7 +30,7 @@ :title="p.act" hoverable class="overflow-hidden cursor-pointer" - @click="updateInputContent(p.prompt)" + @click="overrideSystemPrompt = true;updateInputContent(p.prompt)" > {{ p.prompt }} @@ -270,6 +270,7 @@ const assistantStore = useAssistantStore(); const message = useMessage(); const showUploadModal = ref(false); +const overrideSystemPrompt = ref(false) const prompts: Ref = ref([]); prompts.value = awesomeChatGPTPrompts; @@ -452,6 +453,12 @@ async function sendMessage( name: text.slice(0, 10), }; + if (overrideSystemPrompt.value) { + postData.prompt = " "; + } + + overrideSystemPrompt.value = false + // 如果没有指定,则使用目前选择的助理来创建聊天 if (chatStore.currentAssistantId) { // 添加 assistant_id 到 postData