koishi-plugin-best-cave 2.7.21 → 2.7.22

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 +3 -3
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -1349,13 +1349,13 @@ ${combinedText}` }, ...images];
1349
1349
  const content = response?.choices?.[0]?.message?.content;
1350
1350
  if (typeof content !== "string" || !content.trim()) throw new Error();
1351
1351
  try {
1352
- const jsonRegex = /```json\s*([\s\S]*?)\s*```/;
1352
+ const jsonRegex = /```json\s*([\s\S]*?)\s*```/i;
1353
1353
  const match = content.match(jsonRegex);
1354
1354
  const jsonString = match && match[1] ? match[1] : content;
1355
1355
  return JSON.parse(jsonString);
1356
1356
  } catch (error) {
1357
- this.logger.error("解析 AI 响应 JSON 失败:", error, "原始响应:", JSON.stringify(response, null, 2), "内容:", content);
1358
- throw new error();
1357
+ this.logger.error("解析失败:", error, "原始响应:", JSON.stringify(response, null, 2));
1358
+ throw error;
1359
1359
  }
1360
1360
  }
1361
1361
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-best-cave",
3
3
  "description": "功能强大、高度可定制的回声洞插件。支持丰富的媒体类型、内容查重、AI分析、人工审核、用户昵称、数据迁移以及本地/S3 双重文件存储后端。",
4
- "version": "2.7.21",
4
+ "version": "2.7.22",
5
5
  "contributors": [
6
6
  "Yis_Rime <yis_rime@outlook.com>"
7
7
  ],