Skip to content

Commit 57789dd

Browse files
fix: add missing annotation for batch document translation (#715)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 392949968 Source-Link: googleapis/googleapis@41e44ac Source-Link: googleapis/googleapis-gen@2a89e11
1 parent 2fef650 commit 57789dd

File tree

3 files changed

+29
-33
lines changed

3 files changed

+29
-33
lines changed

packages/google-cloud-translate/protos/google/cloud/translate/v3beta1/translation_service.proto

+22-21
Original file line numberDiff line numberDiff line change
@@ -239,14 +239,13 @@ message TranslateTextRequest {
239239
//
240240
// - General (built-in) models:
241241
// `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
242-
// `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
243242
//
244243
//
245244
// For global (non-regionalized) requests, use `location-id` `global`.
246245
// For example,
247246
// `projects/{project-number-or-id}/locations/global/models/general/nmt`.
248247
//
249-
// If missing, the system decides which google base model to use.
248+
// If not provided, the default Google model (NMT) will be used
250249
string model = 6 [(google.api.field_behavior) = OPTIONAL];
251250

252251
// Optional. Glossary to be applied. The glossary must be
@@ -283,6 +282,8 @@ message TranslateTextResponse {
283282
// A single translation response.
284283
message Translation {
285284
// Text translated into the target language.
285+
// If an error occurs during translation, this field might be excluded from
286+
// the response.
286287
string translated_text = 1;
287288

288289
// Only present when `model` is present in the request.
@@ -316,7 +317,7 @@ message DetectLanguageRequest {
316317
// For global calls, use `projects/{project-number-or-id}/locations/global` or
317318
// `projects/{project-number-or-id}`.
318319
//
319-
// Only models within the same region, which have the same location-id, can be used.
320+
// Only models within the same region (has same location-id) can be used.
320321
// Otherwise an INVALID_ARGUMENT (400) error is returned.
321322
string parent = 5 [
322323
(google.api.field_behavior) = REQUIRED,
@@ -410,11 +411,10 @@ message GetSupportedLanguagesRequest {
410411
//
411412
// - General (built-in) models:
412413
// `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
413-
// `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
414414
//
415415
//
416416
// Returns languages supported by the specified model.
417-
// If missing, we get supported languages of Google general base (PBMT) model.
417+
// If missing, we get supported languages of Google general NMT model.
418418
string model = 2 [(google.api.field_behavior) = OPTIONAL];
419419
}
420420

@@ -523,13 +523,13 @@ message OutputConfig {
523523
// content to output.
524524
//
525525
// Once a row is present in index.csv, the input/output matching never
526-
// changes. Callers should also expect the contents in the input_file are
526+
// changes. Callers should also expect all the content in input_file are
527527
// processed and ready to be consumed (that is, no partial output file is
528528
// written).
529529
//
530-
// Since index.csv will be updated during the process, please make
530+
// Since index.csv will be keeping updated during the process, please make
531531
// sure there is no custom retention policy applied on the output bucket
532-
// that may prevent file updating.
532+
// that may avoid file updating.
533533
// (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
534534
//
535535
// The format of translations_file (for target language code 'trg') is:
@@ -674,8 +674,7 @@ message TranslateDocumentRequest {
674674
//
675675
// Format: `projects/{project-number-or-id}/locations/{location-id}`.
676676
//
677-
// For global calls, use `projects/{project-number-or-id}/locations/global` or
678-
// `projects/{project-number-or-id}`.
677+
// For global calls, use `projects/{project-number-or-id}/locations/global`.
679678
//
680679
// Non-global location is required for requests using AutoML models or custom
681680
// glossaries.
@@ -717,7 +716,6 @@ message TranslateDocumentRequest {
717716
//
718717
// - General (built-in) models:
719718
// `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
720-
// `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
721719
//
722720
//
723721
// If not provided, the default Google model (NMT) will be used for
@@ -810,7 +808,7 @@ message BatchTranslateTextRequest {
810808
[(google.api.field_behavior) = REQUIRED];
811809

812810
// Optional. The models to use for translation. Map's key is target language
813-
// code. Map's value is the model name. Value can be a built-in general model,
811+
// code. Map's value is model name. Value can be a built-in general model,
814812
// or an AutoML Translation model.
815813
//
816814
// The value format depends on model type:
@@ -820,7 +818,6 @@ message BatchTranslateTextRequest {
820818
//
821819
// - General (built-in) models:
822820
// `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
823-
// `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
824821
//
825822
//
826823
// If the map is empty or a specific model is
@@ -1194,7 +1191,12 @@ message BatchTranslateDocumentRequest {
11941191
// Only AutoML Translation models or glossaries within the same region (have
11951192
// the same location-id) can be used, otherwise an INVALID_ARGUMENT (400)
11961193
// error is returned.
1197-
string parent = 1 [(google.api.field_behavior) = REQUIRED];
1194+
string parent = 1 [
1195+
(google.api.field_behavior) = REQUIRED,
1196+
(google.api.resource_reference) = {
1197+
type: "locations.googleapis.com/Location"
1198+
}
1199+
];
11981200

11991201
// Required. The BCP-47 language code of the input document if known, for
12001202
// example, "en-US" or "sr-Latn". Supported language codes are listed in
@@ -1230,7 +1232,6 @@ message BatchTranslateDocumentRequest {
12301232
//
12311233
// - General (built-in) models:
12321234
// `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
1233-
// `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
12341235
//
12351236
//
12361237
// If the map is empty or a specific model is not requested for a language
@@ -1261,10 +1262,10 @@ message BatchDocumentInputConfig {
12611262
// - `xlsx`,
12621263
// application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
12631264
//
1264-
// The max file size supported for `.docx`, `.pptx` and `.xlsx` is 100MB.
1265-
// The max file size supported for `.pdf` is 1GB and the max page limit is
1265+
// The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB.
1266+
// The max file size to support for `.pdf` is 1GB and the max page limit is
12661267
// 1000 pages.
1267-
// The max file size supported for all input documents is 1GB.
1268+
// The max file size to support for all input documents is 1GB.
12681269
GcsSource gcs_source = 1;
12691270
}
12701271
}
@@ -1328,16 +1329,16 @@ message BatchDocumentOutputConfig {
13281329
// field returned by BatchTranslateDocument if at least one document is
13291330
// translated successfully.
13301331
message BatchTranslateDocumentResponse {
1331-
// Total number of pages to translate in all documents. Documents without a
1332+
// Total number of pages to translate in all documents. Documents without
13321333
// clear page definition (such as XLSX) are not counted.
13331334
int64 total_pages = 1;
13341335

13351336
// Number of successfully translated pages in all documents. Documents without
1336-
// a clear page definition (such as XLSX) are not counted.
1337+
// clear page definition (such as XLSX) are not counted.
13371338
int64 translated_pages = 2;
13381339

13391340
// Number of pages that failed to process in all documents. Documents without
1340-
// a clear page definition (such as XLSX) are not counted.
1341+
// clear page definition (such as XLSX) are not counted.
13411342
int64 failed_pages = 3;
13421343

13431344
// Number of billable pages in documents with clear page definition (such as

packages/google-cloud-translate/protos/protos.json

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/google-cloud-translate/src/v3beta1/translation_service_client.ts

+5-11
Original file line numberDiff line numberDiff line change
@@ -476,14 +476,13 @@ export class TranslationServiceClient {
476476
*
477477
* - General (built-in) models:
478478
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
479-
* `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
480479
*
481480
*
482481
* For global (non-regionalized) requests, use `location-id` `global`.
483482
* For example,
484483
* `projects/{project-number-or-id}/locations/global/models/general/nmt`.
485484
*
486-
* If missing, the system decides which google base model to use.
485+
* If not provided, the default Google model (NMT) will be used
487486
* @param {google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} [request.glossaryConfig]
488487
* Optional. Glossary to be applied. The glossary must be
489488
* within the same region (have the same location-id) as the model, otherwise
@@ -599,7 +598,7 @@ export class TranslationServiceClient {
599598
* For global calls, use `projects/{project-number-or-id}/locations/global` or
600599
* `projects/{project-number-or-id}`.
601600
*
602-
* Only models within the same region, which have the same location-id, can be used.
601+
* Only models within the same region (has same location-id) can be used.
603602
* Otherwise an INVALID_ARGUMENT (400) error is returned.
604603
* @param {string} [request.model]
605604
* Optional. The language detection model to be used.
@@ -748,11 +747,10 @@ export class TranslationServiceClient {
748747
*
749748
* - General (built-in) models:
750749
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
751-
* `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
752750
*
753751
*
754752
* Returns languages supported by the specified model.
755-
* If missing, we get supported languages of Google general base (PBMT) model.
753+
* If missing, we get supported languages of Google general NMT model.
756754
* @param {object} [options]
757755
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
758756
* @returns {Promise} - The promise which resolves to an array.
@@ -853,8 +851,7 @@ export class TranslationServiceClient {
853851
*
854852
* Format: `projects/{project-number-or-id}/locations/{location-id}`.
855853
*
856-
* For global calls, use `projects/{project-number-or-id}/locations/global` or
857-
* `projects/{project-number-or-id}`.
854+
* For global calls, use `projects/{project-number-or-id}/locations/global`.
858855
*
859856
* Non-global location is required for requests using AutoML models or custom
860857
* glossaries.
@@ -889,7 +886,6 @@ export class TranslationServiceClient {
889886
*
890887
* - General (built-in) models:
891888
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
892-
* `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
893889
*
894890
*
895891
* If not provided, the default Google model (NMT) will be used for
@@ -1120,7 +1116,7 @@ export class TranslationServiceClient {
11201116
* Required. Specify up to 10 language codes here.
11211117
* @param {number[]} [request.models]
11221118
* Optional. The models to use for translation. Map's key is target language
1123-
* code. Map's value is the model name. Value can be a built-in general model,
1119+
* code. Map's value is model name. Value can be a built-in general model,
11241120
* or an AutoML Translation model.
11251121
*
11261122
* The value format depends on model type:
@@ -1130,7 +1126,6 @@ export class TranslationServiceClient {
11301126
*
11311127
* - General (built-in) models:
11321128
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
1133-
* `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
11341129
*
11351130
*
11361131
* If the map is empty or a specific model is
@@ -1339,7 +1334,6 @@ export class TranslationServiceClient {
13391334
*
13401335
* - General (built-in) models:
13411336
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
1342-
* `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
13431337
*
13441338
*
13451339
* If the map is empty or a specific model is not requested for a language

0 commit comments

Comments
 (0)