Release 0.0.21

This commit is contained in:
Vinlic 2024-04-06 00:16:18 +08:00
parent 462c64656e
commit 520f26f72f
2 changed files with 4 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "kimi-free-api", "name": "kimi-free-api",
"version": "0.0.20", "version": "0.0.21",
"description": "Kimi Free API Server", "description": "Kimi Free API Server",
"type": "module", "type": "module",
"main": "dist/index.js", "main": "dist/index.js",

View File

@ -386,13 +386,12 @@ function messagesPrepare(messages: any[]) {
if (Array.isArray(message.content)) { if (Array.isArray(message.content)) {
return message.content.reduce((_content, v) => { return message.content.reduce((_content, v) => {
if (!_.isObject(v) || v['type'] != 'text') return _content; 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); }, content);
} }
return content += `\n${message.role || 'user'}:${wrapUrlsToTags(message.content)}`; return content += `${message.role || 'user'}:${wrapUrlsToTags(message.content)}\n`;
}, ''); }, '');
logger.info("\n对话合并\n" + content);
logger.info("\n对话合并" + content);
return [ return [
{ role: 'user', content } { role: 'user', content }
] ]