mirror of
https://github.com/LLM-Red-Team/kimi-free-api.git
synced 2024-12-23 03:09:19 +08:00
Release 0.0.21
This commit is contained in:
parent
462c64656e
commit
520f26f72f
@ -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",
|
||||||
|
@ -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 }
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user