Skip to content

Commit

Permalink
Release 0.0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinlic committed Apr 5, 2024
1 parent 46dfdb4 commit b16669d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "step-free-api",
"version": "0.0.11",
"version": "0.0.12",
"description": "Stepchat Free API Server",
"type": "module",
"main": "dist/index.js",
Expand Down
6 changes: 3 additions & 3 deletions src/api/controllers/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,13 @@ function messagesPrepare(convId: string, messages: any[], refs: any[]) {
if (_.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"}:${message.content}`);
return (content += `${message.role || "user"}:${message.content}\n`);
}, "") + 'assistant:';

logger.info("\n对话合并:" + content);
logger.info("\n对话合并:\n" + content);
const json = JSON.stringify({
chatId: convId,
messageInfo: {
Expand Down

0 comments on commit b16669d

Please sign in to comment.