koishi-plugin-aka-ai-generator 0.2.3 → 0.2.5

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.
package/lib/index.d.ts CHANGED
@@ -5,8 +5,6 @@ export interface ModelMappingConfig {
5
5
  suffix: string;
6
6
  modelId: string;
7
7
  provider?: ImageProvider;
8
- promptSuffix?: string;
9
- description?: string;
10
8
  }
11
9
  export interface StyleConfig {
12
10
  commandName: string;
package/lib/index.js CHANGED
@@ -509,9 +509,17 @@ var GptGodProvider = class {
509
509
  }
510
510
  logger.error("GPTGod 图像编辑 API 调用失败", {
511
511
  message: error?.message || "未知错误",
512
+ name: error?.name,
512
513
  code: error?.code,
513
514
  status: error?.response?.status,
514
- data: error?.response?.data
515
+ statusText: error?.response?.statusText,
516
+ data: error?.response?.data,
517
+ stack: error?.stack,
518
+ cause: error?.cause,
519
+ // 如果是 axios 错误,通常会有 config 和 request 信息
520
+ url: error?.config?.url,
521
+ method: error?.config?.method,
522
+ headers: error?.config?.headers
515
523
  });
516
524
  if (error?.message?.includes("fetch") && error?.message?.includes(GPTGOD_DEFAULT_API_URL)) {
517
525
  throw new Error("图像处理失败:无法连接 GPTGod API 服务器,请稍后重试");
@@ -577,10 +585,8 @@ var Config = import_koishi.Schema.intersect([
577
585
  import_koishi.Schema.const("yunwu").description("云雾 Gemini 服务"),
578
586
  import_koishi.Schema.const("gptgod").description("GPTGod 服务")
579
587
  ]).description("可选:覆盖供应商"),
580
- modelId: import_koishi.Schema.string().required().description("触发该后缀时使用的模型 ID"),
581
- promptSuffix: import_koishi.Schema.string().role("textarea", { rows: 2 }).description("附加在风格 prompt 末尾的提示语"),
582
- description: import_koishi.Schema.string().description("该后缀的说明,方便记忆")
583
- })).role("table").default([]).description("根据 -后缀切换模型/供应商与附加 prompt"),
588
+ modelId: import_koishi.Schema.string().required().description("触发该后缀时使用的模型 ID")
589
+ })).role("table").default([]).description("根据 -后缀切换模型/供应商"),
584
590
  apiTimeout: import_koishi.Schema.number().default(120).description("API请求超时时间(秒)"),
585
591
  commandTimeout: import_koishi.Schema.number().default(180).description("命令执行总超时时间(秒)"),
586
592
  // 默认设置
@@ -1144,16 +1150,13 @@ ${infoParts.join("\n")}`;
1144
1150
  }
1145
1151
  const modifiers = parseStyleCommandModifiers(argv, img);
1146
1152
  const promptSegments = [style.prompt];
1147
- if (modifiers.modelMapping?.promptSuffix) {
1148
- promptSegments.push(modifiers.modelMapping.promptSuffix);
1149
- }
1150
1153
  if (modifiers.customAdditions?.length) {
1151
1154
  promptSegments.push(...modifiers.customAdditions);
1152
1155
  }
1153
1156
  if (modifiers.customPromptSuffix) {
1154
1157
  promptSegments.push(modifiers.customPromptSuffix);
1155
1158
  }
1156
- const mergedPrompt = promptSegments.filter(Boolean).join("\n\n");
1159
+ const mergedPrompt = promptSegments.filter(Boolean).join(" - ");
1157
1160
  const requestContext = {
1158
1161
  numImages: options?.num
1159
1162
  };
@@ -1169,7 +1172,7 @@ ${infoParts.join("\n")}`;
1169
1172
  }
1170
1173
  if (modifiers.modelMapping?.modelId) {
1171
1174
  displayInfo.modelId = modifiers.modelMapping.modelId;
1172
- displayInfo.modelDescription = modifiers.modelMapping.description || modifiers.modelMapping.suffix || modifiers.modelMapping.modelId;
1175
+ displayInfo.modelDescription = modifiers.modelMapping.suffix || modifiers.modelMapping.modelId;
1173
1176
  }
1174
1177
  return processImageWithTimeout(session, img, mergedPrompt, style.commandName, requestContext, displayInfo);
1175
1178
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-aka-ai-generator",
3
3
  "description": "自用AI生成插件(GPTGod & Yunwu)",
4
- "version": "0.2.3",
4
+ "version": "0.2.5",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [