koishi-plugin-aka-ai-generator 0.7.1 → 0.7.3

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
@@ -42,6 +42,9 @@ export interface Config {
42
42
  securityBlockWindow: number;
43
43
  securityBlockWarningThreshold: number;
44
44
  enableVideoGeneration: boolean;
45
+ videoProvider: 'yunwu';
46
+ videoApiKey: string;
47
+ videoApiBase: string;
45
48
  videoModelId: string;
46
49
  videoMaxWaitTime: number;
47
50
  videoCreditsMultiplier: number;
package/lib/index.js CHANGED
@@ -1653,9 +1653,14 @@ var Config = import_koishi2.Schema.intersect([
1653
1653
  prompts: import_koishi2.Schema.array(StyleItemSchema).role("table").default([]).description("属于该类型的 prompt 列表")
1654
1654
  })).role("table").default({}).description("按类型管理的 prompt 组,键名即为分组名称")
1655
1655
  }),
1656
- // 视频生成配置
1656
+ // 视频生成配置(独立于图像生成配置)
1657
1657
  import_koishi2.Schema.object({
1658
1658
  enableVideoGeneration: import_koishi2.Schema.boolean().default(false).description("启用图生成视频功能(消耗较大,需谨慎开启)"),
1659
+ videoProvider: import_koishi2.Schema.union([
1660
+ import_koishi2.Schema.const("yunwu").description("云雾服务")
1661
+ ]).default("yunwu").description("视频生成供应商(目前只支持云雾)"),
1662
+ videoApiKey: import_koishi2.Schema.string().description("视频生成 API 密钥(独立于图像生成配置)").role("secret").default(""),
1663
+ videoApiBase: import_koishi2.Schema.string().default("https://yunwu.ai").description("视频生成 API 地址"),
1659
1664
  videoModelId: import_koishi2.Schema.string().default("sora-2").description("视频生成模型ID (sora-2 或 sora-2-pro)"),
1660
1665
  videoMaxWaitTime: import_koishi2.Schema.number().default(300).min(60).max(600).description("视频生成最大等待时间(秒),超时后可异步查询"),
1661
1666
  videoCreditsMultiplier: import_koishi2.Schema.number().default(5).min(1).max(20).description("视频生成积分倍数(相对于图片生成,默认5倍)"),
@@ -1666,14 +1671,8 @@ var Config = import_koishi2.Schema.intersect([
1666
1671
  aspectRatio: import_koishi2.Schema.string().description("宽高比(如 16:9)")
1667
1672
  })).role("table").default([
1668
1673
  {
1669
- commandName: "慢动作视频",
1670
- prompt: "缓慢流畅的运镜,展现细节和质感",
1671
- duration: 25,
1672
- aspectRatio: "16:9"
1673
- },
1674
- {
1675
- commandName: "快节奏视频",
1676
- prompt: "快速动态的场景变化,充满活力",
1674
+ commandName: "变视频",
1675
+ prompt: "将该图片生成一段符合产品展现的流畅视频",
1677
1676
  duration: 15,
1678
1677
  aspectRatio: "16:9"
1679
1678
  }
@@ -1703,16 +1702,22 @@ function apply(ctx, config) {
1703
1702
  const modelMappingIndex = buildModelMappingIndex(config.modelMappings);
1704
1703
  let videoProvider = null;
1705
1704
  if (config.enableVideoGeneration) {
1706
- videoProvider = new YunwuVideoProvider({
1707
- apiKey: config.yunwuApiKey,
1708
- modelId: config.videoModelId,
1709
- apiBase: "https://yunwu.ai",
1710
- apiTimeout: config.apiTimeout,
1711
- logLevel: config.logLevel,
1712
- logger,
1713
- ctx
1714
- });
1715
- logger.info(`视频生成功能已启用 (模型: ${config.videoModelId})`);
1705
+ if (!config.videoApiKey) {
1706
+ logger.warn("视频生成功能已启用,但未配置视频 API 密钥,视频功能将不可用");
1707
+ } else if (config.videoProvider !== "yunwu") {
1708
+ logger.warn(`视频生成供应商 ${config.videoProvider} 暂不支持,仅支持 yunwu`);
1709
+ } else {
1710
+ videoProvider = new YunwuVideoProvider({
1711
+ apiKey: config.videoApiKey,
1712
+ modelId: config.videoModelId,
1713
+ apiBase: config.videoApiBase,
1714
+ apiTimeout: config.apiTimeout,
1715
+ logLevel: config.logLevel,
1716
+ logger,
1717
+ ctx
1718
+ });
1719
+ logger.info(`视频生成功能已启用 (供应商: ${config.videoProvider}, 模型: ${config.videoModelId}, API: ${config.videoApiBase})`);
1720
+ }
1716
1721
  }
1717
1722
  const styleDefinitions = collectStyleDefinitions();
1718
1723
  function collectStyleDefinitions() {
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.7.1",
4
+ "version": "0.7.3",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [