From 66cddd522be95c01d1311e894e03084a93eae1d6 Mon Sep 17 00:00:00 2001 From: Vinlic Date: Tue, 2 Apr 2024 23:27:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E5=92=8C=E6=B3=A8=E6=84=8F=E5=8A=9B=E6=B3=A8=E5=85=A5?= =?UTF-8?q?prompt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/controllers/chat.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/api/controllers/chat.ts b/src/api/controllers/chat.ts index 44045fb..5f75755 100644 --- a/src/api/controllers/chat.ts +++ b/src/api/controllers/chat.ts @@ -383,18 +383,18 @@ function messagesPrepare(messages: any[]) { && latestMessage.content.some(v => (typeof v === 'object' && ['file', 'image_url'].includes(v['type']))); if (hasFileOrImage) { let newFileMessage = { - "content": "关注用户最新发送文件和消息结尾", + "content": "关注用户最新发送的文件和消息", "role": "system" }; validMessages.splice(validMessages.length - 1, 0, newFileMessage); - logger.info("检查注入文件消息"); + logger.info("注入提升尾部文件注意力system prompt"); } else { let newTextMessage = { - "content": "关注用户消息的结尾", + "content": "关注用户最新的消息", "role": "system" }; validMessages.splice(validMessages.length - 1, 0, newTextMessage); - logger.info("检查注入文本消息"); + logger.info("注入提升尾部消息注意力system prompt"); } const content = validMessages.reduce((content, message) => { @@ -408,7 +408,7 @@ function messagesPrepare(messages: any[]) { return content += `${message.role || 'user'}:${wrapUrlsToTags(message.content)}\n`; }, ''); - logger.info("上传消息:" + content); + logger.info("\n对话合并:\n" + content); return [ { role: 'user', content } ]