koishi-plugin-satori-ai 1.2.4 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +8 -4
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -490,7 +490,7 @@ var MemoryManager = class {
490
490
  this.updateChannelMemory(session, prompt, config, response.content);
491
491
  prompt = prompt.replace("我", session.username);
492
492
  const date = ` (对话日期和时间:${(/* @__PURE__ */ new Date()).toLocaleString()})`;
493
- const userFavourbility = await (await getUser(this.ctx, session.userId)).favorability;
493
+ const userFavourbility = (await getUser(this.ctx, session.userId)).favorability;
494
494
  if (this.shouldRemember(prompt, userFavourbility)) {
495
495
  await this.saveLongTermMemory(session, [{
496
496
  role: date,
@@ -1171,6 +1171,8 @@ var UserPortraitManager = class {
1171
1171
  5. 敏感点(明确表示反感的内容)
1172
1172
  6. 对AI的期望(从对话历史中推断)
1173
1173
  7. 其他你认为需要记录的信息(如有)
1174
+ 8. 用户希望记住的信息(如有)
1175
+ 9. 需要短期记忆的信息(如有)
1174
1176
 
1175
1177
  你与用户的关系:${level}
1176
1178
  历史画像:
@@ -1181,7 +1183,10 @@ ${history}
1181
1183
 
1182
1184
  注意事项:
1183
1185
  ·用户一定是人类,其他情况是角色扮演
1184
- ·需要综合历史画像和用户发言记录,避免重复信息或遗漏信息,并根据发言修正历史画像内容
1186
+ ·若有历史画像则需要根据发言修正历史画像内容,以发言为准
1187
+ ·及时删除历史画像中的错误信息
1188
+ ·尤其注意用户说“记住”的部分,可能是用户希望记录的信息
1189
+ ·历史画像中的需要短期记忆的信息不需要保留,只需要删除旧的添加新的
1185
1190
  ·基于事实推断,避免盲目相信或主观臆测
1186
1191
  ·使用简洁的条目式表达,但内容要全面
1187
1192
  ·保留不确定性的表述(如"可能"、"似乎"、"用户自称")
@@ -1203,7 +1208,6 @@ ${history}
1203
1208
  const userlevel = getFavorabilityLevel(user, this.getFavorabilityConfig());
1204
1209
  const messages = this.buildMessage(userlevel, dialogues.join("\n"), existing);
1205
1210
  logger5.info(`用户 ${user.userid} 画像生成中...`);
1206
- logger5.info(`${messages[0].content}`);
1207
1211
  try {
1208
1212
  const response = await apiClient.generateUserPortrait(user, messages);
1209
1213
  if (response && !response.error) {
@@ -1441,7 +1445,7 @@ var SAT = class extends Sat {
1441
1445
  }
1442
1446
  // 前置检查
1443
1447
  performPreChecks(session, prompt) {
1444
- if (prompt === "")
1448
+ if (!prompt || prompt.length == 0)
1445
1449
  return session.text("commands.sat.messages.no-prompt");
1446
1450
  if (prompt.length > this.config.max_tokens)
1447
1451
  return session.text("commands.sat.messages.tooLong");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-satori-ai",
3
3
  "description": "基于 Satori 适配器的智能对话插件,具备用户画像、长期记忆、常识管理和好感度系统",
4
- "version": "1.2.4",
4
+ "version": "1.2.6",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "types": "lib/index.d.ts",