Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit a1297ba

Browse files
fix: add missing annotation for batch document translation (#231)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 392949968 Source-Link: googleapis/googleapis@41e44ac Source-Link: https://github.com/googleapis/googleapis-gen/commit/2a89e1166976d1d910103bc9a967e2596123a19f
1 parent b6bc410 commit a1297ba

3 files changed

Lines changed: 30 additions & 38 deletions

File tree

google/cloud/translate_v3beta1/services/translation_service/async_client.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ async def detect_language(
241241
``projects/{project-number-or-id}/locations/global`` or
242242
``projects/{project-number-or-id}``.
243243
244-
Only models within the same region, which have the same
245-
location-id, can be used. Otherwise an INVALID_ARGUMENT
244+
Only models within the same region (has same
245+
location-id) can be used. Otherwise an INVALID_ARGUMENT
246246
(400) error is returned.
247247
248248
This corresponds to the ``parent`` field
@@ -383,11 +383,10 @@ async def get_supported_languages(
383383
384384
- General (built-in) models:
385385
``projects/{project-number-or-id}/locations/{location-id}/models/general/nmt``,
386-
``projects/{project-number-or-id}/locations/{location-id}/models/general/base``
387386
388387
Returns languages supported by the specified model. If
389388
missing, we get supported languages of Google general
390-
base (PBMT) model.
389+
NMT model.
391390
392391
This corresponds to the ``model`` field
393392
on the ``request`` instance; if ``request`` is provided, this

google/cloud/translate_v3beta1/services/translation_service/client.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,8 @@ def detect_language(
432432
``projects/{project-number-or-id}/locations/global`` or
433433
``projects/{project-number-or-id}``.
434434
435-
Only models within the same region, which have the same
436-
location-id, can be used. Otherwise an INVALID_ARGUMENT
435+
Only models within the same region (has same
436+
location-id) can be used. Otherwise an INVALID_ARGUMENT
437437
(400) error is returned.
438438
439439
This corresponds to the ``parent`` field
@@ -574,11 +574,10 @@ def get_supported_languages(
574574
575575
- General (built-in) models:
576576
``projects/{project-number-or-id}/locations/{location-id}/models/general/nmt``,
577-
``projects/{project-number-or-id}/locations/{location-id}/models/general/base``
578577
579578
Returns languages supported by the specified model. If
580579
missing, we get supported languages of Google general
581-
base (PBMT) model.
580+
NMT model.
582581
583582
This corresponds to the ``model`` field
584583
on the ``request`` instance; if ``request`` is provided, this

google/cloud/translate_v3beta1/types/translation_service.py

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,12 @@ class TranslateTextRequest(proto.Message):
131131
132132
- General (built-in) models:
133133
``projects/{project-number-or-id}/locations/{location-id}/models/general/nmt``,
134-
``projects/{project-number-or-id}/locations/{location-id}/models/general/base``
135134
136135
For global (non-regionalized) requests, use ``location-id``
137136
``global``. For example,
138137
``projects/{project-number-or-id}/locations/global/models/general/nmt``.
139138
140-
If missing, the system decides which google base model to
141-
use.
139+
If not provided, the default Google model (NMT) will be used
142140
glossary_config (google.cloud.translate_v3beta1.types.TranslateTextGlossaryConfig):
143141
Optional. Glossary to be applied. The glossary must be
144142
within the same region (have the same location-id) as the
@@ -196,6 +194,8 @@ class Translation(proto.Message):
196194
Attributes:
197195
translated_text (str):
198196
Text translated into the target language.
197+
If an error occurs during translation, this
198+
field might be excluded from the response.
199199
model (str):
200200
Only present when ``model`` is present in the request.
201201
``model`` here is normalized to have project number.
@@ -239,9 +239,9 @@ class DetectLanguageRequest(proto.Message):
239239
``projects/{project-number-or-id}/locations/global`` or
240240
``projects/{project-number-or-id}``.
241241
242-
Only models within the same region, which have the same
243-
location-id, can be used. Otherwise an INVALID_ARGUMENT
244-
(400) error is returned.
242+
Only models within the same region (has same location-id)
243+
can be used. Otherwise an INVALID_ARGUMENT (400) error is
244+
returned.
245245
model (str):
246246
Optional. The language detection model to be used.
247247
@@ -342,11 +342,10 @@ class GetSupportedLanguagesRequest(proto.Message):
342342
343343
- General (built-in) models:
344344
``projects/{project-number-or-id}/locations/{location-id}/models/general/nmt``,
345-
``projects/{project-number-or-id}/locations/{location-id}/models/general/base``
346345
347346
Returns languages supported by the specified model. If
348-
missing, we get supported languages of Google general base
349-
(PBMT) model.
347+
missing, we get supported languages of Google general NMT
348+
model.
350349
"""
351350

352351
parent = proto.Field(proto.STRING, number=3,)
@@ -490,13 +489,13 @@ class OutputConfig(proto.Message):
490489
content to output.
491490
492491
Once a row is present in index.csv, the input/output
493-
matching never changes. Callers should also expect the
494-
contents in the input_file are processed and ready to be
495-
consumed (that is, no partial output file is written).
492+
matching never changes. Callers should also expect all the
493+
content in input_file are processed and ready to be consumed
494+
(that is, no partial output file is written).
496495
497-
Since index.csv will be updated during the process, please
498-
make sure there is no custom retention policy applied on the
499-
output bucket that may prevent file updating.
496+
Since index.csv will be keeping updated during the process,
497+
please make sure there is no custom retention policy applied
498+
on the output bucket that may avoid file updating.
500499
(https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
501500
502501
The format of translations_file (for target language code
@@ -653,8 +652,7 @@ class TranslateDocumentRequest(proto.Message):
653652
``projects/{project-number-or-id}/locations/{location-id}``.
654653
655654
For global calls, use
656-
``projects/{project-number-or-id}/locations/global`` or
657-
``projects/{project-number-or-id}``.
655+
``projects/{project-number-or-id}/locations/global``.
658656
659657
Non-global location is required for requests using AutoML
660658
models or custom glossaries.
@@ -696,7 +694,6 @@ class TranslateDocumentRequest(proto.Message):
696694
697695
- General (built-in) models:
698696
``projects/{project-number-or-id}/locations/{location-id}/models/general/nmt``,
699-
``projects/{project-number-or-id}/locations/{location-id}/models/general/base``
700697
701698
If not provided, the default Google model (NMT) will be used
702699
for translation.
@@ -818,9 +815,8 @@ class BatchTranslateTextRequest(proto.Message):
818815
here.
819816
models (Sequence[google.cloud.translate_v3beta1.types.BatchTranslateTextRequest.ModelsEntry]):
820817
Optional. The models to use for translation. Map's key is
821-
target language code. Map's value is the model name. Value
822-
can be a built-in general model, or an AutoML Translation
823-
model.
818+
target language code. Map's value is model name. Value can
819+
be a built-in general model, or an AutoML Translation model.
824820
825821
The value format depends on model type:
826822
@@ -829,7 +825,6 @@ class BatchTranslateTextRequest(proto.Message):
829825
830826
- General (built-in) models:
831827
``projects/{project-number-or-id}/locations/{location-id}/models/general/nmt``,
832-
``projects/{project-number-or-id}/locations/{location-id}/models/general/base``
833828
834829
If the map is empty or a specific model is not requested for
835830
a language pair, then default google model (nmt) is used.
@@ -1284,7 +1279,6 @@ class BatchTranslateDocumentRequest(proto.Message):
12841279
12851280
- General (built-in) models:
12861281
``projects/{project-number-or-id}/locations/{location-id}/models/general/nmt``,
1287-
``projects/{project-number-or-id}/locations/{location-id}/models/general/base``
12881282
12891283
If the map is empty or a specific model is not requested for
12901284
a language pair, then default google model (nmt) is used.
@@ -1328,10 +1322,10 @@ class BatchDocumentInputConfig(proto.Message):
13281322
- ``xlsx``,
13291323
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
13301324
1331-
The max file size supported for ``.docx``, ``.pptx`` and
1332-
``.xlsx`` is 100MB. The max file size supported for ``.pdf``
1333-
is 1GB and the max page limit is 1000 pages. The max file
1334-
size supported for all input documents is 1GB.
1325+
The max file size to support for ``.docx``, ``.pptx`` and
1326+
``.xlsx`` is 100MB. The max file size to support for
1327+
``.pdf`` is 1GB and the max page limit is 1000 pages. The
1328+
max file size to support for all input documents is 1GB.
13351329
"""
13361330

13371331
gcs_source = proto.Field(
@@ -1411,15 +1405,15 @@ class BatchTranslateDocumentResponse(proto.Message):
14111405
Attributes:
14121406
total_pages (int):
14131407
Total number of pages to translate in all
1414-
documents. Documents without a clear page
1408+
documents. Documents without clear page
14151409
definition (such as XLSX) are not counted.
14161410
translated_pages (int):
14171411
Number of successfully translated pages in
1418-
all documents. Documents without a clear page
1412+
all documents. Documents without clear page
14191413
definition (such as XLSX) are not counted.
14201414
failed_pages (int):
14211415
Number of pages that failed to process in all
1422-
documents. Documents without a clear page
1416+
documents. Documents without clear page
14231417
definition (such as XLSX) are not counted.
14241418
total_billable_pages (int):
14251419
Number of billable pages in documents with

0 commit comments

Comments
 (0)