@maiyunnet/kebab 9.0.1 → 9.0.2

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/doc/kebab-rag.md CHANGED
@@ -1355,7 +1355,7 @@ index/variables/VER.md
1355
1355
 
1356
1356
  # Variable: VER
1357
1357
 
1358
- > `const` **VER**: `"9.0.1"` = `'9.0.1'`
1358
+ > `const` **VER**: `"9.0.2"` = `'9.0.2'`
1359
1359
 
1360
1360
  Defined in: [index.ts:10](https://github.com/maiyunnet/kebab/blob/master/index.ts#L10)
1361
1361
 
@@ -1402,7 +1402,7 @@ lib/ai/classes/Ai.md
1402
1402
 
1403
1403
  # Class: Ai
1404
1404
 
1405
- Defined in: [lib/ai.ts:58](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L58)
1405
+ Defined in: [lib/ai.ts:60](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L60)
1406
1406
 
1407
1407
  ## Constructors
1408
1408
 
@@ -1410,7 +1410,7 @@ Defined in: [lib/ai.ts:58](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1410
1410
 
1411
1411
  > **new Ai**(`ctrEtc`, `opt`): `Ai`
1412
1412
 
1413
- Defined in: [lib/ai.ts:71](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L71)
1413
+ Defined in: [lib/ai.ts:73](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L73)
1414
1414
 
1415
1415
  #### Parameters
1416
1416
 
@@ -1432,7 +1432,7 @@ Defined in: [lib/ai.ts:71](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1432
1432
 
1433
1433
  > `readonly` **link**: `OpenAI`
1434
1434
 
1435
- Defined in: [lib/ai.ts:61](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L61)
1435
+ Defined in: [lib/ai.ts:63](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L63)
1436
1436
 
1437
1437
  openai 原生对象
1438
1438
 
@@ -1444,7 +1444,7 @@ openai 原生对象
1444
1444
 
1445
1445
  > **get** **service**(): [`ESERVICE`](../enumerations/ESERVICE.md)
1446
1446
 
1447
- Defined in: [lib/ai.ts:143](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L143)
1447
+ Defined in: [lib/ai.ts:149](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L149)
1448
1448
 
1449
1449
  获取当前服务商
1450
1450
 
@@ -1462,7 +1462,7 @@ Defined in: [lib/ai.ts:143](https://github.com/maiyunnet/kebab/blob/master/lib/a
1462
1462
 
1463
1463
  > **chat**(`body`): `Promise`\<`false` \| `APIPromise`\<`ChatCompletion`\>\>
1464
1464
 
1465
- Defined in: [lib/ai.ts:148](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L148)
1465
+ Defined in: [lib/ai.ts:154](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L154)
1466
1466
 
1467
1467
  创建非流式对话
1468
1468
 
@@ -1480,7 +1480,7 @@ Defined in: [lib/ai.ts:148](https://github.com/maiyunnet/kebab/blob/master/lib/a
1480
1480
 
1481
1481
  > **chat**(`body`): `Promise`\<`false` \| `APIPromise`\<`Stream`\<`ChatCompletionChunk`\>\>\>
1482
1482
 
1483
- Defined in: [lib/ai.ts:152](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L152)
1483
+ Defined in: [lib/ai.ts:158](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L158)
1484
1484
 
1485
1485
  创建流式对话
1486
1486
 
@@ -1500,7 +1500,7 @@ Defined in: [lib/ai.ts:152](https://github.com/maiyunnet/kebab/blob/master/lib/a
1500
1500
 
1501
1501
  > **embedding**(`body`): `Promise`\<`false` \| `APIPromise`\<`CreateEmbeddingResponse`\>\>
1502
1502
 
1503
- Defined in: [lib/ai.ts:175](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L175)
1503
+ Defined in: [lib/ai.ts:181](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L181)
1504
1504
 
1505
1505
  创建向量
1506
1506
 
@@ -1520,7 +1520,7 @@ Defined in: [lib/ai.ts:175](https://github.com/maiyunnet/kebab/blob/master/lib/a
1520
1520
 
1521
1521
  > **image**(`opt`): `Promise`\<`false` \| \{ `list`: `object`[]; `request`: `string`; `seed`: `number`; \}\>
1522
1522
 
1523
- Defined in: [lib/ai.ts:191](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L191)
1523
+ Defined in: [lib/ai.ts:197](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L197)
1524
1524
 
1525
1525
  生成图像,不支持 GEMINI、GROK 服务商
1526
1526
 
@@ -1538,7 +1538,7 @@ Defined in: [lib/ai.ts:191](https://github.com/maiyunnet/kebab/blob/master/lib/a
1538
1538
 
1539
1539
  `string`[]
1540
1540
 
1541
- 参考图,请注意模型是否支持,以及是否支持多张,仅支持 ALICN、ALIAS、VOLCN、VOLAS 服务商
1541
+ 参考图,请注意模型是否支持,以及是否支持多张,仅支持 ALICN、ALIAS、ALINE、VOLCN、VOLAS 服务商
1542
1542
 
1543
1543
  ###### model
1544
1544
 
@@ -1582,7 +1582,7 @@ Defined in: [lib/ai.ts:191](https://github.com/maiyunnet/kebab/blob/master/lib/a
1582
1582
 
1583
1583
  > **poll**(`opt`): `Promise`\<`false` \| \{ `add?`: `number`; `end?`: `number`; `error?`: `string`; `start?`: `number`; `status`: `"FAILED"` \| `"PENDING"` \| `"RUNNING"` \| `"SUCCEEDED"` \| `"CANCELED"` \| `"UNKNOWN"`; `task`: `string`; `url?`: `string`; \}\>
1584
1584
 
1585
- Defined in: [lib/ai.ts:539](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L539)
1585
+ Defined in: [lib/ai.ts:546](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L546)
1586
1586
 
1587
1587
  轮询任务
1588
1588
 
@@ -1608,9 +1608,9 @@ Defined in: [lib/ai.ts:539](https://github.com/maiyunnet/kebab/blob/master/lib/a
1608
1608
 
1609
1609
  > **video**(`opt`): `Promise`\<`false` \| \{ `request`: `string`; `seed`: `number`; `status`: `"FAILED"` \| `"PENDING"` \| `"RUNNING"` \| `"SUCCEEDED"` \| `"CANCELED"` \| `"UNKNOWN"`; `task`: `string`; \}\>
1610
1610
 
1611
- Defined in: [lib/ai.ts:371](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L371)
1611
+ Defined in: [lib/ai.ts:378](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L378)
1612
1612
 
1613
- 异步生成视频,仅支持 ALICN、ALIAS
1613
+ 异步生成视频,仅支持 ALICN、ALIAS、ALINE
1614
1614
 
1615
1615
  #### Parameters
1616
1616
 
@@ -1711,7 +1711,7 @@ Defined in: [lib/ai.ts:19](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1711
1711
 
1712
1712
  Defined in: [lib/ai.ts:23](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L23)
1713
1713
 
1714
- 阿里国际区
1714
+ 阿里新加坡
1715
1715
 
1716
1716
  ***
1717
1717
 
@@ -1725,21 +1725,31 @@ Defined in: [lib/ai.ts:21](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1725
1725
 
1726
1726
  ***
1727
1727
 
1728
- ### AZURE
1728
+ ### ALINE
1729
1729
 
1730
- > **AZURE**: `2`
1730
+ > **ALINE**: `2`
1731
1731
 
1732
1732
  Defined in: [lib/ai.ts:25](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L25)
1733
1733
 
1734
+ 阿里美国
1735
+
1736
+ ***
1737
+
1738
+ ### AZURE
1739
+
1740
+ > **AZURE**: `3`
1741
+
1742
+ Defined in: [lib/ai.ts:27](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L27)
1743
+
1734
1744
  微软 Azure
1735
1745
 
1736
1746
  ***
1737
1747
 
1738
1748
  ### AZURE2
1739
1749
 
1740
- > **AZURE2**: `3`
1750
+ > **AZURE2**: `4`
1741
1751
 
1742
- Defined in: [lib/ai.ts:27](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L27)
1752
+ Defined in: [lib/ai.ts:29](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L29)
1743
1753
 
1744
1754
  微软 Azure 2
1745
1755
 
@@ -1747,9 +1757,9 @@ Defined in: [lib/ai.ts:27](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1747
1757
 
1748
1758
  ### AZURE3
1749
1759
 
1750
- > **AZURE3**: `4`
1760
+ > **AZURE3**: `5`
1751
1761
 
1752
- Defined in: [lib/ai.ts:29](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L29)
1762
+ Defined in: [lib/ai.ts:31](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L31)
1753
1763
 
1754
1764
  微软 Azure 3
1755
1765
 
@@ -1757,9 +1767,9 @@ Defined in: [lib/ai.ts:29](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1757
1767
 
1758
1768
  ### GEMINI
1759
1769
 
1760
- > **GEMINI**: `5`
1770
+ > **GEMINI**: `6`
1761
1771
 
1762
- Defined in: [lib/ai.ts:31](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L31)
1772
+ Defined in: [lib/ai.ts:33](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L33)
1763
1773
 
1764
1774
  Gemini
1765
1775
 
@@ -1767,9 +1777,9 @@ Gemini
1767
1777
 
1768
1778
  ### GROK
1769
1779
 
1770
- > **GROK**: `6`
1780
+ > **GROK**: `7`
1771
1781
 
1772
- Defined in: [lib/ai.ts:33](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L33)
1782
+ Defined in: [lib/ai.ts:35](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L35)
1773
1783
 
1774
1784
  Grok
1775
1785
 
@@ -1777,9 +1787,9 @@ Grok
1777
1787
 
1778
1788
  ### VOLAS
1779
1789
 
1780
- > **VOLAS**: `8`
1790
+ > **VOLAS**: `9`
1781
1791
 
1782
- Defined in: [lib/ai.ts:37](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L37)
1792
+ Defined in: [lib/ai.ts:39](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L39)
1783
1793
 
1784
1794
  火山引擎国际区
1785
1795
 
@@ -1787,9 +1797,9 @@ Defined in: [lib/ai.ts:37](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1787
1797
 
1788
1798
  ### VOLCN
1789
1799
 
1790
- > **VOLCN**: `7`
1800
+ > **VOLCN**: `8`
1791
1801
 
1792
- Defined in: [lib/ai.ts:35](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L35)
1802
+ Defined in: [lib/ai.ts:37](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L37)
1793
1803
 
1794
1804
  火山引擎中国大陆区
1795
1805
 
@@ -1806,7 +1816,7 @@ lib/ai/functions/get.md
1806
1816
 
1807
1817
  > **get**(`ctrEtc`, `opt`): [`Ai`](../classes/Ai.md)
1808
1818
 
1809
- Defined in: [lib/ai.ts:594](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L594)
1819
+ Defined in: [lib/ai.ts:601](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L601)
1810
1820
 
1811
1821
  创建一个 AI 对象
1812
1822
 
@@ -1864,7 +1874,7 @@ lib/ai/interfaces/IOptions.md
1864
1874
 
1865
1875
  # Interface: IOptions
1866
1876
 
1867
- Defined in: [lib/ai.ts:41](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L41)
1877
+ Defined in: [lib/ai.ts:43](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L43)
1868
1878
 
1869
1879
  选项
1870
1880
 
@@ -1874,7 +1884,7 @@ Defined in: [lib/ai.ts:41](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1874
1884
 
1875
1885
  > `optional` **endpoint?**: `string`
1876
1886
 
1877
- Defined in: [lib/ai.ts:45](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L45)
1887
+ Defined in: [lib/ai.ts:47](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L47)
1878
1888
 
1879
1889
  接入点
1880
1890
 
@@ -1884,7 +1894,7 @@ Defined in: [lib/ai.ts:45](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1884
1894
 
1885
1895
  > `optional` **fetch?**: (`input`, `init?`) => `Promise`\<`Response`\>
1886
1896
 
1887
- Defined in: [lib/ai.ts:49](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L49)
1897
+ Defined in: [lib/ai.ts:51](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L51)
1888
1898
 
1889
1899
  自定义 fetch 函数
1890
1900
 
@@ -1908,7 +1918,7 @@ Defined in: [lib/ai.ts:49](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1908
1918
 
1909
1919
  > `optional` **secretKey?**: `string`
1910
1920
 
1911
- Defined in: [lib/ai.ts:47](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L47)
1921
+ Defined in: [lib/ai.ts:49](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L49)
1912
1922
 
1913
1923
  密钥
1914
1924
 
@@ -1918,7 +1928,7 @@ Defined in: [lib/ai.ts:47](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1918
1928
 
1919
1929
  > **service**: [`ESERVICE`](../enumerations/ESERVICE.md)
1920
1930
 
1921
- Defined in: [lib/ai.ts:43](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L43)
1931
+ Defined in: [lib/ai.ts:45](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L45)
1922
1932
 
1923
1933
  服务商 -
1924
1934
 
package/index.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * --- 本文件用来定义每个目录实体地址的常量 ---
6
6
  */
7
7
  /** --- 当前系统版本号 --- */
8
- export declare const VER = "9.0.1";
8
+ export declare const VER = "9.0.2";
9
9
  /** --- 框架根目录,以 / 结尾 --- */
10
10
  export declare const ROOT_PATH: string;
11
11
  /** --- 框架的 LIB,以 / 结尾 --- */
package/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * --- 本文件用来定义每个目录实体地址的常量 ---
7
7
  */
8
8
  /** --- 当前系统版本号 --- */
9
- export const VER = '9.0.1';
9
+ export const VER = '9.0.2';
10
10
  // --- 服务端用的路径 ---
11
11
  const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
12
12
  /** --- /xxx/xxx --- */
package/lib/ai.d.ts CHANGED
@@ -15,22 +15,24 @@ import * as sCtr from '#kebab/sys/ctr.js';
15
15
  export declare enum ESERVICE {
16
16
  /** --- 阿里中国大陆区 --- */
17
17
  'ALICN' = 0,
18
- /** --- 阿里国际区 --- */
18
+ /** --- 阿里新加坡 --- */
19
19
  'ALIAS' = 1,
20
+ /** --- 阿里美国 --- */
21
+ 'ALINE' = 2,
20
22
  /** --- 微软 Azure --- */
21
- 'AZURE' = 2,
23
+ 'AZURE' = 3,
22
24
  /** --- 微软 Azure 2 --- */
23
- 'AZURE2' = 3,
25
+ 'AZURE2' = 4,
24
26
  /** --- 微软 Azure 3 --- */
25
- 'AZURE3' = 4,
27
+ 'AZURE3' = 5,
26
28
  /** --- Gemini --- */
27
- 'GEMINI' = 5,
29
+ 'GEMINI' = 6,
28
30
  /** --- Grok --- */
29
- 'GROK' = 6,
31
+ 'GROK' = 7,
30
32
  /** --- 火山引擎中国大陆区 --- */
31
- 'VOLCN' = 7,
33
+ 'VOLCN' = 8,
32
34
  /** --- 火山引擎国际区 --- */
33
- 'VOLAS' = 8
35
+ 'VOLAS' = 9
34
36
  }
35
37
  /** --- 选项 --- */
36
38
  export interface IOptions {
@@ -64,7 +66,7 @@ export declare class Ai {
64
66
  'model': string;
65
67
  /** --- 提示词 --- */
66
68
  'prompt': string;
67
- /** --- 参考图,请注意模型是否支持,以及是否支持多张,仅支持 ALICN、ALIAS、VOLCN、VOLAS 服务商 --- */
69
+ /** --- 参考图,请注意模型是否支持,以及是否支持多张,仅支持 ALICN、ALIAS、ALINE、VOLCN、VOLAS 服务商 --- */
68
70
  'imgs'?: string[];
69
71
  /** --- 模型是否自动优化提示词,默认为 false,但有些服务商可能无效 --- */
70
72
  'extend'?: boolean;
@@ -87,7 +89,7 @@ export declare class Ai {
87
89
  /** --- 请求编号 --- */
88
90
  'request': string;
89
91
  } | false>;
90
- /** --- 异步生成视频,仅支持 ALICN、ALIAS --- */
92
+ /** --- 异步生成视频,仅支持 ALICN、ALIAS、ALINE --- */
91
93
  video(opt: {
92
94
  'model': string;
93
95
  /** --- 提示词,参考类可用 [I1] 指代图片,如 `[I1] 看向 [I2]` --- */
package/lib/ai.js CHANGED
@@ -16,22 +16,24 @@ export var ESERVICE;
16
16
  (function (ESERVICE) {
17
17
  /** --- 阿里中国大陆区 --- */
18
18
  ESERVICE[ESERVICE["ALICN"] = 0] = "ALICN";
19
- /** --- 阿里国际区 --- */
19
+ /** --- 阿里新加坡 --- */
20
20
  ESERVICE[ESERVICE["ALIAS"] = 1] = "ALIAS";
21
+ /** --- 阿里美国 --- */
22
+ ESERVICE[ESERVICE["ALINE"] = 2] = "ALINE";
21
23
  /** --- 微软 Azure --- */
22
- ESERVICE[ESERVICE["AZURE"] = 2] = "AZURE";
24
+ ESERVICE[ESERVICE["AZURE"] = 3] = "AZURE";
23
25
  /** --- 微软 Azure 2 --- */
24
- ESERVICE[ESERVICE["AZURE2"] = 3] = "AZURE2";
26
+ ESERVICE[ESERVICE["AZURE2"] = 4] = "AZURE2";
25
27
  /** --- 微软 Azure 3 --- */
26
- ESERVICE[ESERVICE["AZURE3"] = 4] = "AZURE3";
28
+ ESERVICE[ESERVICE["AZURE3"] = 5] = "AZURE3";
27
29
  /** --- Gemini --- */
28
- ESERVICE[ESERVICE["GEMINI"] = 5] = "GEMINI";
30
+ ESERVICE[ESERVICE["GEMINI"] = 6] = "GEMINI";
29
31
  /** --- Grok --- */
30
- ESERVICE[ESERVICE["GROK"] = 6] = "GROK";
32
+ ESERVICE[ESERVICE["GROK"] = 7] = "GROK";
31
33
  /** --- 火山引擎中国大陆区 --- */
32
- ESERVICE[ESERVICE["VOLCN"] = 7] = "VOLCN";
34
+ ESERVICE[ESERVICE["VOLCN"] = 8] = "VOLCN";
33
35
  /** --- 火山引擎国际区 --- */
34
- ESERVICE[ESERVICE["VOLAS"] = 8] = "VOLAS";
36
+ ESERVICE[ESERVICE["VOLAS"] = 9] = "VOLAS";
35
37
  })(ESERVICE || (ESERVICE = {}));
36
38
  /** --- openai 的连接对象 --- */
37
39
  const links = [];
@@ -64,6 +66,10 @@ export class Ai {
64
66
  endpoint = opt.endpoint ?? `https://dashscope-intl.aliyuncs.com/compatible-mode/v1`;
65
67
  break;
66
68
  }
69
+ case ESERVICE.ALINE: {
70
+ endpoint = opt.endpoint ?? `https://dashscope-us.aliyuncs.com/compatible-mode/v1`;
71
+ break;
72
+ }
67
73
  case ESERVICE.AZURE: {
68
74
  endpoint = opt.endpoint ?? configAi.endpoint ?? '';
69
75
  break;
@@ -148,9 +154,10 @@ export class Ai {
148
154
  const seed = opt.seed ?? lCore.rand(0, 2147483647);
149
155
  switch (this._service) {
150
156
  case ESERVICE.ALICN:
151
- case ESERVICE.ALIAS: {
157
+ case ESERVICE.ALIAS:
158
+ case ESERVICE.ALINE: {
152
159
  try {
153
- const res = await this._fetch(`https://dashscope${this._service === ESERVICE.ALIAS ? '-intl' : ''}.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation`, {
160
+ const res = await this._fetch(`https://dashscope${this._service === ESERVICE.ALIAS ? '-intl' : (this._service === ESERVICE.ALINE ? '-us' : '')}.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation`, {
154
161
  'method': 'POST',
155
162
  'headers': {
156
163
  'authorization': `Bearer ${this.link.apiKey}`,
@@ -295,9 +302,9 @@ export class Ai {
295
302
  }
296
303
  }
297
304
  }
298
- /** --- 异步生成视频,仅支持 ALICN、ALIAS --- */
305
+ /** --- 异步生成视频,仅支持 ALICN、ALIAS、ALINE --- */
299
306
  async video(opt) {
300
- if (this._service !== ESERVICE.ALICN && this._service !== ESERVICE.ALIAS) {
307
+ if (this._service !== ESERVICE.ALICN && this._service !== ESERVICE.ALIAS && this._service !== ESERVICE.ALINE) {
301
308
  return false;
302
309
  }
303
310
  const mode = opt.mode ?? 'text';
@@ -373,7 +380,7 @@ export class Ai {
373
380
  }
374
381
  }
375
382
  try {
376
- const res = await this._fetch(`https://dashscope${this._service === ESERVICE.ALIAS ? '-intl' : ''}.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis`, {
383
+ const res = await this._fetch(`https://dashscope${this._service === ESERVICE.ALIAS ? '-intl' : (this._service === ESERVICE.ALINE ? '-us' : '')}.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis`, {
377
384
  'method': 'POST',
378
385
  'headers': {
379
386
  'authorization': `Bearer ${this.link.apiKey}`,
@@ -432,11 +439,11 @@ export class Ai {
432
439
  }
433
440
  /** --- 轮询任务 --- */
434
441
  async poll(opt) {
435
- if (this._service !== ESERVICE.ALICN && this._service !== ESERVICE.ALIAS) {
442
+ if (this._service !== ESERVICE.ALICN && this._service !== ESERVICE.ALIAS && this._service !== ESERVICE.ALINE) {
436
443
  return false;
437
444
  }
438
445
  try {
439
- const res = await this._fetch(`https://dashscope${this._service === ESERVICE.ALIAS ? '-intl' : ''}.aliyuncs.com/api/v1/tasks/${opt.task}`, {
446
+ const res = await this._fetch(`https://dashscope${this._service === ESERVICE.ALIAS ? '-intl' : (this._service === ESERVICE.ALINE ? '-us' : '')}.aliyuncs.com/api/v1/tasks/${opt.task}`, {
440
447
  'method': 'GET',
441
448
  'headers': {
442
449
  'authorization': `Bearer ${this.link.apiKey}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maiyunnet/kebab",
3
- "version": "9.0.1",
3
+ "version": "9.0.2",
4
4
  "description": "Simple, easy-to-use, and fully-featured Node.js framework that is ready-to-use out of the box.",
5
5
  "type": "module",
6
6
  "keywords": [
package/sys/cmd.js CHANGED
@@ -172,6 +172,8 @@ async function run() {
172
172
  config.ai['ALICN'].skey ??= '';
173
173
  config.ai['ALIAS'] ??= {};
174
174
  config.ai['ALIAS'].skey ??= '';
175
+ config.ai['ALINE'] ??= {};
176
+ config.ai['ALINE'].skey ??= '';
175
177
  config.ai['AZURE'] ??= {};
176
178
  config.ai['AZURE'].endpoint ??= '';
177
179
  config.ai['AZURE'].skey ??= '';
@@ -3519,7 +3519,9 @@ rtn.push(reader.readBCDString());</pre>${JSON.stringify(rtn)}`);
3519
3519
  // --- 文生图 ---
3520
3520
  let model = 'z-image-turbo';
3521
3521
  let size = [1280, 720];
3522
- if (ai.service !== lAi.ESERVICE.ALICN && ai.service !== lAi.ESERVICE.ALIAS) {
3522
+ if (ai.service !== lAi.ESERVICE.ALICN &&
3523
+ ai.service !== lAi.ESERVICE.ALIAS &&
3524
+ ai.service !== lAi.ESERVICE.ALINE) {
3523
3525
  switch (ai.service) {
3524
3526
  case lAi.ESERVICE.AZURE:
3525
3527
  case lAi.ESERVICE.AZURE2:
@@ -3562,7 +3564,9 @@ rtn.push(reader.readBCDString());</pre>${JSON.stringify(rtn)}`);
3562
3564
  let model = 'wan2.6-image';
3563
3565
  let size = [1280, 720];
3564
3566
  const prompt = '用图1的绘画风格重绘图2的场景,桌上增加一盘番茄炒蛋';
3565
- if (ai.service !== lAi.ESERVICE.ALICN && ai.service !== lAi.ESERVICE.ALIAS) {
3567
+ if (ai.service !== lAi.ESERVICE.ALICN &&
3568
+ ai.service !== lAi.ESERVICE.ALIAS &&
3569
+ ai.service !== lAi.ESERVICE.ALINE) {
3566
3570
  switch (ai.service) {
3567
3571
  default: {
3568
3572
  // --- 火山引擎 ---