From 520f26f72f8488d2536e4861b6f4d2fcff169286 Mon Sep 17 00:00:00 2001 From: Vinlic Date: Sat, 6 Apr 2024 00:16:18 +0800 Subject: [PATCH] Release 0.0.21 --- package.json | 2 +- src/api/controllers/chat.ts | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index cb2186c..f6353d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kimi-free-api", - "version": "0.0.20", + "version": "0.0.21", "description": "Kimi Free API Server", "type": "module", "main": "dist/index.js", diff --git a/src/api/controllers/chat.ts b/src/api/controllers/chat.ts index 9c37aaf..9098481 100644 --- a/src/api/controllers/chat.ts +++ b/src/api/controllers/chat.ts @@ -386,13 +386,12 @@ function messagesPrepare(messages: any[]) { if (Array.isArray(message.content)) { return message.content.reduce((_content, v) => { if (!_.isObject(v) || v['type'] != 'text') return _content; - return _content + `\n${message.role || "user"}:${v["text"] || ""}`; + return _content + `${message.role || "user"}:${v["text"] || ""}\n`; }, content); } - return content += `\n${message.role || 'user'}:${wrapUrlsToTags(message.content)}`; + return content += `${message.role || 'user'}:${wrapUrlsToTags(message.content)}\n`; }, ''); - - logger.info("\n对话合并:" + content); + logger.info("\n对话合并:\n" + content); return [ { role: 'user', content } ]