@maxim_mazurok/gapi.client.translate-v3 0.0.20240301 → 0.0.20240718

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 (2) hide show
  1. package/index.d.ts +30 -6
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
10
10
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
11
11
  // Generated from: https://translation.googleapis.com/$discovery/rest?version=v3
12
- // Revision: 20240301
12
+ // Revision: 20240718
13
13
 
14
14
  /// <reference types="gapi.client" />
15
15
 
@@ -65,12 +65,18 @@ declare namespace gapi.client {
65
65
  updateTime?: string;
66
66
  }
67
67
  interface AdaptiveMtTranslateRequest {
68
- /** Required. The content of the input in string format. For now only one sentence per request is supported. */
68
+ /** Required. The content of the input in string format. */
69
69
  content?: string[];
70
70
  /** Required. The resource name for the dataset to use for adaptive MT. `projects/{project}/locations/{location-id}/adaptiveMtDatasets/{dataset}` */
71
71
  dataset?: string;
72
+ /** Optional. Glossary to be applied. The glossary must be within the same region (have the same location-id) as the model, otherwise an INVALID_ARGUMENT (400) error is returned. */
73
+ glossaryConfig?: TranslateTextGlossaryConfig;
74
+ /** Configuration for caller provided reference sentences. */
75
+ referenceSentenceConfig?: ReferenceSentenceConfig;
72
76
  }
73
77
  interface AdaptiveMtTranslateResponse {
78
+ /** Text translation response if a glossary is provided in the request. This could be the same as 'translation' above if no terms apply. */
79
+ glossaryTranslations?: AdaptiveMtTranslation[];
74
80
  /** Output only. The translation's language code. */
75
81
  languageCode?: string;
76
82
  /** Output only. The translation. */
@@ -259,7 +265,7 @@ declare namespace gapi.client {
259
265
  interface GlossaryEntry {
260
266
  /** Describes the glossary entry. */
261
267
  description?: string;
262
- /** Required. The resource name of the entry. Format: "projects/*‍/locations/*‍/glossaries/*‍/glossaryEntries/*" */
268
+ /** Identifier. The resource name of the entry. Format: "projects/*‍/locations/*‍/glossaries/*‍/glossaryEntries/*" */
263
269
  name?: string;
264
270
  /** Used for an unidirectional glossary. */
265
271
  termsPair?: GlossaryTermsPair;
@@ -432,6 +438,24 @@ declare namespace gapi.client {
432
438
  /** Google Cloud Storage destination for output content. For every single input file (for example, gs://a/b/c.[extension]), we generate at most 2 * n output files. (n is the # of target_language_codes in the BatchTranslateTextRequest). Output files (tsv) generated are compliant with RFC 4180 except that record delimiters are '\n' instead of '\r\n'. We don't provide any way to change record delimiters. While the input files are being processed, we write/update an index file 'index.csv' under 'output_uri_prefix' (for example, gs://translation-test/index.csv) The index file is generated/updated as new files are being translated. The format is: input_file,target_language_code,translations_file,errors_file, glossary_translations_file,glossary_errors_file input_file is one file we matched using gcs_source.input_uri. target_language_code is provided in the request. translations_file contains the translations. (details provided below) errors_file contains the errors during processing of the file. (details below). Both translations_file and errors_file could be empty strings if we have no content to output. glossary_translations_file and glossary_errors_file are always empty strings if the input_file is tsv. They could also be empty if we have no content to output. Once a row is present in index.csv, the input/output matching never changes. Callers should also expect all the content in input_file are processed and ready to be consumed (that is, no partial output file is written). Since index.csv will be keeping updated during the process, please make sure there is no custom retention policy applied on the output bucket that may avoid file updating. (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) The format of translations_file (for target language code 'trg') is: `gs://translation_test/a_b_c_'trg'_translations.[extension]` If the input file extension is tsv, the output has the following columns: Column 1: ID of the request provided in the input, if it's not provided in the input, then the input row number is used (0-based). Column 2: source sentence. Column 3: translation without applying a glossary. Empty string if there is an error. Column 4 (only present if a glossary is provided in the request): translation after applying the glossary. Empty string if there is an error applying the glossary. Could be same string as column 3 if there is no glossary applied. If input file extension is a txt or html, the translation is directly written to the output file. If glossary is requested, a separate glossary_translations_file has format of `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` The format of errors file (for target language code 'trg') is: `gs://translation_test/a_b_c_'trg'_errors.[extension]` If the input file extension is tsv, errors_file contains the following: Column 1: ID of the request provided in the input, if it's not provided in the input, then the input row number is used (0-based). Column 2: source sentence. Column 3: Error detail for the translation. Could be empty. Column 4 (only present if a glossary is provided in the request): Error when applying the glossary. If the input file extension is txt or html, glossary_error_file will be generated that contains error details. glossary_error_file has format of `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` */
433
439
  gcsDestination?: GcsDestination;
434
440
  }
441
+ interface ReferenceSentenceConfig {
442
+ /** Reference sentences pair lists. Each list will be used as the references to translate the sentence under "content" field at the corresponding index. Length of the list is required to be equal to the length of "content" field. */
443
+ referenceSentencePairLists?: ReferenceSentencePairList[];
444
+ /** Source language code. */
445
+ sourceLanguageCode?: string;
446
+ /** Target language code. */
447
+ targetLanguageCode?: string;
448
+ }
449
+ interface ReferenceSentencePair {
450
+ /** Source sentence in the sentence pair. */
451
+ sourceSentence?: string;
452
+ /** Target sentence in the sentence pair. */
453
+ targetSentence?: string;
454
+ }
455
+ interface ReferenceSentencePairList {
456
+ /** Reference sentence pairs. */
457
+ referenceSentencePairs?: ReferenceSentencePair[];
458
+ }
435
459
  interface Romanization {
436
460
  /** The ISO-639 language code of source text in the initial request, detected automatically, if no source language was passed within the initial request. If the source language was passed, auto-detection of the language does not occur and this field is empty. */
437
461
  detectedLanguageCode?: string;
@@ -519,7 +543,7 @@ declare namespace gapi.client {
519
543
  labels?: {[P in string]: string};
520
544
  /** Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html". */
521
545
  mimeType?: string;
522
- /** Optional. The `model` type requested for this translation. The format depends on model type: - AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models: `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, For global (non-regionalized) requests, use `location-id` `global`. For example, `projects/{project-number-or-id}/locations/global/models/general/nmt`. If not provided, the default Google model (NMT) will be used */
546
+ /** Optional. The `model` type requested for this translation. The format depends on model type: - AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models: `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - Translation LLM models: `projects/{project-number-or-id}/locations/{location-id}/models/general/translation-llm`, For global (non-regionalized) requests, use `location-id` `global`. For example, `projects/{project-number-or-id}/locations/global/models/general/nmt`. If not provided, the default Google model (NMT) will be used */
523
547
  model?: string;
524
548
  /** Optional. The ISO-639 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response. */
525
549
  sourceLanguageCode?: string;
@@ -1366,7 +1390,7 @@ declare namespace gapi.client {
1366
1390
  fields?: string;
1367
1391
  /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1368
1392
  key?: string;
1369
- /** Required. The resource name of the entry. Format: "projects/*‍/locations/*‍/glossaries/*‍/glossaryEntries/*" */
1393
+ /** Identifier. The resource name of the entry. Format: "projects/*‍/locations/*‍/glossaries/*‍/glossaryEntries/*" */
1370
1394
  name: string;
1371
1395
  /** OAuth 2.0 token for the current user. */
1372
1396
  oauth_token?: string;
@@ -1395,7 +1419,7 @@ declare namespace gapi.client {
1395
1419
  fields?: string;
1396
1420
  /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1397
1421
  key?: string;
1398
- /** Required. The resource name of the entry. Format: "projects/*‍/locations/*‍/glossaries/*‍/glossaryEntries/*" */
1422
+ /** Identifier. The resource name of the entry. Format: "projects/*‍/locations/*‍/glossaries/*‍/glossaryEntries/*" */
1399
1423
  name: string;
1400
1424
  /** OAuth 2.0 token for the current user. */
1401
1425
  oauth_token?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxim_mazurok/gapi.client.translate-v3",
3
- "version": "0.0.20240301",
3
+ "version": "0.0.20240718",
4
4
  "description": "TypeScript typings for Cloud Translation API v3",
5
5
  "repository": {
6
6
  "type": "git",