fix: add missing annotation for batch document translation

PiperOrigin-RevId: 392949968
pull/672/head
Google APIs 4 years ago committed by Copybara-Service
parent be31a88c16
commit 41e44ac100
  1. 43
      google/cloud/translate/v3beta1/translation_service.proto

@ -239,14 +239,13 @@ message TranslateTextRequest {
// //
// - General (built-in) models: // - General (built-in) models:
// `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
// `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
// //
// //
// For global (non-regionalized) requests, use `location-id` `global`. // For global (non-regionalized) requests, use `location-id` `global`.
// For example, // For example,
// `projects/{project-number-or-id}/locations/global/models/general/nmt`. // `projects/{project-number-or-id}/locations/global/models/general/nmt`.
// //
// If missing, the system decides which google base model to use. // If not provided, the default Google model (NMT) will be used
string model = 6 [(google.api.field_behavior) = OPTIONAL]; string model = 6 [(google.api.field_behavior) = OPTIONAL];
// Optional. Glossary to be applied. The glossary must be // Optional. Glossary to be applied. The glossary must be
@ -283,6 +282,8 @@ message TranslateTextResponse {
// A single translation response. // A single translation response.
message Translation { message Translation {
// Text translated into the target language. // Text translated into the target language.
// If an error occurs during translation, this field might be excluded from
// the response.
string translated_text = 1; string translated_text = 1;
// Only present when `model` is present in the request. // Only present when `model` is present in the request.
@ -316,7 +317,7 @@ message DetectLanguageRequest {
// For global calls, use `projects/{project-number-or-id}/locations/global` or // For global calls, use `projects/{project-number-or-id}/locations/global` or
// `projects/{project-number-or-id}`. // `projects/{project-number-or-id}`.
// //
// Only models within the same region, which have the same location-id, can be used. // Only models within the same region (has same location-id) can be used.
// Otherwise an INVALID_ARGUMENT (400) error is returned. // Otherwise an INVALID_ARGUMENT (400) error is returned.
string parent = 5 [ string parent = 5 [
(google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = REQUIRED,
@ -410,11 +411,10 @@ message GetSupportedLanguagesRequest {
// //
// - General (built-in) models: // - General (built-in) models:
// `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
// `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
// //
// //
// Returns languages supported by the specified model. // Returns languages supported by the specified model.
// If missing, we get supported languages of Google general base (PBMT) model. // If missing, we get supported languages of Google general NMT model.
string model = 2 [(google.api.field_behavior) = OPTIONAL]; string model = 2 [(google.api.field_behavior) = OPTIONAL];
} }
@ -523,13 +523,13 @@ message OutputConfig {
// content to output. // content to output.
// //
// Once a row is present in index.csv, the input/output matching never // Once a row is present in index.csv, the input/output matching never
// changes. Callers should also expect the contents in the input_file are // 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 // processed and ready to be consumed (that is, no partial output file is
// written). // written).
// //
// Since index.csv will be updated during the process, please make // Since index.csv will be keeping updated during the process, please make
// sure there is no custom retention policy applied on the output bucket // sure there is no custom retention policy applied on the output bucket
// that may prevent file updating. // that may avoid file updating.
// (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) // (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
// //
// The format of translations_file (for target language code 'trg') is: // The format of translations_file (for target language code 'trg') is:
@ -674,8 +674,7 @@ message TranslateDocumentRequest {
// //
// Format: `projects/{project-number-or-id}/locations/{location-id}`. // Format: `projects/{project-number-or-id}/locations/{location-id}`.
// //
// For global calls, use `projects/{project-number-or-id}/locations/global` or // For global calls, use `projects/{project-number-or-id}/locations/global`.
// `projects/{project-number-or-id}`.
// //
// Non-global location is required for requests using AutoML models or custom // Non-global location is required for requests using AutoML models or custom
// glossaries. // glossaries.
@ -717,7 +716,6 @@ message TranslateDocumentRequest {
// //
// - General (built-in) models: // - General (built-in) models:
// `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
// `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
// //
// //
// If not provided, the default Google model (NMT) will be used for // If not provided, the default Google model (NMT) will be used for
@ -810,7 +808,7 @@ message BatchTranslateTextRequest {
[(google.api.field_behavior) = REQUIRED]; [(google.api.field_behavior) = REQUIRED];
// Optional. The models to use for translation. Map's key is target language // Optional. The models to use for translation. Map's key is target language
// code. Map's value is the model name. Value can be a built-in general model, // code. Map's value is model name. Value can be a built-in general model,
// or an AutoML Translation model. // or an AutoML Translation model.
// //
// The value format depends on model type: // The value format depends on model type:
@ -820,7 +818,6 @@ message BatchTranslateTextRequest {
// //
// - General (built-in) models: // - General (built-in) models:
// `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
// `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
// //
// //
// If the map is empty or a specific model is // If the map is empty or a specific model is
@ -1194,7 +1191,12 @@ message BatchTranslateDocumentRequest {
// Only AutoML Translation models or glossaries within the same region (have // Only AutoML Translation models or glossaries within the same region (have
// the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) // the same location-id) can be used, otherwise an INVALID_ARGUMENT (400)
// error is returned. // error is returned.
string parent = 1 [(google.api.field_behavior) = REQUIRED]; string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];
// Required. The BCP-47 language code of the input document if known, for // Required. The BCP-47 language code of the input document if known, for
// example, "en-US" or "sr-Latn". Supported language codes are listed in // example, "en-US" or "sr-Latn". Supported language codes are listed in
@ -1230,7 +1232,6 @@ message BatchTranslateDocumentRequest {
// //
// - General (built-in) models: // - General (built-in) models:
// `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
// `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
// //
// //
// If the map is empty or a specific model is not requested for a language // If the map is empty or a specific model is not requested for a language
@ -1261,10 +1262,10 @@ message BatchDocumentInputConfig {
// - `xlsx`, // - `xlsx`,
// application/vnd.openxmlformats-officedocument.spreadsheetml.sheet // application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
// //
// The max file size supported for `.docx`, `.pptx` and `.xlsx` is 100MB. // The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB.
// The max file size supported for `.pdf` is 1GB and the max page limit is // The max file size to support for `.pdf` is 1GB and the max page limit is
// 1000 pages. // 1000 pages.
// The max file size supported for all input documents is 1GB. // The max file size to support for all input documents is 1GB.
GcsSource gcs_source = 1; GcsSource gcs_source = 1;
} }
} }
@ -1328,16 +1329,16 @@ message BatchDocumentOutputConfig {
// field returned by BatchTranslateDocument if at least one document is // field returned by BatchTranslateDocument if at least one document is
// translated successfully. // translated successfully.
message BatchTranslateDocumentResponse { message BatchTranslateDocumentResponse {
// Total number of pages to translate in all documents. Documents without a // Total number of pages to translate in all documents. Documents without
// clear page definition (such as XLSX) are not counted. // clear page definition (such as XLSX) are not counted.
int64 total_pages = 1; int64 total_pages = 1;
// Number of successfully translated pages in all documents. Documents without // Number of successfully translated pages in all documents. Documents without
// a clear page definition (such as XLSX) are not counted. // clear page definition (such as XLSX) are not counted.
int64 translated_pages = 2; int64 translated_pages = 2;
// Number of pages that failed to process in all documents. Documents without // Number of pages that failed to process in all documents. Documents without
// a clear page definition (such as XLSX) are not counted. // clear page definition (such as XLSX) are not counted.
int64 failed_pages = 3; int64 failed_pages = 3;
// Number of billable pages in documents with clear page definition (such as // Number of billable pages in documents with clear page definition (such as

Loading…
Cancel
Save