@alicloud/aidge20260428 3.0.1 → 3.1.1

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 (41) hide show
  1. package/dist/client.d.ts +99 -32
  2. package/dist/client.js +140 -32
  3. package/dist/client.js.map +1 -1
  4. package/dist/models/ImageTranslationStandardRequest.d.ts +17 -6
  5. package/dist/models/ImageTranslationStandardRequest.js +2 -0
  6. package/dist/models/ImageTranslationStandardRequest.js.map +1 -1
  7. package/dist/models/ImageTranslationStandardResponseBody.d.ts +365 -4
  8. package/dist/models/ImageTranslationStandardResponseBody.js +224 -1
  9. package/dist/models/ImageTranslationStandardResponseBody.js.map +1 -1
  10. package/dist/models/TextTranslateRequest.d.ts +11 -5
  11. package/dist/models/TextTranslateRequest.js.map +1 -1
  12. package/dist/models/TextTranslateResponseBody.d.ts +4 -4
  13. package/dist/models/TextTranslateShrinkRequest.d.ts +11 -5
  14. package/dist/models/TextTranslateShrinkRequest.js.map +1 -1
  15. package/dist/models/VideoTranslationRequest.d.ts +39 -0
  16. package/dist/models/VideoTranslationRequest.js +67 -0
  17. package/dist/models/VideoTranslationRequest.js.map +1 -0
  18. package/dist/models/VideoTranslationResponse.d.ts +19 -0
  19. package/dist/models/VideoTranslationResponse.js +69 -0
  20. package/dist/models/VideoTranslationResponse.js.map +1 -0
  21. package/dist/models/VideoTranslationResponseBody.d.ts +51 -0
  22. package/dist/models/VideoTranslationResponseBody.js +88 -0
  23. package/dist/models/VideoTranslationResponseBody.js.map +1 -0
  24. package/dist/models/VideoTranslationShrinkRequest.d.ts +39 -0
  25. package/dist/models/VideoTranslationShrinkRequest.js +64 -0
  26. package/dist/models/VideoTranslationShrinkRequest.js.map +1 -0
  27. package/dist/models/model.d.ts +11 -0
  28. package/dist/models/model.js +28 -6
  29. package/dist/models/model.js.map +1 -1
  30. package/package.json +1 -1
  31. package/src/client.ts +148 -32
  32. package/src/models/ImageTranslationStandardRequest.ts +19 -6
  33. package/src/models/ImageTranslationStandardResponseBody.ts +534 -4
  34. package/src/models/TextTranslateRequest.ts +11 -5
  35. package/src/models/TextTranslateResponseBody.ts +4 -4
  36. package/src/models/TextTranslateShrinkRequest.ts +11 -5
  37. package/src/models/VideoTranslationRequest.ts +61 -0
  38. package/src/models/VideoTranslationResponse.ts +40 -0
  39. package/src/models/VideoTranslationResponseBody.ts +85 -0
  40. package/src/models/VideoTranslationShrinkRequest.ts +58 -0
  41. package/src/models/model.ts +11 -0
package/src/client.ts CHANGED
@@ -1415,17 +1415,21 @@ export default class Client extends OpenApi {
1415
1415
  }
1416
1416
 
1417
1417
  /**
1418
- * Image Translation is designed specifically for e-commerce images. It supports more than 100 language directions, accurately processes complex text layouts within images, and ensures that translated content matches the image content. This helps e-commerce platforms and developers easily achieve multilingual conversion and rendering of image content.
1418
+ * The image translation product is designed for e-commerce images. It supports more than 100 language directions (including bridging), accurately processes complex text layouts within images, and ensures that translated content matches the image content. This helps e-commerce platforms and developers easily achieve multilingual conversion and presentation of image content. The product also returns layer information such as text position, font, and color within images, facilitating secondary editing of translation results through an image editor.
1419
1419
  *
1420
1420
  * @remarks
1421
- * ## Product Introduction
1422
- * Image Translation is designed specifically for e-commerce images. It supports more than 100 language directions, accurately processes complex text layouts within images, and ensures that translated content matches the image content. This helps e-commerce platforms and developers easily achieve multilingual conversion and rendering of image content.
1423
- * ## Common scenarios
1421
+ * # 1. Product Introduction
1422
+ * The image translation product is designed for e-commerce images. It supports more than 100 language directions (including bridging), accurately processes complex text layouts within images, and ensures that translated content matches the image content. This helps e-commerce platforms and developers easily achieve multilingual conversion and presentation of image content. The product also returns layer information such as text position, font, and color within images, facilitating secondary editing of translation results through an image editor.
1423
+ * # 2. Applicable scenarios
1424
1424
  * E-commerce product images, marketing images, and images for various other scenarios.
1425
- * ## Functions and features
1426
- * - **Product subject information protection**: You can choose whether to translate text on the product subject. This helps protect subject information from being translated, such as embedded information like product names.
1427
- * - **Brand name protection**: You can choose whether to translate brand names on images. This helps protect brand name information from being translated.
1428
- * - **Translation intervention support**: You can customize translation results, including keeping text untranslated (ABC-ABC), specifying translations (ABC-DEF), or removing text (ABC-empty value). This is commonly used for brand name protection and similar scenarios. Pass the corresponding intervention glossary ID when calling the API to meet your translation needs in different scenarios. You can upload up to 100,000 intervention terms. If you need more, contact the platform for assistance.
1425
+ * # 3. Features
1426
+ * * **Product subject information protection**: Allows you to choose whether to translate text on the product subject. This helps protect subject information from being translated, avoiding translation of embedded information such as product names.
1427
+ *
1428
+ * * **Brand name protection**: Allows you to choose whether to translate brand names on images. This helps protect brand name information from being translated.
1429
+ *
1430
+ * * **Secondary editing after translation (layer information)**: Allows you to choose whether to return layer information such as text position, font, and color. This can be used to connect to an image editor for secondary editing of translation results. For the release progress of the editor SDK package, follow platform notifications.
1431
+ *
1432
+ * * **Translation intervention support**: Allows you to customize translation results, including no translation (ABC-ABC), specified translation (ABC-DEF), and skip translation (ABC-empty value). This is commonly used for brand word protection scenarios. Simply pass the corresponding intervention glossary ID when calling the API to meet your translation needs in different scenarios. You can upload up to 100,000 intervention terms. If you need more, contact the platform for assistance.
1429
1433
  *
1430
1434
  * @param request - ImageTranslationStandardRequest
1431
1435
  * @param runtime - runtime options for this request RuntimeOptions
@@ -1458,6 +1462,10 @@ export default class Client extends OpenApi {
1458
1462
  query["TranslatingBrandInTheProduct"] = request.translatingBrandInTheProduct;
1459
1463
  }
1460
1464
 
1465
+ if (!$dara.isNull(request.useImageEditor)) {
1466
+ query["UseImageEditor"] = request.useImageEditor;
1467
+ }
1468
+
1461
1469
  let req = new $OpenApiUtil.OpenApiRequest({
1462
1470
  query: OpenApiUtil.query(query),
1463
1471
  });
@@ -1476,17 +1484,21 @@ export default class Client extends OpenApi {
1476
1484
  }
1477
1485
 
1478
1486
  /**
1479
- * Image Translation is designed specifically for e-commerce images. It supports more than 100 language directions, accurately processes complex text layouts within images, and ensures that translated content matches the image content. This helps e-commerce platforms and developers easily achieve multilingual conversion and rendering of image content.
1487
+ * The image translation product is designed for e-commerce images. It supports more than 100 language directions (including bridging), accurately processes complex text layouts within images, and ensures that translated content matches the image content. This helps e-commerce platforms and developers easily achieve multilingual conversion and presentation of image content. The product also returns layer information such as text position, font, and color within images, facilitating secondary editing of translation results through an image editor.
1480
1488
  *
1481
1489
  * @remarks
1482
- * ## Product Introduction
1483
- * Image Translation is designed specifically for e-commerce images. It supports more than 100 language directions, accurately processes complex text layouts within images, and ensures that translated content matches the image content. This helps e-commerce platforms and developers easily achieve multilingual conversion and rendering of image content.
1484
- * ## Common scenarios
1490
+ * # 1. Product Introduction
1491
+ * The image translation product is designed for e-commerce images. It supports more than 100 language directions (including bridging), accurately processes complex text layouts within images, and ensures that translated content matches the image content. This helps e-commerce platforms and developers easily achieve multilingual conversion and presentation of image content. The product also returns layer information such as text position, font, and color within images, facilitating secondary editing of translation results through an image editor.
1492
+ * # 2. Applicable scenarios
1485
1493
  * E-commerce product images, marketing images, and images for various other scenarios.
1486
- * ## Functions and features
1487
- * - **Product subject information protection**: You can choose whether to translate text on the product subject. This helps protect subject information from being translated, such as embedded information like product names.
1488
- * - **Brand name protection**: You can choose whether to translate brand names on images. This helps protect brand name information from being translated.
1489
- * - **Translation intervention support**: You can customize translation results, including keeping text untranslated (ABC-ABC), specifying translations (ABC-DEF), or removing text (ABC-empty value). This is commonly used for brand name protection and similar scenarios. Pass the corresponding intervention glossary ID when calling the API to meet your translation needs in different scenarios. You can upload up to 100,000 intervention terms. If you need more, contact the platform for assistance.
1494
+ * # 3. Features
1495
+ * * **Product subject information protection**: Allows you to choose whether to translate text on the product subject. This helps protect subject information from being translated, avoiding translation of embedded information such as product names.
1496
+ *
1497
+ * * **Brand name protection**: Allows you to choose whether to translate brand names on images. This helps protect brand name information from being translated.
1498
+ *
1499
+ * * **Secondary editing after translation (layer information)**: Allows you to choose whether to return layer information such as text position, font, and color. This can be used to connect to an image editor for secondary editing of translation results. For the release progress of the editor SDK package, follow platform notifications.
1500
+ *
1501
+ * * **Translation intervention support**: Allows you to customize translation results, including no translation (ABC-ABC), specified translation (ABC-DEF), and skip translation (ABC-empty value). This is commonly used for brand word protection scenarios. Simply pass the corresponding intervention glossary ID when calling the API to meet your translation needs in different scenarios. You can upload up to 100,000 intervention terms. If you need more, contact the platform for assistance.
1490
1502
  *
1491
1503
  * @param request - ImageTranslationStandardRequest
1492
1504
  * @returns ImageTranslationStandardResponse
@@ -2233,24 +2245,24 @@ export default class Client extends OpenApi {
2233
2245
  *
2234
2246
  * @remarks
2235
2247
  * ## Product Introduction
2236
- * Marco MT is an e-commerce translation model trained on over 1 billion high-quality bilingual sentence pairs, continuously optimized for e-commerce-specific terminology such as brands, models, materials, and attributes. It supports translation between more than 100 language pairs (including bridged translations), especially Chinese-English, Chinese-multilingual, and English-multilingual translations. It supports language detection for 24 language directions. If you do not specify a source language, automatic detection is performed.
2248
+ * Marco MT is an e-commerce translation model trained on over 1 billion\\+ high-quality bilingual sentence pairs, continuously optimized for e-commerce-specific terminology such as brands, models, materials, and attributes. It supports translation between more than 100 language pairs (including bridged translations), especially Chinese-English, Chinese-multilingual, and English-multilingual translations. It supports language detection for 24 language directions. If you do not specify a source language, automatic detection is performed.
2237
2249
  * ## Common scenarios
2238
- * - Product titles: Marco MT large model translation accurately translates phrases, keywords, and trending words in product titles into the target language, improving product visibility on e-commerce platforms.
2250
+ * - Product titles: Marco MT large model translation accurately translates phrases, keywords, and trending terms in product titles into the target language, improving product visibility on e-commerce platforms.
2239
2251
  * - Product descriptions: Product descriptions are typically long with diverse and complex formatting. Marco large model translation supports long text translation and HTML format, delivering excellent translation quality and format preservation.
2240
2252
  * - Product attributes: Product attribute terms are short and may contain e-commerce-specific terms such as model numbers and parameters.
2241
- * - Customer service conversations: In customer service scenarios, the model optimizes issues such as missing context and typos, and supports polite expressions for certain language directions.
2242
- * Marco MT large model translation can also be used for general-purpose translation scenarios such as office work, meetings, and daily conversations.
2243
- * ## Features
2244
- * - **Supported language directions** Marco MT large model translation supports translation between more than 100 languages and language detection for 23 languages. For specific language directions, refer to the language mapping table in section 5.6.
2253
+ * - Customer service conversations: In customer service scenarios, it optimizes issues such as missing context and typos, and supports polite expressions for certain language directions.
2254
+ * Marco MT large model translation can also be used for general-purpose translation scenarios, such as office work, meetings, and daily conversations.
2255
+ * ## Functions and features
2256
+ * - **Supported language directions** Marco MT large model translation supports translation between more than 100 languages and language detection for 23 languages. For specific language directions, refer to the language mapping table in Section 5.6.
2245
2257
  * - **Ultra-low hallucination rate and high-speed inference** Marco MT large model translation is a large language model with preference alignment for translation scenarios. Compared with general-purpose large language models, it offers faster translation inference and an extremely low hallucination rate, making it especially suitable for large-scale invocation scenarios.
2246
2258
  * - **Supported text format types** Currently supports text and html text types.
2247
- * - **Translation intervention support** Supports custom translation results, including do-not-translate (ABC-ABC), specified translation (ABC-DEF), and no translation (ABC-empty value). This is commonly used for brand name protection scenarios. Simply pass the corresponding intervention glossary ID when calling the API to meet your translation needs across different scenarios. You can upload up to 100,000 intervention terms. Contact the platform for additional capacity.
2259
+ * - **Translation intervention support** Supports custom translation results, including do-not-translate (ABC-ABC), specified translation (ABC-DEF), and no translation (ABC-empty value). This is commonly used for brand name protection scenarios. Simply pass the corresponding intervention glossary ID when calling the API to meet your translation needs across different scenarios. You can upload up to 100,000 intervention terms. For additional capacity, contact the platform.
2248
2260
  * ## Translation quality comparison
2249
2261
  * | **Source text** | **Aidge translation** | **Other translation product 1** | **Other translation product 2** | **Aidge translation advantage** |
2250
2262
  * |----------|---------------|-----------------------|-----------------------|---------------------|
2251
2263
  * | 75mm 4Pin 0.38A GA81S2U 12V GTX 960 Cooling Fan for Zotac GTX960 Graphics Card Cooling Fan | 75mm 4Pin 0.38A GA81S2U 12V GTX 960, ventilador de enfriamiento para tarjeta gráfica Zotac GTX960. | Ventilador de refrigeración de 75mm 4Pin 0.38A GA81S2U 12V para la tarjeta gráfica Zotac GTX960 Ventilador de enfriamiento GTX 960. | Ventilador de refrigeración para tarjeta gráfica Zotac GTX960, 75mm, 4 pines, 0,38A, GA81S2U, 12V, GTX 960 | Clearer product subject |
2252
2264
  * | New Arrival Classic Style Luxury Brand 6 Hands Swiss Automatic Mechanical Men\\"s Business Steel Watch | Nueva llegada, reloj mecánico automático de lujo con 6 manecillas, estilo clásico, de acero para hombres de negocios | Nueva Llegada Reloj De Acero de Negocios para Hombre con Mecanismo Automático Suizo y 6 Agujas de Estilo Clásico de Marca de Lujo. | Reloj de acero de negocios para hombre, mecánico automático suizo, marca de lujo, estilo clásico, 6 manos, nueva llegada | More complete sentence structure, clearer expression, and more reasonable segmentation |
2253
- * | Men Key Bag Genuine Cow Leather Buckets Key Cases Pouch Zipper Keychain Auto Car Key Case Women Home Key Holder Wallet | Sac à clés pour hommes en cuir de vache véritable, étuis à clés, pochette à fermeture éclair, porte-clés, étui à clé de voiture, porte-clés pour femmes, organisateur de portefeuille | Porte-clés sac en cuir de vache véritable, étuis à clés en forme de seau, pochette à fermeture éclair, porte-clés auto pour voiture, étui à clés pour femmes, organisateur de clés de maison, portefeuille. | Hommes porte-clés en cuir de vache véritable sac/pochette fermature éclair porte-clés Auto voiture porte-clés femmes maison porte-clés organisateur portefeuille | Clearer and more accurate product subject expression as "key bag" rather than "keychain". Other translations may cause ambiguity about the product subject |
2265
+ * | Men Key Bag Genuine Cow Leather Buckets Key Cases Pouch Zipper Keychain Auto Car Key Case Women Home Key Holder Wallet | Sac à clés pour hommes en cuir de vache véritable, étuis à clés, pochette à fermeture éclair, porte-clés, étui à clé de voiture, porte-clés pour femmes, organisateur de portefeuille | Porte-clés sac en cuir de vache véritable, étuis à clés en forme de seau, pochette à fermeture éclair, porte-clés auto pour voiture, étui à clés pour femmes, organisateur de clés de maison, portefeuille. | Hommes porte-clés en cuir de vache véritable sac/pochette fermature éclair porte-clés Auto voiture porte-clés femmes maison porte-clés organisateur portefeuille | Clearer and more precise product subject expression. The product is a "key bag" rather than a "keychain". Other translations may cause ambiguity about the product subject |
2254
2266
  *
2255
2267
  * @param tmpReq - TextTranslateRequest
2256
2268
  * @param runtime - runtime options for this request RuntimeOptions
@@ -2315,24 +2327,24 @@ export default class Client extends OpenApi {
2315
2327
  *
2316
2328
  * @remarks
2317
2329
  * ## Product Introduction
2318
- * Marco MT is an e-commerce translation model trained on over 1 billion high-quality bilingual sentence pairs, continuously optimized for e-commerce-specific terminology such as brands, models, materials, and attributes. It supports translation between more than 100 language pairs (including bridged translations), especially Chinese-English, Chinese-multilingual, and English-multilingual translations. It supports language detection for 24 language directions. If you do not specify a source language, automatic detection is performed.
2330
+ * Marco MT is an e-commerce translation model trained on over 1 billion\\+ high-quality bilingual sentence pairs, continuously optimized for e-commerce-specific terminology such as brands, models, materials, and attributes. It supports translation between more than 100 language pairs (including bridged translations), especially Chinese-English, Chinese-multilingual, and English-multilingual translations. It supports language detection for 24 language directions. If you do not specify a source language, automatic detection is performed.
2319
2331
  * ## Common scenarios
2320
- * - Product titles: Marco MT large model translation accurately translates phrases, keywords, and trending words in product titles into the target language, improving product visibility on e-commerce platforms.
2332
+ * - Product titles: Marco MT large model translation accurately translates phrases, keywords, and trending terms in product titles into the target language, improving product visibility on e-commerce platforms.
2321
2333
  * - Product descriptions: Product descriptions are typically long with diverse and complex formatting. Marco large model translation supports long text translation and HTML format, delivering excellent translation quality and format preservation.
2322
2334
  * - Product attributes: Product attribute terms are short and may contain e-commerce-specific terms such as model numbers and parameters.
2323
- * - Customer service conversations: In customer service scenarios, the model optimizes issues such as missing context and typos, and supports polite expressions for certain language directions.
2324
- * Marco MT large model translation can also be used for general-purpose translation scenarios such as office work, meetings, and daily conversations.
2325
- * ## Features
2326
- * - **Supported language directions** Marco MT large model translation supports translation between more than 100 languages and language detection for 23 languages. For specific language directions, refer to the language mapping table in section 5.6.
2335
+ * - Customer service conversations: In customer service scenarios, it optimizes issues such as missing context and typos, and supports polite expressions for certain language directions.
2336
+ * Marco MT large model translation can also be used for general-purpose translation scenarios, such as office work, meetings, and daily conversations.
2337
+ * ## Functions and features
2338
+ * - **Supported language directions** Marco MT large model translation supports translation between more than 100 languages and language detection for 23 languages. For specific language directions, refer to the language mapping table in Section 5.6.
2327
2339
  * - **Ultra-low hallucination rate and high-speed inference** Marco MT large model translation is a large language model with preference alignment for translation scenarios. Compared with general-purpose large language models, it offers faster translation inference and an extremely low hallucination rate, making it especially suitable for large-scale invocation scenarios.
2328
2340
  * - **Supported text format types** Currently supports text and html text types.
2329
- * - **Translation intervention support** Supports custom translation results, including do-not-translate (ABC-ABC), specified translation (ABC-DEF), and no translation (ABC-empty value). This is commonly used for brand name protection scenarios. Simply pass the corresponding intervention glossary ID when calling the API to meet your translation needs across different scenarios. You can upload up to 100,000 intervention terms. Contact the platform for additional capacity.
2341
+ * - **Translation intervention support** Supports custom translation results, including do-not-translate (ABC-ABC), specified translation (ABC-DEF), and no translation (ABC-empty value). This is commonly used for brand name protection scenarios. Simply pass the corresponding intervention glossary ID when calling the API to meet your translation needs across different scenarios. You can upload up to 100,000 intervention terms. For additional capacity, contact the platform.
2330
2342
  * ## Translation quality comparison
2331
2343
  * | **Source text** | **Aidge translation** | **Other translation product 1** | **Other translation product 2** | **Aidge translation advantage** |
2332
2344
  * |----------|---------------|-----------------------|-----------------------|---------------------|
2333
2345
  * | 75mm 4Pin 0.38A GA81S2U 12V GTX 960 Cooling Fan for Zotac GTX960 Graphics Card Cooling Fan | 75mm 4Pin 0.38A GA81S2U 12V GTX 960, ventilador de enfriamiento para tarjeta gráfica Zotac GTX960. | Ventilador de refrigeración de 75mm 4Pin 0.38A GA81S2U 12V para la tarjeta gráfica Zotac GTX960 Ventilador de enfriamiento GTX 960. | Ventilador de refrigeración para tarjeta gráfica Zotac GTX960, 75mm, 4 pines, 0,38A, GA81S2U, 12V, GTX 960 | Clearer product subject |
2334
2346
  * | New Arrival Classic Style Luxury Brand 6 Hands Swiss Automatic Mechanical Men\\"s Business Steel Watch | Nueva llegada, reloj mecánico automático de lujo con 6 manecillas, estilo clásico, de acero para hombres de negocios | Nueva Llegada Reloj De Acero de Negocios para Hombre con Mecanismo Automático Suizo y 6 Agujas de Estilo Clásico de Marca de Lujo. | Reloj de acero de negocios para hombre, mecánico automático suizo, marca de lujo, estilo clásico, 6 manos, nueva llegada | More complete sentence structure, clearer expression, and more reasonable segmentation |
2335
- * | Men Key Bag Genuine Cow Leather Buckets Key Cases Pouch Zipper Keychain Auto Car Key Case Women Home Key Holder Wallet | Sac à clés pour hommes en cuir de vache véritable, étuis à clés, pochette à fermeture éclair, porte-clés, étui à clé de voiture, porte-clés pour femmes, organisateur de portefeuille | Porte-clés sac en cuir de vache véritable, étuis à clés en forme de seau, pochette à fermeture éclair, porte-clés auto pour voiture, étui à clés pour femmes, organisateur de clés de maison, portefeuille. | Hommes porte-clés en cuir de vache véritable sac/pochette fermature éclair porte-clés Auto voiture porte-clés femmes maison porte-clés organisateur portefeuille | Clearer and more accurate product subject expression as "key bag" rather than "keychain". Other translations may cause ambiguity about the product subject |
2347
+ * | Men Key Bag Genuine Cow Leather Buckets Key Cases Pouch Zipper Keychain Auto Car Key Case Women Home Key Holder Wallet | Sac à clés pour hommes en cuir de vache véritable, étuis à clés, pochette à fermeture éclair, porte-clés, étui à clé de voiture, porte-clés pour femmes, organisateur de portefeuille | Porte-clés sac en cuir de vache véritable, étuis à clés en forme de seau, pochette à fermeture éclair, porte-clés auto pour voiture, étui à clés pour femmes, organisateur de clés de maison, portefeuille. | Hommes porte-clés en cuir de vache véritable sac/pochette fermature éclair porte-clés Auto voiture porte-clés femmes maison porte-clés organisateur portefeuille | Clearer and more precise product subject expression. The product is a "key bag" rather than a "keychain". Other translations may cause ambiguity about the product subject |
2336
2348
  *
2337
2349
  * @param request - TextTranslateRequest
2338
2350
  * @returns TextTranslateResponse
@@ -2342,6 +2354,110 @@ export default class Client extends OpenApi {
2342
2354
  return await this.textTranslateWithOptions(request, runtime);
2343
2355
  }
2344
2356
 
2357
+ /**
2358
+ * 视频翻译
2359
+ *
2360
+ * @remarks
2361
+ * ## 1. 产品简介
2362
+ * 视频翻译 API 支持将视频画面中的嵌字(字幕、卖点文字等)翻译为目标语言,并擦除原文。适用于电商视频多语言分发、国际社交媒体营销、全球品牌广告投放等场景。
2363
+ * API 采用异步调用模式:提交翻译任务后获取 `task_id`,通过查询接口轮询任务状态直至完成后获取结果。
2364
+ * ## 2. 适用场景
2365
+ * * **跨境电商视频本地化**:将商品介绍视频中的卖点文字翻译为目标市场语言,助力海外平台推广。
2366
+ *
2367
+ * * **国际社交媒体营销**:针对 TikTok、Instagram、YouTube 等平台,将视频画面文字内容一键本地化,提升海外用户理解度与转化率。
2368
+ *
2369
+ * * **全球品牌广告投放**:根据投放地区语言自动生成对应版本视频,减少人工制作成本。
2370
+ *
2371
+ * * **培训与产品说明**:将培训课程或产品演示视频中的画面文字翻译为多语言版本,方便全球团队使用。
2372
+ *
2373
+ * ## 3. 功能介绍
2374
+ * | 能力 | 标识码 | 说明 |
2375
+ * | --- | --- | --- |
2376
+ * | 画面翻译 | `visual` | 翻译视频画面中的嵌字(字幕、卖点文字等),并擦除原文 |
2377
+ * ## 4. 开发指南
2378
+ * ### 4.1 提交翻译任务
2379
+ * #### 请求
2380
+ * `POST /api/v1/video/translation`
2381
+ *
2382
+ * @param tmpReq - VideoTranslationRequest
2383
+ * @param runtime - runtime options for this request RuntimeOptions
2384
+ * @returns VideoTranslationResponse
2385
+ */
2386
+ async videoTranslationWithOptions(tmpReq: $_model.VideoTranslationRequest, runtime: $dara.RuntimeOptions): Promise<$_model.VideoTranslationResponse> {
2387
+ tmpReq.validate();
2388
+ let request = new $_model.VideoTranslationShrinkRequest({ });
2389
+ OpenApiUtil.convert(tmpReq, request);
2390
+ if (!$dara.isNull(tmpReq.capabilities)) {
2391
+ request.capabilitiesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.capabilities, "Capabilities", "json");
2392
+ }
2393
+
2394
+ let body : {[key: string ]: any} = { };
2395
+ if (!$dara.isNull(request.capabilitiesShrink)) {
2396
+ body["Capabilities"] = request.capabilitiesShrink;
2397
+ }
2398
+
2399
+ if (!$dara.isNull(request.sourceLanguage)) {
2400
+ body["SourceLanguage"] = request.sourceLanguage;
2401
+ }
2402
+
2403
+ if (!$dara.isNull(request.targetLanguage)) {
2404
+ body["TargetLanguage"] = request.targetLanguage;
2405
+ }
2406
+
2407
+ if (!$dara.isNull(request.videoUrl)) {
2408
+ body["VideoUrl"] = request.videoUrl;
2409
+ }
2410
+
2411
+ let req = new $OpenApiUtil.OpenApiRequest({
2412
+ body: OpenApiUtil.parseToMap(body),
2413
+ });
2414
+ let params = new $OpenApiUtil.Params({
2415
+ action: "VideoTranslation",
2416
+ version: "2026-04-28",
2417
+ protocol: "HTTPS",
2418
+ pathname: "/",
2419
+ method: "POST",
2420
+ authType: "AK",
2421
+ style: "RPC",
2422
+ reqBodyType: "formData",
2423
+ bodyType: "json",
2424
+ });
2425
+ return $dara.cast<$_model.VideoTranslationResponse>(await this.callApi(params, req, runtime), new $_model.VideoTranslationResponse({}));
2426
+ }
2427
+
2428
+ /**
2429
+ * 视频翻译
2430
+ *
2431
+ * @remarks
2432
+ * ## 1. 产品简介
2433
+ * 视频翻译 API 支持将视频画面中的嵌字(字幕、卖点文字等)翻译为目标语言,并擦除原文。适用于电商视频多语言分发、国际社交媒体营销、全球品牌广告投放等场景。
2434
+ * API 采用异步调用模式:提交翻译任务后获取 `task_id`,通过查询接口轮询任务状态直至完成后获取结果。
2435
+ * ## 2. 适用场景
2436
+ * * **跨境电商视频本地化**:将商品介绍视频中的卖点文字翻译为目标市场语言,助力海外平台推广。
2437
+ *
2438
+ * * **国际社交媒体营销**:针对 TikTok、Instagram、YouTube 等平台,将视频画面文字内容一键本地化,提升海外用户理解度与转化率。
2439
+ *
2440
+ * * **全球品牌广告投放**:根据投放地区语言自动生成对应版本视频,减少人工制作成本。
2441
+ *
2442
+ * * **培训与产品说明**:将培训课程或产品演示视频中的画面文字翻译为多语言版本,方便全球团队使用。
2443
+ *
2444
+ * ## 3. 功能介绍
2445
+ * | 能力 | 标识码 | 说明 |
2446
+ * | --- | --- | --- |
2447
+ * | 画面翻译 | `visual` | 翻译视频画面中的嵌字(字幕、卖点文字等),并擦除原文 |
2448
+ * ## 4. 开发指南
2449
+ * ### 4.1 提交翻译任务
2450
+ * #### 请求
2451
+ * `POST /api/v1/video/translation`
2452
+ *
2453
+ * @param request - VideoTranslationRequest
2454
+ * @returns VideoTranslationResponse
2455
+ */
2456
+ async videoTranslation(request: $_model.VideoTranslationRequest): Promise<$_model.VideoTranslationResponse> {
2457
+ let runtime = new $dara.RuntimeOptions({ });
2458
+ return await this.videoTranslationWithOptions(request, runtime);
2459
+ }
2460
+
2345
2461
  /**
2346
2462
  * Provides a one-stop AI-powered image processing service for e-commerce sellers. Orchestrates seven atomic capabilities — element detection, intelligent matting, intelligent removal, Image Translation Pro, image expansion, intelligent cropping, and HD upscaling — into an image processing workflow. Upload an image once, select the desired capabilities, and complete multiple image optimizations sequentially in a single call to produce product images that meet listing platform requirements. (Asynchronous).
2347
2463
  *
@@ -5,7 +5,7 @@ import * as $dara from '@darabonba/typescript';
5
5
  export class ImageTranslationStandardRequest extends $dara.Model {
6
6
  /**
7
7
  * @remarks
8
- * The ID of the intervention glossary. This parameter is optional. Create the glossary in the console and provide its ID. If the glossary ID is empty, the translation results are not modified.
8
+ * The intervention glossary ID. Optional. You must create the glossary separately in the console and provide its ID. If the provided glossary ID is empty, the translation results will not be modified.
9
9
  *
10
10
  * @example
11
11
  * glossary_1
@@ -13,7 +13,10 @@ export class ImageTranslationStandardRequest extends $dara.Model {
13
13
  glossary?: string;
14
14
  /**
15
15
  * @remarks
16
- * The URL of the original image. This parameter is required. Image requirements: the width and height cannot exceed 4000 × 4000 pixels, the file size cannot exceed 10 MB, and the supported formats are png, jpeg, jpg, bmp, and webp.
16
+ * - Image URL: Must be publicly accessible.
17
+ * - Format: png, jpeg, jpg, bmp, webp
18
+ * - Pixels: Width and height must not exceed 4000
19
+ * - File size: Original file ≤ 10 MB
17
20
  *
18
21
  * This parameter is required.
19
22
  *
@@ -23,7 +26,7 @@ export class ImageTranslationStandardRequest extends $dara.Model {
23
26
  imageUrl?: string;
24
27
  /**
25
28
  * @remarks
26
- * Specifies whether to translate text on the product subject in the image. This parameter is optional. Default value: false. This helps protect information by preventing translation of embedded information such as product names.
29
+ * Specifies whether to translate text on the image subject. Optional. Default value: false. This helps protect information and avoids translating embedded information such as product names.
27
30
  *
28
31
  * @example
29
32
  * false
@@ -31,7 +34,7 @@ export class ImageTranslationStandardRequest extends $dara.Model {
31
34
  includingProductArea?: boolean;
32
35
  /**
33
36
  * @remarks
34
- * The source language code. This parameter is required. For supported language directions, see the supported language directions list.
37
+ * The source language code. Required. For supported language directions, see the supported language direction list.
35
38
  *
36
39
  * This parameter is required.
37
40
  *
@@ -41,7 +44,7 @@ export class ImageTranslationStandardRequest extends $dara.Model {
41
44
  sourceLanguage?: string;
42
45
  /**
43
46
  * @remarks
44
- * The target language code. This parameter is required. For supported language directions, see the supported language directions list.
47
+ * The target language code. Required. For supported language directions, see the supported language direction list.
45
48
  *
46
49
  * This parameter is required.
47
50
  *
@@ -51,12 +54,20 @@ export class ImageTranslationStandardRequest extends $dara.Model {
51
54
  targetLanguage?: string;
52
55
  /**
53
56
  * @remarks
54
- * Specifies whether to translate brand names on the image. This parameter is optional. Default value: false. This helps protect brand name information from being translated.
57
+ * Specifies whether to translate brand names on the image. Optional. Default value: false. This helps protect brand name information from being translated.
55
58
  *
56
59
  * @example
57
60
  * false
58
61
  */
59
62
  translatingBrandInTheProduct?: boolean;
63
+ /**
64
+ * @remarks
65
+ * Specifies whether to return layer information such as text position, font, and color. When set to true, layer information is returned for secondary editing through an image editor. Default value: false.
66
+ *
67
+ * @example
68
+ * false
69
+ */
70
+ useImageEditor?: boolean;
60
71
  static names(): { [key: string]: string } {
61
72
  return {
62
73
  glossary: 'Glossary',
@@ -65,6 +76,7 @@ export class ImageTranslationStandardRequest extends $dara.Model {
65
76
  sourceLanguage: 'SourceLanguage',
66
77
  targetLanguage: 'TargetLanguage',
67
78
  translatingBrandInTheProduct: 'TranslatingBrandInTheProduct',
79
+ useImageEditor: 'UseImageEditor',
68
80
  };
69
81
  }
70
82
 
@@ -76,6 +88,7 @@ export class ImageTranslationStandardRequest extends $dara.Model {
76
88
  sourceLanguage: 'string',
77
89
  targetLanguage: 'string',
78
90
  translatingBrandInTheProduct: 'boolean',
91
+ useImageEditor: 'boolean',
79
92
  };
80
93
  }
81
94