seacloud-sdk 0.12.3 → 0.12.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/dist/index.js CHANGED
@@ -90,6 +90,43 @@ async function getHostFromParent(timeout = 5e3) {
90
90
  }
91
91
  });
92
92
  }
93
+ async function getEnvFromParent(timeout = 5e3) {
94
+ if (!isInIframe()) {
95
+ return null;
96
+ }
97
+ return new Promise((resolve) => {
98
+ const messageHandler = (event) => {
99
+ if (event.data && event.data.type === "seaverse:env") {
100
+ cleanup();
101
+ const env = event.data.payload?.env;
102
+ resolve(env || null);
103
+ } else if (event.data && event.data.type === "seaverse:error") {
104
+ cleanup();
105
+ console.warn("[SeaCloud SDK] Error getting env from parent:", event.data.error);
106
+ resolve(null);
107
+ }
108
+ };
109
+ const timeoutId = setTimeout(() => {
110
+ cleanup();
111
+ resolve(null);
112
+ }, timeout);
113
+ const cleanup = () => {
114
+ clearTimeout(timeoutId);
115
+ globalThis.window.removeEventListener("message", messageHandler);
116
+ };
117
+ globalThis.window.addEventListener("message", messageHandler);
118
+ try {
119
+ globalThis.window.parent.postMessage(
120
+ { type: "seaverse:get_env" },
121
+ "*"
122
+ // 允许任何源,支持跨域场景
123
+ );
124
+ } catch (e) {
125
+ cleanup();
126
+ resolve(null);
127
+ }
128
+ });
129
+ }
93
130
  async function getApiToken(providedApiKey) {
94
131
  if (providedApiKey) {
95
132
  return providedApiKey;
@@ -114,9 +151,38 @@ async function getApiToken(providedApiKey) {
114
151
  }
115
152
  return "";
116
153
  }
117
- function createConfig(options = {}) {
154
+ function checkIsDevelopmentHost(host) {
155
+ const devHostPatterns = ["localhost", "127.0.0.1", ":3000", ":8080", "seaverse.dev"];
156
+ return devHostPatterns.some((pattern) => host.includes(pattern));
157
+ }
158
+ async function getBaseUrl(userBaseUrl) {
159
+ if (userBaseUrl) {
160
+ return userBaseUrl;
161
+ }
162
+ if (typeof process !== "undefined" && process.env?.SEACLOUD_BASE_URL) {
163
+ return process.env.SEACLOUD_BASE_URL;
164
+ }
165
+ if (isInIframe()) {
166
+ const parentEnv = await getEnvFromParent(3e3);
167
+ if (parentEnv === "develop") {
168
+ console.log("[SeaCloud SDK] iframe \u73AF\u5883\uFF1A\u7236\u9875\u9762\u8FD4\u56DE\u5F00\u53D1\u73AF\u5883\uFF0C\u4F7F\u7528\u5F00\u53D1 baseUrl");
169
+ return "https://proxy-rs.sg.seaverse.dev";
170
+ } else {
171
+ console.log("[SeaCloud SDK] iframe \u73AF\u5883\uFF1A\u4F7F\u7528\u7EBF\u4E0A baseUrl");
172
+ return "https://proxy-rs.seaverse.ai";
173
+ }
174
+ }
175
+ const currentHost = typeof globalThis !== "undefined" && typeof globalThis.window !== "undefined" ? globalThis.window.location.host : "";
176
+ if (checkIsDevelopmentHost(currentHost)) {
177
+ console.log("[SeaCloud SDK] \u68C0\u6D4B\u5230\u5F00\u53D1\u73AF\u5883\uFF08currentHost\uFF09\uFF0C\u4F7F\u7528\u5F00\u53D1 baseUrl");
178
+ return "https://proxy-rs.sg.seaverse.dev";
179
+ } else {
180
+ return "https://proxy-rs.seaverse.ai";
181
+ }
182
+ }
183
+ async function createConfig(options = {}) {
118
184
  const apiKey = options.apiKey;
119
- const baseUrl = options.baseUrl || (typeof process !== "undefined" ? process.env?.SEACLOUD_BASE_URL : void 0) || "https://proxy-rs.seaverse.ai";
185
+ const baseUrl = await getBaseUrl(options.baseUrl);
120
186
  const fetchImpl = options.fetch || (globalThis.fetch ? globalThis.fetch.bind(globalThis) : void 0);
121
187
  if (!fetchImpl) {
122
188
  throw new Error("fetch is not available. Please provide a fetch implementation in config or upgrade to Node.js 18+");
@@ -140,14 +206,14 @@ function validateConfig(config) {
140
206
  }
141
207
 
142
208
  // src/core/version.ts
143
- var VERSION = "0.9.6";
209
+ var VERSION = "0.12.5";
144
210
 
145
211
  // src/core/client.ts
146
- var SeacloudClient = class {
212
+ var SeacloudClient = class _SeacloudClient {
147
213
  // 保存用户提供的 apiKey
148
- constructor(config = {}) {
149
- this.config = createConfig(config);
150
- this.providedApiKey = config.apiKey;
214
+ constructor(config, providedApiKey) {
215
+ this.config = config;
216
+ this.providedApiKey = providedApiKey;
151
217
  validateConfig(this.config);
152
218
  const isBrowser = typeof globalThis.window !== "undefined" && typeof globalThis.localStorage !== "undefined";
153
219
  if (isBrowser) {
@@ -161,6 +227,15 @@ var SeacloudClient = class {
161
227
  });
162
228
  }
163
229
  }
230
+ /**
231
+ * 创建 SeacloudClient 实例(异步工厂方法)
232
+ * @param config 配置选项
233
+ * @returns SeacloudClient 实例
234
+ */
235
+ static async create(config = {}) {
236
+ const fullConfig = await createConfig(config);
237
+ return new _SeacloudClient(fullConfig, config.apiKey);
238
+ }
164
239
  /**
165
240
  * 创建一个新任务
166
241
  * @param endpoint API 端点路径(例如:/model/tasks)
@@ -285,26 +360,9 @@ async function initSeacloud(apiKeyOrConfig, options) {
285
360
  apiKey = void 0;
286
361
  }
287
362
  if (!config.baseUrl) {
288
- try {
289
- const parentHost = await getHostFromParent(3e3);
290
- if (parentHost) {
291
- const devHostPatterns = ["localhost", "127.0.0.1", ":3000", ":8080", "seaverse.dev"];
292
- const currentHost = typeof globalThis !== "undefined" && typeof globalThis.window !== "undefined" ? globalThis.window.location.host : "";
293
- const checkIsDev = (host) => devHostPatterns.some((pattern) => host.includes(pattern));
294
- const isDevelopment = checkIsDev(currentHost) || checkIsDev(parentHost);
295
- if (isDevelopment) {
296
- config.baseUrl = "https://proxy-rs.sg.seaverse.dev";
297
- console.log("[SeaCloud SDK] \u68C0\u6D4B\u5230\u5F00\u53D1\u73AF\u5883\uFF0C\u4F7F\u7528\u5F00\u53D1 baseUrl:", config.baseUrl);
298
- } else {
299
- config.baseUrl = "https://proxy-rs.seaverse.ai";
300
- console.log("[SeaCloud SDK] \u68C0\u6D4B\u5230\u6B63\u5F0F\u73AF\u5883\uFF0C\u4F7F\u7528\u6B63\u5F0F baseUrl:", config.baseUrl);
301
- }
302
- }
303
- } catch (error) {
304
- console.warn("[SeaCloud SDK] \u83B7\u53D6\u7236\u9875\u9762 host \u5931\u8D25\uFF0C\u4F7F\u7528\u9ED8\u8BA4\u914D\u7F6E", error);
305
- }
363
+ config.baseUrl = await getBaseUrl();
306
364
  }
307
- globalConfig.client = new SeacloudClient({
365
+ globalConfig.client = await SeacloudClient.create({
308
366
  apiKey: apiKey || "",
309
367
  baseUrl: config.baseUrl,
310
368
  timeout: config.timeout,
@@ -318,11 +376,11 @@ async function initSeacloud(apiKeyOrConfig, options) {
318
376
  }
319
377
  return globalConfig.client;
320
378
  }
321
- function getClient() {
379
+ async function getClient() {
322
380
  if (globalConfig.client) {
323
381
  return globalConfig.client;
324
382
  }
325
- return new SeacloudClient({
383
+ return await SeacloudClient.create({
326
384
  // 不传 apiKey - 让 createConfig() 自动从环境变量/localStorage 读取
327
385
  // 不传 baseUrl - 让 createConfig() 自动从环境变量读取或使用默认值
328
386
  // 不传 timeout - 使用默认 30000ms
@@ -450,13 +508,13 @@ async function createAndWaitTask(client, endpoint, body, options = {}) {
450
508
 
451
509
  // src/core/index.ts
452
510
  async function getTaskStatus(endpoint, taskId) {
453
- const client = getClient();
511
+ const client = await getClient();
454
512
  return client.getTaskStatus(endpoint, taskId);
455
513
  }
456
514
 
457
515
  // src/api/alibaba_animate_anyone_detect.ts
458
516
  async function alibabaAnimateAnyoneDetect(params) {
459
- const client = getClient();
517
+ const client = await getClient();
460
518
  const pollingOptions = {
461
519
  intervalMs: 3e3,
462
520
  maxAttempts: 60
@@ -491,7 +549,7 @@ async function alibabaAnimateAnyoneDetect(params) {
491
549
 
492
550
  // src/api/alibaba_animate_anyone_template.ts
493
551
  async function alibabaAnimateAnyoneTemplate(params) {
494
- const client = getClient();
552
+ const client = await getClient();
495
553
  const pollingOptions = {
496
554
  intervalMs: 3e3,
497
555
  maxAttempts: 60
@@ -526,7 +584,7 @@ async function alibabaAnimateAnyoneTemplate(params) {
526
584
 
527
585
  // src/api/alibaba_animate_anyone_video.ts
528
586
  async function alibabaAnimateAnyoneVideo(params) {
529
- const client = getClient();
587
+ const client = await getClient();
530
588
  const pollingOptions = {
531
589
  intervalMs: 5e3,
532
590
  maxAttempts: 120
@@ -561,7 +619,7 @@ async function alibabaAnimateAnyoneVideo(params) {
561
619
 
562
620
  // src/api/alibaba_qianwen_image.ts
563
621
  async function alibabaQianwenImage(params) {
564
- const client = getClient();
622
+ const client = await getClient();
565
623
  const pollingOptions = {
566
624
  intervalMs: 3e3,
567
625
  maxAttempts: 60
@@ -596,7 +654,7 @@ async function alibabaQianwenImage(params) {
596
654
 
597
655
  // src/api/alibaba_wan22_t2i_flash.ts
598
656
  async function alibabaWan22T2iFlash(params) {
599
- const client = getClient();
657
+ const client = await getClient();
600
658
  const pollingOptions = {
601
659
  intervalMs: 3e3,
602
660
  maxAttempts: 60
@@ -631,7 +689,7 @@ async function alibabaWan22T2iFlash(params) {
631
689
 
632
690
  // src/api/alibaba_wan22_t2i_plus.ts
633
691
  async function alibabaWan22T2iPlus(params) {
634
- const client = getClient();
692
+ const client = await getClient();
635
693
  const pollingOptions = {
636
694
  intervalMs: 3e3,
637
695
  maxAttempts: 60
@@ -692,7 +750,7 @@ function validateResources(resources, resourceType = "resource") {
692
750
 
693
751
  // src/api/alibaba_wan25_i2i_preview.ts
694
752
  async function alibabaWan25I2iPreview(params) {
695
- const client = getClient();
753
+ const client = await getClient();
696
754
  const pollingOptions = {
697
755
  intervalMs: 3e3,
698
756
  maxAttempts: 60
@@ -728,7 +786,7 @@ async function alibabaWan25I2iPreview(params) {
728
786
 
729
787
  // src/api/alibaba_wan25_t2i_preview.ts
730
788
  async function alibabaWan25T2iPreview(params) {
731
- const client = getClient();
789
+ const client = await getClient();
732
790
  const pollingOptions = {
733
791
  intervalMs: 3e3,
734
792
  maxAttempts: 60
@@ -764,7 +822,7 @@ async function alibabaWan25T2iPreview(params) {
764
822
 
765
823
  // src/api/alibaba_wanx20_t2i_turbo.ts
766
824
  async function alibabaWanx20T2iTurbo(params) {
767
- const client = getClient();
825
+ const client = await getClient();
768
826
  const pollingOptions = {
769
827
  intervalMs: 3e3,
770
828
  maxAttempts: 60
@@ -799,7 +857,7 @@ async function alibabaWanx20T2iTurbo(params) {
799
857
 
800
858
  // src/api/alibaba_wanx21_i2v_plus.ts
801
859
  async function alibabaWanx21I2vPlus(params) {
802
- const client = getClient();
860
+ const client = await getClient();
803
861
  const pollingOptions = {
804
862
  intervalMs: 5e3,
805
863
  maxAttempts: 120
@@ -834,7 +892,7 @@ async function alibabaWanx21I2vPlus(params) {
834
892
 
835
893
  // src/api/alibaba_wanx21_i2v_turbo.ts
836
894
  async function alibabaWanx21I2vTurbo(params) {
837
- const client = getClient();
895
+ const client = await getClient();
838
896
  const pollingOptions = {
839
897
  intervalMs: 5e3,
840
898
  maxAttempts: 120
@@ -869,7 +927,7 @@ async function alibabaWanx21I2vTurbo(params) {
869
927
 
870
928
  // src/api/alibaba_wanx21_t2i_plus.ts
871
929
  async function alibabaWanx21T2iPlus(params) {
872
- const client = getClient();
930
+ const client = await getClient();
873
931
  const pollingOptions = {
874
932
  intervalMs: 3e3,
875
933
  maxAttempts: 60
@@ -904,7 +962,7 @@ async function alibabaWanx21T2iPlus(params) {
904
962
 
905
963
  // src/api/alibaba_wanx21_t2i_turbo.ts
906
964
  async function alibabaWanx21T2iTurbo(params) {
907
- const client = getClient();
965
+ const client = await getClient();
908
966
  const pollingOptions = {
909
967
  intervalMs: 3e3,
910
968
  maxAttempts: 60
@@ -939,7 +997,7 @@ async function alibabaWanx21T2iTurbo(params) {
939
997
 
940
998
  // src/api/alibaba_wanx21_t2v_plus.ts
941
999
  async function alibabaWanx21T2vPlus(params) {
942
- const client = getClient();
1000
+ const client = await getClient();
943
1001
  const pollingOptions = {
944
1002
  intervalMs: 5e3,
945
1003
  maxAttempts: 120
@@ -974,7 +1032,7 @@ async function alibabaWanx21T2vPlus(params) {
974
1032
 
975
1033
  // src/api/alibaba_wanx21_t2v_turbo.ts
976
1034
  async function alibabaWanx21T2vTurbo(params) {
977
- const client = getClient();
1035
+ const client = await getClient();
978
1036
  const pollingOptions = {
979
1037
  intervalMs: 5e3,
980
1038
  maxAttempts: 120
@@ -1009,7 +1067,7 @@ async function alibabaWanx21T2vTurbo(params) {
1009
1067
 
1010
1068
  // src/api/alibaba_wanx22_i2v_flash.ts
1011
1069
  async function alibabaWanx22I2vFlash(params) {
1012
- const client = getClient();
1070
+ const client = await getClient();
1013
1071
  const pollingOptions = {
1014
1072
  intervalMs: 5e3,
1015
1073
  maxAttempts: 120
@@ -1044,7 +1102,7 @@ async function alibabaWanx22I2vFlash(params) {
1044
1102
 
1045
1103
  // src/api/alibaba_wanx22_i2v_plus.ts
1046
1104
  async function alibabaWanx22I2vPlus(params) {
1047
- const client = getClient();
1105
+ const client = await getClient();
1048
1106
  const pollingOptions = {
1049
1107
  intervalMs: 5e3,
1050
1108
  maxAttempts: 120
@@ -1079,7 +1137,7 @@ async function alibabaWanx22I2vPlus(params) {
1079
1137
 
1080
1138
  // src/api/alibaba_wanx22_t2v_plus.ts
1081
1139
  async function alibabaWanx22T2vPlus(params) {
1082
- const client = getClient();
1140
+ const client = await getClient();
1083
1141
  const pollingOptions = {
1084
1142
  intervalMs: 5e3,
1085
1143
  maxAttempts: 120
@@ -1114,7 +1172,7 @@ async function alibabaWanx22T2vPlus(params) {
1114
1172
 
1115
1173
  // src/api/alibaba_wanx25_i2v_preview.ts
1116
1174
  async function alibabaWanx25I2vPreview(params) {
1117
- const client = getClient();
1175
+ const client = await getClient();
1118
1176
  const pollingOptions = {
1119
1177
  intervalMs: 5e3,
1120
1178
  maxAttempts: 120
@@ -1150,7 +1208,7 @@ async function alibabaWanx25I2vPreview(params) {
1150
1208
 
1151
1209
  // src/api/alibaba_wanx25_t2v_preview.ts
1152
1210
  async function alibabaWanx25T2vPreview(params) {
1153
- const client = getClient();
1211
+ const client = await getClient();
1154
1212
  const pollingOptions = {
1155
1213
  intervalMs: 5e3,
1156
1214
  maxAttempts: 120
@@ -1186,7 +1244,7 @@ async function alibabaWanx25T2vPreview(params) {
1186
1244
 
1187
1245
  // src/api/alibaba_wanx26_i2v.ts
1188
1246
  async function alibabaWanx26I2v(params) {
1189
- const client = getClient();
1247
+ const client = await getClient();
1190
1248
  const pollingOptions = {
1191
1249
  intervalMs: 5e3,
1192
1250
  maxAttempts: 120
@@ -1221,7 +1279,7 @@ async function alibabaWanx26I2v(params) {
1221
1279
 
1222
1280
  // src/api/alibaba_wanx26_reference.ts
1223
1281
  async function alibabaWanx26Reference(params) {
1224
- const client = getClient();
1282
+ const client = await getClient();
1225
1283
  const pollingOptions = {
1226
1284
  intervalMs: 3e3,
1227
1285
  maxAttempts: 60
@@ -1256,7 +1314,7 @@ async function alibabaWanx26Reference(params) {
1256
1314
 
1257
1315
  // src/api/alibaba_wanx26_t2v.ts
1258
1316
  async function alibabaWanx26T2v(params) {
1259
- const client = getClient();
1317
+ const client = await getClient();
1260
1318
  const pollingOptions = {
1261
1319
  intervalMs: 5e3,
1262
1320
  maxAttempts: 120
@@ -1291,7 +1349,7 @@ async function alibabaWanx26T2v(params) {
1291
1349
 
1292
1350
  // src/api/blackforestlabs_flux_11_pro.ts
1293
1351
  async function blackforestlabsFlux11Pro(params) {
1294
- const client = getClient();
1352
+ const client = await getClient();
1295
1353
  const pollingOptions = {
1296
1354
  intervalMs: 3e3,
1297
1355
  maxAttempts: 60
@@ -1326,7 +1384,7 @@ async function blackforestlabsFlux11Pro(params) {
1326
1384
 
1327
1385
  // src/api/blackforestlabs_flux_1_pro.ts
1328
1386
  async function blackforestlabsFlux1Pro(params) {
1329
- const client = getClient();
1387
+ const client = await getClient();
1330
1388
  const pollingOptions = {
1331
1389
  intervalMs: 3e3,
1332
1390
  maxAttempts: 60
@@ -1361,7 +1419,7 @@ async function blackforestlabsFlux1Pro(params) {
1361
1419
 
1362
1420
  // src/api/blackforestlabs_flux_2_flex.ts
1363
1421
  async function blackforestlabsFlux2Flex(params) {
1364
- const client = getClient();
1422
+ const client = await getClient();
1365
1423
  const pollingOptions = {
1366
1424
  intervalMs: 3e3,
1367
1425
  maxAttempts: 60
@@ -1396,7 +1454,7 @@ async function blackforestlabsFlux2Flex(params) {
1396
1454
 
1397
1455
  // src/api/blackforestlabs_flux_2_flex_edit.ts
1398
1456
  async function blackforestlabsFlux2FlexEdit(params) {
1399
- const client = getClient();
1457
+ const client = await getClient();
1400
1458
  const pollingOptions = {
1401
1459
  intervalMs: 3e3,
1402
1460
  maxAttempts: 60
@@ -1431,7 +1489,7 @@ async function blackforestlabsFlux2FlexEdit(params) {
1431
1489
 
1432
1490
  // src/api/blackforestlabs_flux_2_pro.ts
1433
1491
  async function blackforestlabsFlux2Pro(params) {
1434
- const client = getClient();
1492
+ const client = await getClient();
1435
1493
  const pollingOptions = {
1436
1494
  intervalMs: 3e3,
1437
1495
  maxAttempts: 60
@@ -1466,7 +1524,7 @@ async function blackforestlabsFlux2Pro(params) {
1466
1524
 
1467
1525
  // src/api/blackforestlabs_flux_2_pro_edit.ts
1468
1526
  async function blackforestlabsFlux2ProEdit(params) {
1469
- const client = getClient();
1527
+ const client = await getClient();
1470
1528
  const pollingOptions = {
1471
1529
  intervalMs: 3e3,
1472
1530
  maxAttempts: 60
@@ -1501,7 +1559,7 @@ async function blackforestlabsFlux2ProEdit(params) {
1501
1559
 
1502
1560
  // src/api/blackforestlabs_flux_kontext_max.ts
1503
1561
  async function blackforestlabsFluxKontextMax(params) {
1504
- const client = getClient();
1562
+ const client = await getClient();
1505
1563
  const pollingOptions = {
1506
1564
  intervalMs: 3e3,
1507
1565
  maxAttempts: 60
@@ -1536,7 +1594,7 @@ async function blackforestlabsFluxKontextMax(params) {
1536
1594
 
1537
1595
  // src/api/blackforestlabs_flux_kontext_pro.ts
1538
1596
  async function blackforestlabsFluxKontextPro(params) {
1539
- const client = getClient();
1597
+ const client = await getClient();
1540
1598
  const pollingOptions = {
1541
1599
  intervalMs: 3e3,
1542
1600
  maxAttempts: 60
@@ -1571,7 +1629,7 @@ async function blackforestlabsFluxKontextPro(params) {
1571
1629
 
1572
1630
  // src/api/elevenlabs_tts_generator.ts
1573
1631
  async function elevenlabsTtsGenerator(params) {
1574
- const client = getClient();
1632
+ const client = await getClient();
1575
1633
  const pollingOptions = {
1576
1634
  intervalMs: 2e3,
1577
1635
  maxAttempts: 60
@@ -1606,7 +1664,7 @@ async function elevenlabsTtsGenerator(params) {
1606
1664
 
1607
1665
  // src/api/google_gemini3_pro_image.ts
1608
1666
  async function googleGemini3ProImage(params) {
1609
- const client = getClient();
1667
+ const client = await getClient();
1610
1668
  const pollingOptions = {
1611
1669
  intervalMs: 3e3,
1612
1670
  maxAttempts: 60
@@ -1642,7 +1700,7 @@ async function googleGemini3ProImage(params) {
1642
1700
 
1643
1701
  // src/api/google_gemini_image.ts
1644
1702
  async function googleGeminiImage(params) {
1645
- const client = getClient();
1703
+ const client = await getClient();
1646
1704
  const pollingOptions = {
1647
1705
  intervalMs: 3e3,
1648
1706
  maxAttempts: 60
@@ -1689,7 +1747,7 @@ async function googleGeminiImage(params) {
1689
1747
 
1690
1748
  // src/api/google_imagen_4_fast_generate.ts
1691
1749
  async function googleImagen4FastGenerate(params) {
1692
- const client = getClient();
1750
+ const client = await getClient();
1693
1751
  const pollingOptions = {
1694
1752
  intervalMs: 3e3,
1695
1753
  maxAttempts: 60
@@ -1724,7 +1782,7 @@ async function googleImagen4FastGenerate(params) {
1724
1782
 
1725
1783
  // src/api/google_imagen_4_generate.ts
1726
1784
  async function googleImagen4Generate(params) {
1727
- const client = getClient();
1785
+ const client = await getClient();
1728
1786
  const pollingOptions = {
1729
1787
  intervalMs: 3e3,
1730
1788
  maxAttempts: 60
@@ -1759,7 +1817,7 @@ async function googleImagen4Generate(params) {
1759
1817
 
1760
1818
  // src/api/google_imagen_4_ultra_generate.ts
1761
1819
  async function googleImagen4UltraGenerate(params) {
1762
- const client = getClient();
1820
+ const client = await getClient();
1763
1821
  const pollingOptions = {
1764
1822
  intervalMs: 3e3,
1765
1823
  maxAttempts: 60
@@ -1794,7 +1852,7 @@ async function googleImagen4UltraGenerate(params) {
1794
1852
 
1795
1853
  // src/api/google_veo_20_generate_001.ts
1796
1854
  async function googleVeo20Generate001(params) {
1797
- const client = getClient();
1855
+ const client = await getClient();
1798
1856
  const pollingOptions = {
1799
1857
  intervalMs: 3e3,
1800
1858
  maxAttempts: 60
@@ -1829,7 +1887,7 @@ async function googleVeo20Generate001(params) {
1829
1887
 
1830
1888
  // src/api/google_veo_20_generate_exp.ts
1831
1889
  async function googleVeo20GenerateExp(params) {
1832
- const client = getClient();
1890
+ const client = await getClient();
1833
1891
  const pollingOptions = {
1834
1892
  intervalMs: 3e3,
1835
1893
  maxAttempts: 60
@@ -1864,7 +1922,7 @@ async function googleVeo20GenerateExp(params) {
1864
1922
 
1865
1923
  // src/api/google_veo_20_generate_preview.ts
1866
1924
  async function googleVeo20GeneratePreview(params) {
1867
- const client = getClient();
1925
+ const client = await getClient();
1868
1926
  const pollingOptions = {
1869
1927
  intervalMs: 3e3,
1870
1928
  maxAttempts: 60
@@ -1899,7 +1957,7 @@ async function googleVeo20GeneratePreview(params) {
1899
1957
 
1900
1958
  // src/api/google_veo_30_fast_generate_001.ts
1901
1959
  async function googleVeo30FastGenerate001(params) {
1902
- const client = getClient();
1960
+ const client = await getClient();
1903
1961
  const pollingOptions = {
1904
1962
  intervalMs: 3e3,
1905
1963
  maxAttempts: 60
@@ -1934,7 +1992,7 @@ async function googleVeo30FastGenerate001(params) {
1934
1992
 
1935
1993
  // src/api/google_veo_30_generate_001.ts
1936
1994
  async function googleVeo30Generate001(params) {
1937
- const client = getClient();
1995
+ const client = await getClient();
1938
1996
  const pollingOptions = {
1939
1997
  intervalMs: 3e3,
1940
1998
  maxAttempts: 60
@@ -1969,7 +2027,7 @@ async function googleVeo30Generate001(params) {
1969
2027
 
1970
2028
  // src/api/google_veo_31.ts
1971
2029
  async function googleVeo31(params) {
1972
- const client = getClient();
2030
+ const client = await getClient();
1973
2031
  const pollingOptions = {
1974
2032
  intervalMs: 3e3,
1975
2033
  maxAttempts: 60
@@ -2004,7 +2062,7 @@ async function googleVeo31(params) {
2004
2062
 
2005
2063
  // src/api/kling_avatar.ts
2006
2064
  async function klingAvatar(params) {
2007
- const client = getClient();
2065
+ const client = await getClient();
2008
2066
  const pollingOptions = {
2009
2067
  intervalMs: 5e3,
2010
2068
  maxAttempts: 120
@@ -2039,7 +2097,7 @@ async function klingAvatar(params) {
2039
2097
 
2040
2098
  // src/api/kling_duration_extension.ts
2041
2099
  async function klingDurationExtension(params) {
2042
- const client = getClient();
2100
+ const client = await getClient();
2043
2101
  const pollingOptions = {
2044
2102
  intervalMs: 3e3,
2045
2103
  maxAttempts: 60
@@ -2074,7 +2132,7 @@ async function klingDurationExtension(params) {
2074
2132
 
2075
2133
  // src/api/kling_effects_multi_v1.ts
2076
2134
  async function klingEffectsMultiV1(params) {
2077
- const client = getClient();
2135
+ const client = await getClient();
2078
2136
  const pollingOptions = {
2079
2137
  intervalMs: 3e3,
2080
2138
  maxAttempts: 60
@@ -2109,7 +2167,7 @@ async function klingEffectsMultiV1(params) {
2109
2167
 
2110
2168
  // src/api/kling_effects_multi_v15.ts
2111
2169
  async function klingEffectsMultiV15(params) {
2112
- const client = getClient();
2170
+ const client = await getClient();
2113
2171
  const pollingOptions = {
2114
2172
  intervalMs: 3e3,
2115
2173
  maxAttempts: 60
@@ -2144,7 +2202,7 @@ async function klingEffectsMultiV15(params) {
2144
2202
 
2145
2203
  // src/api/kling_effects_multi_v16.ts
2146
2204
  async function klingEffectsMultiV16(params) {
2147
- const client = getClient();
2205
+ const client = await getClient();
2148
2206
  const pollingOptions = {
2149
2207
  intervalMs: 3e3,
2150
2208
  maxAttempts: 60
@@ -2179,7 +2237,7 @@ async function klingEffectsMultiV16(params) {
2179
2237
 
2180
2238
  // src/api/kling_effects_single.ts
2181
2239
  async function klingEffectsSingle(params) {
2182
- const client = getClient();
2240
+ const client = await getClient();
2183
2241
  const pollingOptions = {
2184
2242
  intervalMs: 3e3,
2185
2243
  maxAttempts: 60
@@ -2214,7 +2272,7 @@ async function klingEffectsSingle(params) {
2214
2272
 
2215
2273
  // src/api/kling_lipsync.ts
2216
2274
  async function klingLipsync(params) {
2217
- const client = getClient();
2275
+ const client = await getClient();
2218
2276
  const pollingOptions = {
2219
2277
  intervalMs: 5e3,
2220
2278
  maxAttempts: 120
@@ -2249,7 +2307,7 @@ async function klingLipsync(params) {
2249
2307
 
2250
2308
  // src/api/kling_omni_image.ts
2251
2309
  async function klingOmniImage(params) {
2252
- const client = getClient();
2310
+ const client = await getClient();
2253
2311
  const pollingOptions = {
2254
2312
  intervalMs: 3e3,
2255
2313
  maxAttempts: 60
@@ -2284,7 +2342,7 @@ async function klingOmniImage(params) {
2284
2342
 
2285
2343
  // src/api/kling_omni_video.ts
2286
2344
  async function klingOmniVideo(params) {
2287
- const client = getClient();
2345
+ const client = await getClient();
2288
2346
  const pollingOptions = {
2289
2347
  intervalMs: 5e3,
2290
2348
  maxAttempts: 120
@@ -2319,7 +2377,7 @@ async function klingOmniVideo(params) {
2319
2377
 
2320
2378
  // src/api/kling_v1.ts
2321
2379
  async function klingV1(params) {
2322
- const client = getClient();
2380
+ const client = await getClient();
2323
2381
  const pollingOptions = {
2324
2382
  intervalMs: 3e3,
2325
2383
  maxAttempts: 60
@@ -2354,7 +2412,7 @@ async function klingV1(params) {
2354
2412
 
2355
2413
  // src/api/kling_v1_5.ts
2356
2414
  async function klingV15(params) {
2357
- const client = getClient();
2415
+ const client = await getClient();
2358
2416
  const pollingOptions = {
2359
2417
  intervalMs: 3e3,
2360
2418
  maxAttempts: 60
@@ -2389,7 +2447,7 @@ async function klingV15(params) {
2389
2447
 
2390
2448
  // src/api/kling_v1_5_i2v.ts
2391
2449
  async function klingV15I2v(params) {
2392
- const client = getClient();
2450
+ const client = await getClient();
2393
2451
  const pollingOptions = {
2394
2452
  intervalMs: 5e3,
2395
2453
  maxAttempts: 120
@@ -2424,7 +2482,7 @@ async function klingV15I2v(params) {
2424
2482
 
2425
2483
  // src/api/kling_v1_6.ts
2426
2484
  async function klingV16(params) {
2427
- const client = getClient();
2485
+ const client = await getClient();
2428
2486
  const pollingOptions = {
2429
2487
  intervalMs: 3e3,
2430
2488
  maxAttempts: 60
@@ -2459,7 +2517,7 @@ async function klingV16(params) {
2459
2517
 
2460
2518
  // src/api/kling_v1_6_i2v.ts
2461
2519
  async function klingV16I2v(params) {
2462
- const client = getClient();
2520
+ const client = await getClient();
2463
2521
  const pollingOptions = {
2464
2522
  intervalMs: 5e3,
2465
2523
  maxAttempts: 120
@@ -2494,7 +2552,7 @@ async function klingV16I2v(params) {
2494
2552
 
2495
2553
  // src/api/kling_v1_i2v.ts
2496
2554
  async function klingV1I2v(params) {
2497
- const client = getClient();
2555
+ const client = await getClient();
2498
2556
  const pollingOptions = {
2499
2557
  intervalMs: 5e3,
2500
2558
  maxAttempts: 120
@@ -2529,7 +2587,7 @@ async function klingV1I2v(params) {
2529
2587
 
2530
2588
  // src/api/kling_v2_1_i2v.ts
2531
2589
  async function klingV21I2v(params) {
2532
- const client = getClient();
2590
+ const client = await getClient();
2533
2591
  const pollingOptions = {
2534
2592
  intervalMs: 5e3,
2535
2593
  maxAttempts: 120
@@ -2564,7 +2622,7 @@ async function klingV21I2v(params) {
2564
2622
 
2565
2623
  // src/api/kling_v2_1_master.ts
2566
2624
  async function klingV21Master(params) {
2567
- const client = getClient();
2625
+ const client = await getClient();
2568
2626
  const pollingOptions = {
2569
2627
  intervalMs: 3e3,
2570
2628
  maxAttempts: 60
@@ -2599,7 +2657,7 @@ async function klingV21Master(params) {
2599
2657
 
2600
2658
  // src/api/kling_v2_1_master_i2v.ts
2601
2659
  async function klingV21MasterI2v(params) {
2602
- const client = getClient();
2660
+ const client = await getClient();
2603
2661
  const pollingOptions = {
2604
2662
  intervalMs: 5e3,
2605
2663
  maxAttempts: 120
@@ -2634,7 +2692,7 @@ async function klingV21MasterI2v(params) {
2634
2692
 
2635
2693
  // src/api/kling_v2_5_turbo.ts
2636
2694
  async function klingV25Turbo(params) {
2637
- const client = getClient();
2695
+ const client = await getClient();
2638
2696
  const pollingOptions = {
2639
2697
  intervalMs: 3e3,
2640
2698
  maxAttempts: 60
@@ -2669,7 +2727,7 @@ async function klingV25Turbo(params) {
2669
2727
 
2670
2728
  // src/api/kling_v2_5_turbo_i2v.ts
2671
2729
  async function klingV25TurboI2v(params) {
2672
- const client = getClient();
2730
+ const client = await getClient();
2673
2731
  const pollingOptions = {
2674
2732
  intervalMs: 5e3,
2675
2733
  maxAttempts: 120
@@ -2704,7 +2762,7 @@ async function klingV25TurboI2v(params) {
2704
2762
 
2705
2763
  // src/api/kling_v2_6.ts
2706
2764
  async function klingV26(params) {
2707
- const client = getClient();
2765
+ const client = await getClient();
2708
2766
  const pollingOptions = {
2709
2767
  intervalMs: 3e3,
2710
2768
  maxAttempts: 60
@@ -2739,7 +2797,7 @@ async function klingV26(params) {
2739
2797
 
2740
2798
  // src/api/kling_v2_6_i2v.ts
2741
2799
  async function klingV26I2v(params) {
2742
- const client = getClient();
2800
+ const client = await getClient();
2743
2801
  const pollingOptions = {
2744
2802
  intervalMs: 5e3,
2745
2803
  maxAttempts: 120
@@ -2774,7 +2832,7 @@ async function klingV26I2v(params) {
2774
2832
 
2775
2833
  // src/api/kling_v2_master.ts
2776
2834
  async function klingV2Master(params) {
2777
- const client = getClient();
2835
+ const client = await getClient();
2778
2836
  const pollingOptions = {
2779
2837
  intervalMs: 3e3,
2780
2838
  maxAttempts: 60
@@ -2809,7 +2867,7 @@ async function klingV2Master(params) {
2809
2867
 
2810
2868
  // src/api/kling_v2_master_i2v.ts
2811
2869
  async function klingV2MasterI2v(params) {
2812
- const client = getClient();
2870
+ const client = await getClient();
2813
2871
  const pollingOptions = {
2814
2872
  intervalMs: 5e3,
2815
2873
  maxAttempts: 120
@@ -2844,7 +2902,7 @@ async function klingV2MasterI2v(params) {
2844
2902
 
2845
2903
  // src/api/microsoft_gpt_image_1.ts
2846
2904
  async function microsoftGptImage1(params) {
2847
- const client = getClient();
2905
+ const client = await getClient();
2848
2906
  const pollingOptions = {
2849
2907
  intervalMs: 3e3,
2850
2908
  maxAttempts: 60
@@ -2879,7 +2937,7 @@ async function microsoftGptImage1(params) {
2879
2937
 
2880
2938
  // src/api/microsoft_gpt_image_15.ts
2881
2939
  async function microsoftGptImage15(params) {
2882
- const client = getClient();
2940
+ const client = await getClient();
2883
2941
  const pollingOptions = {
2884
2942
  intervalMs: 3e3,
2885
2943
  maxAttempts: 60
@@ -2914,7 +2972,7 @@ async function microsoftGptImage15(params) {
2914
2972
 
2915
2973
  // src/api/microsoft_sora2.ts
2916
2974
  async function microsoftSora2(params) {
2917
- const client = getClient();
2975
+ const client = await getClient();
2918
2976
  const pollingOptions = {
2919
2977
  intervalMs: 3e3,
2920
2978
  maxAttempts: 60
@@ -2949,7 +3007,7 @@ async function microsoftSora2(params) {
2949
3007
 
2950
3008
  // src/api/minimax_hailuo_02.ts
2951
3009
  async function minimaxHailuo02(params) {
2952
- const client = getClient();
3010
+ const client = await getClient();
2953
3011
  const pollingOptions = {
2954
3012
  intervalMs: 3e3,
2955
3013
  maxAttempts: 60
@@ -2984,7 +3042,7 @@ async function minimaxHailuo02(params) {
2984
3042
 
2985
3043
  // src/api/minimax_hailuo_02_i2v.ts
2986
3044
  async function minimaxHailuo02I2v(params) {
2987
- const client = getClient();
3045
+ const client = await getClient();
2988
3046
  const pollingOptions = {
2989
3047
  intervalMs: 5e3,
2990
3048
  maxAttempts: 120
@@ -3019,7 +3077,7 @@ async function minimaxHailuo02I2v(params) {
3019
3077
 
3020
3078
  // src/api/minimax_hailuo_23_fast_i2v.ts
3021
3079
  async function minimaxHailuo23FastI2v(params) {
3022
- const client = getClient();
3080
+ const client = await getClient();
3023
3081
  const pollingOptions = {
3024
3082
  intervalMs: 5e3,
3025
3083
  maxAttempts: 120
@@ -3054,7 +3112,7 @@ async function minimaxHailuo23FastI2v(params) {
3054
3112
 
3055
3113
  // src/api/minimax_hailuo_23_i2v.ts
3056
3114
  async function minimaxHailuo23I2v(params) {
3057
- const client = getClient();
3115
+ const client = await getClient();
3058
3116
  const pollingOptions = {
3059
3117
  intervalMs: 5e3,
3060
3118
  maxAttempts: 120
@@ -3089,7 +3147,7 @@ async function minimaxHailuo23I2v(params) {
3089
3147
 
3090
3148
  // src/api/minimax_i2v_01.ts
3091
3149
  async function minimaxI2v01(params) {
3092
- const client = getClient();
3150
+ const client = await getClient();
3093
3151
  const pollingOptions = {
3094
3152
  intervalMs: 5e3,
3095
3153
  maxAttempts: 120
@@ -3124,7 +3182,7 @@ async function minimaxI2v01(params) {
3124
3182
 
3125
3183
  // src/api/minimax_i2v_01_director.ts
3126
3184
  async function minimaxI2v01Director(params) {
3127
- const client = getClient();
3185
+ const client = await getClient();
3128
3186
  const pollingOptions = {
3129
3187
  intervalMs: 5e3,
3130
3188
  maxAttempts: 120
@@ -3159,7 +3217,7 @@ async function minimaxI2v01Director(params) {
3159
3217
 
3160
3218
  // src/api/minimax_i2v_01_live.ts
3161
3219
  async function minimaxI2v01Live(params) {
3162
- const client = getClient();
3220
+ const client = await getClient();
3163
3221
  const pollingOptions = {
3164
3222
  intervalMs: 5e3,
3165
3223
  maxAttempts: 120
@@ -3194,7 +3252,7 @@ async function minimaxI2v01Live(params) {
3194
3252
 
3195
3253
  // src/api/minimax_t2a.ts
3196
3254
  async function minimaxT2a(params) {
3197
- const client = getClient();
3255
+ const client = await getClient();
3198
3256
  const pollingOptions = {
3199
3257
  intervalMs: 3e3,
3200
3258
  maxAttempts: 60
@@ -3229,7 +3287,7 @@ async function minimaxT2a(params) {
3229
3287
 
3230
3288
  // src/api/minimax_t2v_01.ts
3231
3289
  async function minimaxT2v01(params) {
3232
- const client = getClient();
3290
+ const client = await getClient();
3233
3291
  const pollingOptions = {
3234
3292
  intervalMs: 5e3,
3235
3293
  maxAttempts: 120
@@ -3264,7 +3322,7 @@ async function minimaxT2v01(params) {
3264
3322
 
3265
3323
  // src/api/minimax_t2v_01_director.ts
3266
3324
  async function minimaxT2v01Director(params) {
3267
- const client = getClient();
3325
+ const client = await getClient();
3268
3326
  const pollingOptions = {
3269
3327
  intervalMs: 5e3,
3270
3328
  maxAttempts: 120
@@ -3299,7 +3357,7 @@ async function minimaxT2v01Director(params) {
3299
3357
 
3300
3358
  // src/api/pixverse_v35_transition.ts
3301
3359
  async function pixverseV35Transition(params) {
3302
- const client = getClient();
3360
+ const client = await getClient();
3303
3361
  const pollingOptions = {
3304
3362
  intervalMs: 3e3,
3305
3363
  maxAttempts: 60
@@ -3334,7 +3392,7 @@ async function pixverseV35Transition(params) {
3334
3392
 
3335
3393
  // src/api/pixverse_v3_5_i2v.ts
3336
3394
  async function pixverseV35I2v(params) {
3337
- const client = getClient();
3395
+ const client = await getClient();
3338
3396
  const pollingOptions = {
3339
3397
  intervalMs: 5e3,
3340
3398
  maxAttempts: 120
@@ -3369,7 +3427,7 @@ async function pixverseV35I2v(params) {
3369
3427
 
3370
3428
  // src/api/pixverse_v3_5_t2v.ts
3371
3429
  async function pixverseV35T2v(params) {
3372
- const client = getClient();
3430
+ const client = await getClient();
3373
3431
  const pollingOptions = {
3374
3432
  intervalMs: 5e3,
3375
3433
  maxAttempts: 120
@@ -3404,7 +3462,7 @@ async function pixverseV35T2v(params) {
3404
3462
 
3405
3463
  // src/api/pixverse_v45_transition.ts
3406
3464
  async function pixverseV45Transition(params) {
3407
- const client = getClient();
3465
+ const client = await getClient();
3408
3466
  const pollingOptions = {
3409
3467
  intervalMs: 3e3,
3410
3468
  maxAttempts: 60
@@ -3439,7 +3497,7 @@ async function pixverseV45Transition(params) {
3439
3497
 
3440
3498
  // src/api/pixverse_v4_5_i2v.ts
3441
3499
  async function pixverseV45I2v(params) {
3442
- const client = getClient();
3500
+ const client = await getClient();
3443
3501
  const pollingOptions = {
3444
3502
  intervalMs: 5e3,
3445
3503
  maxAttempts: 120
@@ -3474,7 +3532,7 @@ async function pixverseV45I2v(params) {
3474
3532
 
3475
3533
  // src/api/pixverse_v4_5_t2v.ts
3476
3534
  async function pixverseV45T2v(params) {
3477
- const client = getClient();
3535
+ const client = await getClient();
3478
3536
  const pollingOptions = {
3479
3537
  intervalMs: 5e3,
3480
3538
  maxAttempts: 120
@@ -3509,7 +3567,7 @@ async function pixverseV45T2v(params) {
3509
3567
 
3510
3568
  // src/api/pixverse_v4_i2v.ts
3511
3569
  async function pixverseV4I2v(params) {
3512
- const client = getClient();
3570
+ const client = await getClient();
3513
3571
  const pollingOptions = {
3514
3572
  intervalMs: 5e3,
3515
3573
  maxAttempts: 120
@@ -3544,7 +3602,7 @@ async function pixverseV4I2v(params) {
3544
3602
 
3545
3603
  // src/api/pixverse_v4_t2v.ts
3546
3604
  async function pixverseV4T2v(params) {
3547
- const client = getClient();
3605
+ const client = await getClient();
3548
3606
  const pollingOptions = {
3549
3607
  intervalMs: 5e3,
3550
3608
  maxAttempts: 120
@@ -3579,7 +3637,7 @@ async function pixverseV4T2v(params) {
3579
3637
 
3580
3638
  // src/api/pixverse_v4_transition.ts
3581
3639
  async function pixverseV4Transition(params) {
3582
- const client = getClient();
3640
+ const client = await getClient();
3583
3641
  const pollingOptions = {
3584
3642
  intervalMs: 3e3,
3585
3643
  maxAttempts: 60
@@ -3614,7 +3672,7 @@ async function pixverseV4Transition(params) {
3614
3672
 
3615
3673
  // src/api/pixverse_v5_5_i2v.ts
3616
3674
  async function pixverseV55I2v(params) {
3617
- const client = getClient();
3675
+ const client = await getClient();
3618
3676
  const pollingOptions = {
3619
3677
  intervalMs: 5e3,
3620
3678
  maxAttempts: 120
@@ -3649,7 +3707,7 @@ async function pixverseV55I2v(params) {
3649
3707
 
3650
3708
  // src/api/pixverse_v5_5_t2v.ts
3651
3709
  async function pixverseV55T2v(params) {
3652
- const client = getClient();
3710
+ const client = await getClient();
3653
3711
  const pollingOptions = {
3654
3712
  intervalMs: 5e3,
3655
3713
  maxAttempts: 120
@@ -3684,7 +3742,7 @@ async function pixverseV55T2v(params) {
3684
3742
 
3685
3743
  // src/api/pixverse_v5_5_transition.ts
3686
3744
  async function pixverseV55Transition(params) {
3687
- const client = getClient();
3745
+ const client = await getClient();
3688
3746
  const pollingOptions = {
3689
3747
  intervalMs: 3e3,
3690
3748
  maxAttempts: 60
@@ -3719,7 +3777,7 @@ async function pixverseV55Transition(params) {
3719
3777
 
3720
3778
  // src/api/pixverse_v5_i2v.ts
3721
3779
  async function pixverseV5I2v(params) {
3722
- const client = getClient();
3780
+ const client = await getClient();
3723
3781
  const pollingOptions = {
3724
3782
  intervalMs: 5e3,
3725
3783
  maxAttempts: 120
@@ -3754,7 +3812,7 @@ async function pixverseV5I2v(params) {
3754
3812
 
3755
3813
  // src/api/pixverse_v5_t2v.ts
3756
3814
  async function pixverseV5T2v(params) {
3757
- const client = getClient();
3815
+ const client = await getClient();
3758
3816
  const pollingOptions = {
3759
3817
  intervalMs: 5e3,
3760
3818
  maxAttempts: 120
@@ -3789,7 +3847,7 @@ async function pixverseV5T2v(params) {
3789
3847
 
3790
3848
  // src/api/pixverse_v5_transition.ts
3791
3849
  async function pixverseV5Transition(params) {
3792
- const client = getClient();
3850
+ const client = await getClient();
3793
3851
  const pollingOptions = {
3794
3852
  intervalMs: 3e3,
3795
3853
  maxAttempts: 60
@@ -3824,7 +3882,7 @@ async function pixverseV5Transition(params) {
3824
3882
 
3825
3883
  // src/api/quick_app_background_remover_standard.ts
3826
3884
  async function quickAppBackgroundRemoverStandard(params) {
3827
- const client = getClient();
3885
+ const client = await getClient();
3828
3886
  const inputs = [
3829
3887
  { field: "image", value: params.imageUrl }
3830
3888
  ];
@@ -3871,7 +3929,7 @@ async function quickAppBackgroundRemoverStandard(params) {
3871
3929
 
3872
3930
  // src/api/runway_gen3a_turbo_i2v.ts
3873
3931
  async function runwayGen3aTurboI2v(params) {
3874
- const client = getClient();
3932
+ const client = await getClient();
3875
3933
  const pollingOptions = {
3876
3934
  intervalMs: 5e3,
3877
3935
  maxAttempts: 120
@@ -3906,7 +3964,7 @@ async function runwayGen3aTurboI2v(params) {
3906
3964
 
3907
3965
  // src/api/tencent_hunyuan_3d.ts
3908
3966
  async function tencentHunyuan3d(params) {
3909
- const client = getClient();
3967
+ const client = await getClient();
3910
3968
  const pollingOptions = {
3911
3969
  intervalMs: 4e3,
3912
3970
  maxAttempts: 90
@@ -3941,7 +3999,7 @@ async function tencentHunyuan3d(params) {
3941
3999
 
3942
4000
  // src/api/tencent_hunyuan_3d_pro.ts
3943
4001
  async function tencentHunyuan3dPro(params) {
3944
- const client = getClient();
4002
+ const client = await getClient();
3945
4003
  const pollingOptions = {
3946
4004
  intervalMs: 4e3,
3947
4005
  maxAttempts: 90
@@ -3976,7 +4034,7 @@ async function tencentHunyuan3dPro(params) {
3976
4034
 
3977
4035
  // src/api/tencent_hunyuan_3d_rapid.ts
3978
4036
  async function tencentHunyuan3dRapid(params) {
3979
- const client = getClient();
4037
+ const client = await getClient();
3980
4038
  const pollingOptions = {
3981
4039
  intervalMs: 4e3,
3982
4040
  maxAttempts: 90
@@ -4011,7 +4069,7 @@ async function tencentHunyuan3dRapid(params) {
4011
4069
 
4012
4070
  // src/api/tencent_image_creation_3.ts
4013
4071
  async function tencentImageCreation3(params) {
4014
- const client = getClient();
4072
+ const client = await getClient();
4015
4073
  const pollingOptions = {
4016
4074
  intervalMs: 3e3,
4017
4075
  maxAttempts: 60
@@ -4046,7 +4104,7 @@ async function tencentImageCreation3(params) {
4046
4104
 
4047
4105
  // src/api/tencent_mps_super_resolution.ts
4048
4106
  async function tencentMpsSuperResolution(params) {
4049
- const client = getClient();
4107
+ const client = await getClient();
4050
4108
  const pollingOptions = {
4051
4109
  intervalMs: 3e3,
4052
4110
  maxAttempts: 60
@@ -4081,7 +4139,7 @@ async function tencentMpsSuperResolution(params) {
4081
4139
 
4082
4140
  // src/api/app_search.ts
4083
4141
  async function appSearch(params) {
4084
- const client = getClient();
4142
+ const client = await getClient();
4085
4143
  const config = client.getConfig();
4086
4144
  const url = `${config.baseUrl}/model/v1/template/specs`;
4087
4145
  const controller = new AbortController();
@@ -4118,7 +4176,7 @@ var templateSpecs = appSearch;
4118
4176
 
4119
4177
  // src/api/vidu_15.ts
4120
4178
  async function vidu15(params) {
4121
- const client = getClient();
4179
+ const client = await getClient();
4122
4180
  const pollingOptions = {
4123
4181
  intervalMs: 3e3,
4124
4182
  maxAttempts: 60
@@ -4153,7 +4211,7 @@ async function vidu15(params) {
4153
4211
 
4154
4212
  // src/api/vidu_15_i2v.ts
4155
4213
  async function vidu15I2v(params) {
4156
- const client = getClient();
4214
+ const client = await getClient();
4157
4215
  const pollingOptions = {
4158
4216
  intervalMs: 5e3,
4159
4217
  maxAttempts: 120
@@ -4188,7 +4246,7 @@ async function vidu15I2v(params) {
4188
4246
 
4189
4247
  // src/api/vidu_20_i2v.ts
4190
4248
  async function vidu20I2v(params) {
4191
- const client = getClient();
4249
+ const client = await getClient();
4192
4250
  const pollingOptions = {
4193
4251
  intervalMs: 5e3,
4194
4252
  maxAttempts: 120
@@ -4223,7 +4281,7 @@ async function vidu20I2v(params) {
4223
4281
 
4224
4282
  // src/api/vidu_q1.ts
4225
4283
  async function viduQ1(params) {
4226
- const client = getClient();
4284
+ const client = await getClient();
4227
4285
  const pollingOptions = {
4228
4286
  intervalMs: 3e3,
4229
4287
  maxAttempts: 60
@@ -4258,7 +4316,7 @@ async function viduQ1(params) {
4258
4316
 
4259
4317
  // src/api/vidu_q1_i2v.ts
4260
4318
  async function viduQ1I2v(params) {
4261
- const client = getClient();
4319
+ const client = await getClient();
4262
4320
  const pollingOptions = {
4263
4321
  intervalMs: 5e3,
4264
4322
  maxAttempts: 120
@@ -4293,7 +4351,7 @@ async function viduQ1I2v(params) {
4293
4351
 
4294
4352
  // src/api/vidu_q2.ts
4295
4353
  async function viduQ2(params) {
4296
- const client = getClient();
4354
+ const client = await getClient();
4297
4355
  const pollingOptions = {
4298
4356
  intervalMs: 3e3,
4299
4357
  maxAttempts: 60
@@ -4328,7 +4386,7 @@ async function viduQ2(params) {
4328
4386
 
4329
4387
  // src/api/viduq2_i2v_reference.ts
4330
4388
  async function viduQ2I2vReference(params) {
4331
- const client = getClient();
4389
+ const client = await getClient();
4332
4390
  if (params.images && params.subjects) {
4333
4391
  throw new Error("images \u548C subjects \u53C2\u6570\u4E92\u65A5\uFF0C\u53EA\u80FD\u9009\u62E9\u5176\u4E2D\u4E00\u4E2A");
4334
4392
  }
@@ -4371,7 +4429,7 @@ async function viduQ2I2vReference(params) {
4371
4429
 
4372
4430
  // src/api/vidu_template.ts
4373
4431
  async function viduTemplate(params) {
4374
- const client = getClient();
4432
+ const client = await getClient();
4375
4433
  const pollingOptions = {
4376
4434
  intervalMs: 3e3,
4377
4435
  maxAttempts: 60
@@ -4406,7 +4464,7 @@ async function viduTemplate(params) {
4406
4464
 
4407
4465
  // src/api/vidu_template_v2.ts
4408
4466
  async function viduTemplateV2(params) {
4409
- const client = getClient();
4467
+ const client = await getClient();
4410
4468
  const pollingOptions = {
4411
4469
  intervalMs: 3e3,
4412
4470
  maxAttempts: 60
@@ -4441,7 +4499,7 @@ async function viduTemplateV2(params) {
4441
4499
 
4442
4500
  // src/api/volces_jimeng_3_0.ts
4443
4501
  async function volcesJimeng30(params) {
4444
- const client = getClient();
4502
+ const client = await getClient();
4445
4503
  const pollingOptions = {
4446
4504
  intervalMs: 3e3,
4447
4505
  maxAttempts: 60
@@ -4476,7 +4534,7 @@ async function volcesJimeng30(params) {
4476
4534
 
4477
4535
  // src/api/volces_jimeng_3_1.ts
4478
4536
  async function volcesJimeng31(params) {
4479
- const client = getClient();
4537
+ const client = await getClient();
4480
4538
  const pollingOptions = {
4481
4539
  intervalMs: 3e3,
4482
4540
  maxAttempts: 60
@@ -4511,7 +4569,7 @@ async function volcesJimeng31(params) {
4511
4569
 
4512
4570
  // src/api/volces_jimeng_dream_actor_m1.ts
4513
4571
  async function volcesJimengDreamActorM1(params) {
4514
- const client = getClient();
4572
+ const client = await getClient();
4515
4573
  const pollingOptions = {
4516
4574
  intervalMs: 3e3,
4517
4575
  maxAttempts: 60
@@ -4546,7 +4604,7 @@ async function volcesJimengDreamActorM1(params) {
4546
4604
 
4547
4605
  // src/api/volces_jimeng_i2i_3_0.ts
4548
4606
  async function volcesJimengI2i30(params) {
4549
- const client = getClient();
4607
+ const client = await getClient();
4550
4608
  const pollingOptions = {
4551
4609
  intervalMs: 3e3,
4552
4610
  maxAttempts: 60
@@ -4581,7 +4639,7 @@ async function volcesJimengI2i30(params) {
4581
4639
 
4582
4640
  // src/api/volces_realman_avatar_imitator_v2v.ts
4583
4641
  async function volcesRealmanAvatarImitatorV2v(params) {
4584
- const client = getClient();
4642
+ const client = await getClient();
4585
4643
  const pollingOptions = {
4586
4644
  intervalMs: 5e3,
4587
4645
  maxAttempts: 120
@@ -4616,7 +4674,7 @@ async function volcesRealmanAvatarImitatorV2v(params) {
4616
4674
 
4617
4675
  // src/api/volces_realman_avatar_picture_omni_v15.ts
4618
4676
  async function volcesRealmanAvatarPictureOmniV15(params) {
4619
- const client = getClient();
4677
+ const client = await getClient();
4620
4678
  const pollingOptions = {
4621
4679
  intervalMs: 5e3,
4622
4680
  maxAttempts: 120
@@ -4651,7 +4709,7 @@ async function volcesRealmanAvatarPictureOmniV15(params) {
4651
4709
 
4652
4710
  // src/api/volces_realman_avatar_picture_omni_v2.ts
4653
4711
  async function volcesRealmanAvatarPictureOmniV2(params) {
4654
- const client = getClient();
4712
+ const client = await getClient();
4655
4713
  const pollingOptions = {
4656
4714
  intervalMs: 5e3,
4657
4715
  maxAttempts: 120
@@ -4686,7 +4744,7 @@ async function volcesRealmanAvatarPictureOmniV2(params) {
4686
4744
 
4687
4745
  // src/api/volces_seed3d.ts
4688
4746
  async function volcesSeed3d(params) {
4689
- const client = getClient();
4747
+ const client = await getClient();
4690
4748
  const pollingOptions = {
4691
4749
  intervalMs: 4e3,
4692
4750
  maxAttempts: 90
@@ -4721,7 +4779,7 @@ async function volcesSeed3d(params) {
4721
4779
 
4722
4780
  // src/api/volces_seedance_30_i2v.ts
4723
4781
  async function volcesSeedance30I2v(params) {
4724
- const client = getClient();
4782
+ const client = await getClient();
4725
4783
  const pollingOptions = {
4726
4784
  intervalMs: 5e3,
4727
4785
  maxAttempts: 120
@@ -4756,7 +4814,7 @@ async function volcesSeedance30I2v(params) {
4756
4814
 
4757
4815
  // src/api/volces_seedance_3_0.ts
4758
4816
  async function volcesSeedance30(params) {
4759
- const client = getClient();
4817
+ const client = await getClient();
4760
4818
  const pollingOptions = {
4761
4819
  intervalMs: 3e3,
4762
4820
  maxAttempts: 60
@@ -4791,7 +4849,7 @@ async function volcesSeedance30(params) {
4791
4849
 
4792
4850
  // src/api/volces_seedance_3_0_pro.ts
4793
4851
  async function volcesSeedance30Pro(params) {
4794
- const client = getClient();
4852
+ const client = await getClient();
4795
4853
  const pollingOptions = {
4796
4854
  intervalMs: 3e3,
4797
4855
  maxAttempts: 60
@@ -4826,7 +4884,7 @@ async function volcesSeedance30Pro(params) {
4826
4884
 
4827
4885
  // src/api/volces_seedance_pro_fast.ts
4828
4886
  async function volcesSeedanceProFast(params) {
4829
- const client = getClient();
4887
+ const client = await getClient();
4830
4888
  const pollingOptions = {
4831
4889
  intervalMs: 3e3,
4832
4890
  maxAttempts: 60
@@ -4861,7 +4919,7 @@ async function volcesSeedanceProFast(params) {
4861
4919
 
4862
4920
  // src/api/volces_seededit_2_0.ts
4863
4921
  async function volcesSeededit20(params) {
4864
- const client = getClient();
4922
+ const client = await getClient();
4865
4923
  const pollingOptions = {
4866
4924
  intervalMs: 3e3,
4867
4925
  maxAttempts: 60
@@ -4895,7 +4953,7 @@ async function volcesSeededit20(params) {
4895
4953
 
4896
4954
  // src/api/volces_seededit_3_0.ts
4897
4955
  async function volcesSeededit30(params) {
4898
- const client = getClient();
4956
+ const client = await getClient();
4899
4957
  const pollingOptions = {
4900
4958
  intervalMs: 3e3,
4901
4959
  maxAttempts: 60
@@ -4931,7 +4989,7 @@ async function volcesSeededit30(params) {
4931
4989
 
4932
4990
  // src/api/volces_seededit_3_0_i2i.ts
4933
4991
  async function volcesSeededit30I2i(params) {
4934
- const client = getClient();
4992
+ const client = await getClient();
4935
4993
  const pollingOptions = {
4936
4994
  intervalMs: 3e3,
4937
4995
  maxAttempts: 60
@@ -4966,7 +5024,7 @@ async function volcesSeededit30I2i(params) {
4966
5024
 
4967
5025
  // src/api/volces_seededit_3d_style.ts
4968
5026
  async function volcesSeededit3dStyle(params) {
4969
- const client = getClient();
5027
+ const client = await getClient();
4970
5028
  const pollingOptions = {
4971
5029
  intervalMs: 4e3,
4972
5030
  maxAttempts: 90
@@ -5001,7 +5059,7 @@ async function volcesSeededit3dStyle(params) {
5001
5059
 
5002
5060
  // src/api/volces_seededit_multi_ip.ts
5003
5061
  async function volcesSeededitMultiIp(params) {
5004
- const client = getClient();
5062
+ const client = await getClient();
5005
5063
  const pollingOptions = {
5006
5064
  intervalMs: 3e3,
5007
5065
  maxAttempts: 60
@@ -5036,7 +5094,7 @@ async function volcesSeededitMultiIp(params) {
5036
5094
 
5037
5095
  // src/api/volces_seededit_multi_style.ts
5038
5096
  async function volcesSeededitMultiStyle(params) {
5039
- const client = getClient();
5097
+ const client = await getClient();
5040
5098
  const pollingOptions = {
5041
5099
  intervalMs: 3e3,
5042
5100
  maxAttempts: 60
@@ -5071,7 +5129,7 @@ async function volcesSeededitMultiStyle(params) {
5071
5129
 
5072
5130
  // src/api/volces_seededit_portrait.ts
5073
5131
  async function volcesSeededitPortrait(params) {
5074
- const client = getClient();
5132
+ const client = await getClient();
5075
5133
  const pollingOptions = {
5076
5134
  intervalMs: 3e3,
5077
5135
  maxAttempts: 60
@@ -5106,7 +5164,7 @@ async function volcesSeededitPortrait(params) {
5106
5164
 
5107
5165
  // src/api/volces_seededit_single_ip.ts
5108
5166
  async function volcesSeededitSingleIp(params) {
5109
- const client = getClient();
5167
+ const client = await getClient();
5110
5168
  const pollingOptions = {
5111
5169
  intervalMs: 3e3,
5112
5170
  maxAttempts: 60
@@ -5141,7 +5199,7 @@ async function volcesSeededitSingleIp(params) {
5141
5199
 
5142
5200
  // src/api/volces_seedream_3_0.ts
5143
5201
  async function volcesSeedream30(params) {
5144
- const client = getClient();
5202
+ const client = await getClient();
5145
5203
  const pollingOptions = {
5146
5204
  intervalMs: 3e3,
5147
5205
  maxAttempts: 60
@@ -5177,7 +5235,7 @@ async function volcesSeedream30(params) {
5177
5235
 
5178
5236
  // src/api/volces_seedream_4_0.ts
5179
5237
  async function volcesSeedream40(params) {
5180
- const client = getClient();
5238
+ const client = await getClient();
5181
5239
  const pollingOptions = {
5182
5240
  intervalMs: 3e3,
5183
5241
  maxAttempts: 60
@@ -5213,7 +5271,7 @@ async function volcesSeedream40(params) {
5213
5271
 
5214
5272
  // src/api/volces_seedream_4_5.ts
5215
5273
  async function volcesSeedream45(params) {
5216
- const client = getClient();
5274
+ const client = await getClient();
5217
5275
  const pollingOptions = {
5218
5276
  intervalMs: 3e3,
5219
5277
  maxAttempts: 60
@@ -5249,7 +5307,7 @@ async function volcesSeedream45(params) {
5249
5307
 
5250
5308
  // src/api/volces_seedream_4_5_i2i.ts
5251
5309
  async function volcesSeedream45I2i(params) {
5252
- const client = getClient();
5310
+ const client = await getClient();
5253
5311
  const pollingOptions = {
5254
5312
  intervalMs: 3e3,
5255
5313
  maxAttempts: 60
@@ -5284,7 +5342,7 @@ async function volcesSeedream45I2i(params) {
5284
5342
 
5285
5343
  // src/api/volces_seedream_4_5_multi_blend.ts
5286
5344
  async function volcesSeedream45MultiBlend(params) {
5287
- const client = getClient();
5345
+ const client = await getClient();
5288
5346
  const imageList = params.image || params.images;
5289
5347
  if (!imageList || !Array.isArray(imageList)) {
5290
5348
  throw new Error('Parameter "image" or "images" is required and must be an array');
@@ -5331,7 +5389,7 @@ async function volcesSeedream45MultiBlend(params) {
5331
5389
 
5332
5390
  // src/api/volces_subject_detection.ts
5333
5391
  async function volcesSubjectDetection(params) {
5334
- const client = getClient();
5392
+ const client = await getClient();
5335
5393
  const pollingOptions = {
5336
5394
  intervalMs: 3e3,
5337
5395
  maxAttempts: 60
@@ -5366,7 +5424,7 @@ async function volcesSubjectDetection(params) {
5366
5424
 
5367
5425
  // src/api/volces_subject_recognition.ts
5368
5426
  async function volcesSubjectRecognition(params) {
5369
- const client = getClient();
5427
+ const client = await getClient();
5370
5428
  const pollingOptions = {
5371
5429
  intervalMs: 3e3,
5372
5430
  maxAttempts: 60
@@ -5401,7 +5459,7 @@ async function volcesSubjectRecognition(params) {
5401
5459
 
5402
5460
  // src/api/llm_chat_completions.ts
5403
5461
  async function llmChatCompletions(params) {
5404
- const client = getClient();
5462
+ const client = await getClient();
5405
5463
  const config = client.getConfig();
5406
5464
  const url = `${config.baseUrl}/llm/chat/completions`;
5407
5465
  const token = await getApiToken(config.apiKey);
@@ -5485,7 +5543,7 @@ async function* parseStreamingResponse(response) {
5485
5543
 
5486
5544
  // src/api/agent_chat_completions.ts
5487
5545
  async function agentChatCompletions(params) {
5488
- const client = getClient();
5546
+ const client = await getClient();
5489
5547
  const config = client.getConfig();
5490
5548
  const url = `${config.baseUrl}/agent/api/v1/chat/completions`;
5491
5549
  const model = params.model || "custom_openai/vertex-ai-claude-sonnet-4.5";
@@ -5722,7 +5780,7 @@ function createTool(toolName) {
5722
5780
 
5723
5781
  // src/api/app_generation.ts
5724
5782
  async function appGeneration(params) {
5725
- const client = getClient();
5783
+ const client = await getClient();
5726
5784
  const pollingOptions = {
5727
5785
  intervalMs: 3e3,
5728
5786
  maxAttempts: 120
@@ -5750,7 +5808,7 @@ async function scan(params) {
5750
5808
  if (!params.risk_types || params.risk_types.length === 0) {
5751
5809
  throw new SeacloudError("\u5FC5\u987B\u63D0\u4F9B\u81F3\u5C11\u4E00\u4E2A\u98CE\u9669\u7C7B\u578B");
5752
5810
  }
5753
- const client = getClient();
5811
+ const client = await getClient();
5754
5812
  const config = client.getConfig();
5755
5813
  const url = `${config.baseUrl}/scan`;
5756
5814
  const token = await getApiToken(config.apiKey);
@@ -5808,7 +5866,7 @@ async function scan(params) {
5808
5866
 
5809
5867
  // src/api/youchuan_diffusion.ts
5810
5868
  async function youchuanDiffusion(params) {
5811
- const client = getClient();
5869
+ const client = await getClient();
5812
5870
  const pollingOptions = {
5813
5871
  intervalMs: 3e3,
5814
5872
  maxAttempts: 60
@@ -5843,7 +5901,7 @@ async function youchuanDiffusion(params) {
5843
5901
 
5844
5902
  // src/api/youchuan_edit.ts
5845
5903
  async function youchuanEdit(params) {
5846
- const client = getClient();
5904
+ const client = await getClient();
5847
5905
  const pollingOptions = {
5848
5906
  intervalMs: 3e3,
5849
5907
  maxAttempts: 60
@@ -5878,7 +5936,7 @@ async function youchuanEdit(params) {
5878
5936
 
5879
5937
  // src/api/youchuan_enhance.ts
5880
5938
  async function youchuanEnhance(params) {
5881
- const client = getClient();
5939
+ const client = await getClient();
5882
5940
  const pollingOptions = {
5883
5941
  intervalMs: 3e3,
5884
5942
  maxAttempts: 60
@@ -5913,7 +5971,7 @@ async function youchuanEnhance(params) {
5913
5971
 
5914
5972
  // src/api/youchuan_extend_video.ts
5915
5973
  async function youchuanExtendVideo(params) {
5916
- const client = getClient();
5974
+ const client = await getClient();
5917
5975
  const pollingOptions = {
5918
5976
  intervalMs: 3e3,
5919
5977
  maxAttempts: 60
@@ -5948,7 +6006,7 @@ async function youchuanExtendVideo(params) {
5948
6006
 
5949
6007
  // src/api/youchuan_inpaint.ts
5950
6008
  async function youchuanInpaint(params) {
5951
- const client = getClient();
6009
+ const client = await getClient();
5952
6010
  const pollingOptions = {
5953
6011
  intervalMs: 3e3,
5954
6012
  maxAttempts: 60
@@ -5983,7 +6041,7 @@ async function youchuanInpaint(params) {
5983
6041
 
5984
6042
  // src/api/youchuan_outpaint.ts
5985
6043
  async function youchuanOutpaint(params) {
5986
- const client = getClient();
6044
+ const client = await getClient();
5987
6045
  const pollingOptions = {
5988
6046
  intervalMs: 3e3,
5989
6047
  maxAttempts: 60
@@ -6018,7 +6076,7 @@ async function youchuanOutpaint(params) {
6018
6076
 
6019
6077
  // src/api/youchuan_pan.ts
6020
6078
  async function youchuanPan(params) {
6021
- const client = getClient();
6079
+ const client = await getClient();
6022
6080
  const pollingOptions = {
6023
6081
  intervalMs: 3e3,
6024
6082
  maxAttempts: 60
@@ -6053,7 +6111,7 @@ async function youchuanPan(params) {
6053
6111
 
6054
6112
  // src/api/youchuan_remix.ts
6055
6113
  async function youchuanRemix(params) {
6056
- const client = getClient();
6114
+ const client = await getClient();
6057
6115
  const pollingOptions = {
6058
6116
  intervalMs: 3e3,
6059
6117
  maxAttempts: 60
@@ -6088,7 +6146,7 @@ async function youchuanRemix(params) {
6088
6146
 
6089
6147
  // src/api/youchuan_remove_background.ts
6090
6148
  async function youchuanRemoveBackground(params) {
6091
- const client = getClient();
6149
+ const client = await getClient();
6092
6150
  const pollingOptions = {
6093
6151
  intervalMs: 3e3,
6094
6152
  maxAttempts: 60
@@ -6123,7 +6181,7 @@ async function youchuanRemoveBackground(params) {
6123
6181
 
6124
6182
  // src/api/youchuan_retexture.ts
6125
6183
  async function youchuanRetexture(params) {
6126
- const client = getClient();
6184
+ const client = await getClient();
6127
6185
  const pollingOptions = {
6128
6186
  intervalMs: 3e3,
6129
6187
  maxAttempts: 60
@@ -6158,7 +6216,7 @@ async function youchuanRetexture(params) {
6158
6216
 
6159
6217
  // src/api/youchuan_uploadpaint.ts
6160
6218
  async function youchuanUploadpaint(params) {
6161
- const client = getClient();
6219
+ const client = await getClient();
6162
6220
  const pollingOptions = {
6163
6221
  intervalMs: 3e3,
6164
6222
  maxAttempts: 60
@@ -6193,7 +6251,7 @@ async function youchuanUploadpaint(params) {
6193
6251
 
6194
6252
  // src/api/youchuan_upscale.ts
6195
6253
  async function youchuanUpscale(params) {
6196
- const client = getClient();
6254
+ const client = await getClient();
6197
6255
  const pollingOptions = {
6198
6256
  intervalMs: 3e3,
6199
6257
  maxAttempts: 60
@@ -6228,7 +6286,7 @@ async function youchuanUpscale(params) {
6228
6286
 
6229
6287
  // src/api/youchuan_variation.ts
6230
6288
  async function youchuanVariation(params) {
6231
- const client = getClient();
6289
+ const client = await getClient();
6232
6290
  const pollingOptions = {
6233
6291
  intervalMs: 3e3,
6234
6292
  maxAttempts: 60
@@ -6263,7 +6321,7 @@ async function youchuanVariation(params) {
6263
6321
 
6264
6322
  // src/api/youchuan_video_diffusion.ts
6265
6323
  async function youchuanVideoDiffusion(params) {
6266
- const client = getClient();
6324
+ const client = await getClient();
6267
6325
  const pollingOptions = {
6268
6326
  intervalMs: 3e3,
6269
6327
  maxAttempts: 60
@@ -6298,7 +6356,7 @@ async function youchuanVideoDiffusion(params) {
6298
6356
 
6299
6357
  // src/api/youchuan_video_upscale.ts
6300
6358
  async function youchuanVideoUpscale(params) {
6301
- const client = getClient();
6359
+ const client = await getClient();
6302
6360
  const pollingOptions = {
6303
6361
  intervalMs: 3e3,
6304
6362
  maxAttempts: 60