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 } ]