Skip to content

Commit

Permalink
feat(translate): update the api
Browse files Browse the repository at this point in the history
#### translate:v3

The following keys were added:
- schemas.AdaptiveMtTranslateRequest.properties.glossaryConfig.$ref (Total Keys: 1)
- schemas.AdaptiveMtTranslateRequest.properties.referenceSentenceConfig.$ref (Total Keys: 1)
- schemas.AdaptiveMtTranslateResponse.properties.glossaryTranslations (Total Keys: 2)
- schemas.ReferenceSentenceConfig (Total Keys: 6)
- schemas.ReferenceSentencePair (Total Keys: 8)

The following keys were changed:
- resources.projects.resources.locations.resources.glossaries.methods.patch.scopes (Total Keys: 1)
  • Loading branch information
yoshi-automation committed Jul 25, 2024
1 parent ba212b8 commit 8fa1081
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/dyn/translate_v3.projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ <h3>Method Details</h3>
&quot;a_key&quot;: &quot;A String&quot;,
},
&quot;mimeType&quot;: &quot;A String&quot;, # Optional. The format of the source text, for example, &quot;text/html&quot;, &quot;text/plain&quot;. If left blank, the MIME type defaults to &quot;text/html&quot;.
&quot;model&quot;: &quot;A String&quot;, # 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
&quot;model&quot;: &quot;A String&quot;, # 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
&quot;sourceLanguageCode&quot;: &quot;A String&quot;, # Optional. The ISO-639 language code of the input text if known, for example, &quot;en-US&quot; or &quot;sr-Latn&quot;. Supported language codes are listed in Language Support. If the source language isn&#x27;t specified, the API attempts to identify the source language automatically and returns the source language within the response.
&quot;targetLanguageCode&quot;: &quot;A String&quot;, # Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support.
&quot;transliterationConfig&quot;: { # Configures transliteration feature on top of translation. # Optional. Transliteration to be applied.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h3>Method Details</h3>

{ # Represents a single entry in a glossary.
&quot;description&quot;: &quot;A String&quot;, # Describes the glossary entry.
&quot;name&quot;: &quot;A String&quot;, # Required. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
&quot;name&quot;: &quot;A String&quot;, # Identifier. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
&quot;termsPair&quot;: { # Represents a single entry for an unidirectional glossary. # Used for an unidirectional glossary.
&quot;sourceTerm&quot;: { # Represents a single glossary term # The source term is the term that will get match in the text,
&quot;languageCode&quot;: &quot;A String&quot;, # The language for this glossary term.
Expand Down Expand Up @@ -143,7 +143,7 @@ <h3>Method Details</h3>

{ # Represents a single entry in a glossary.
&quot;description&quot;: &quot;A String&quot;, # Describes the glossary entry.
&quot;name&quot;: &quot;A String&quot;, # Required. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
&quot;name&quot;: &quot;A String&quot;, # Identifier. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
&quot;termsPair&quot;: { # Represents a single entry for an unidirectional glossary. # Used for an unidirectional glossary.
&quot;sourceTerm&quot;: { # Represents a single glossary term # The source term is the term that will get match in the text,
&quot;languageCode&quot;: &quot;A String&quot;, # The language for this glossary term.
Expand Down Expand Up @@ -199,7 +199,7 @@ <h3>Method Details</h3>

{ # Represents a single entry in a glossary.
&quot;description&quot;: &quot;A String&quot;, # Describes the glossary entry.
&quot;name&quot;: &quot;A String&quot;, # Required. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
&quot;name&quot;: &quot;A String&quot;, # Identifier. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
&quot;termsPair&quot;: { # Represents a single entry for an unidirectional glossary. # Used for an unidirectional glossary.
&quot;sourceTerm&quot;: { # Represents a single glossary term # The source term is the term that will get match in the text,
&quot;languageCode&quot;: &quot;A String&quot;, # The language for this glossary term.
Expand Down Expand Up @@ -241,7 +241,7 @@ <h3>Method Details</h3>
&quot;glossaryEntries&quot;: [ # Optional. The Glossary Entries
{ # Represents a single entry in a glossary.
&quot;description&quot;: &quot;A String&quot;, # Describes the glossary entry.
&quot;name&quot;: &quot;A String&quot;, # Required. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
&quot;name&quot;: &quot;A String&quot;, # Identifier. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
&quot;termsPair&quot;: { # Represents a single entry for an unidirectional glossary. # Used for an unidirectional glossary.
&quot;sourceTerm&quot;: { # Represents a single glossary term # The source term is the term that will get match in the text,
&quot;languageCode&quot;: &quot;A String&quot;, # The language for this glossary term.
Expand Down Expand Up @@ -285,13 +285,13 @@ <h3>Method Details</h3>
<pre>Updates a glossary entry.

Args:
name: string, Required. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot; (required)
name: string, Identifier. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot; (required)
body: object, The request body.
The object takes the form of:

{ # Represents a single entry in a glossary.
&quot;description&quot;: &quot;A String&quot;, # Describes the glossary entry.
&quot;name&quot;: &quot;A String&quot;, # Required. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
&quot;name&quot;: &quot;A String&quot;, # Identifier. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
&quot;termsPair&quot;: { # Represents a single entry for an unidirectional glossary. # Used for an unidirectional glossary.
&quot;sourceTerm&quot;: { # Represents a single glossary term # The source term is the term that will get match in the text,
&quot;languageCode&quot;: &quot;A String&quot;, # The language for this glossary term.
Expand Down Expand Up @@ -322,7 +322,7 @@ <h3>Method Details</h3>

{ # Represents a single entry in a glossary.
&quot;description&quot;: &quot;A String&quot;, # Describes the glossary entry.
&quot;name&quot;: &quot;A String&quot;, # Required. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
&quot;name&quot;: &quot;A String&quot;, # Identifier. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
&quot;termsPair&quot;: { # Represents a single entry for an unidirectional glossary. # Used for an unidirectional glossary.
&quot;sourceTerm&quot;: { # Represents a single glossary term # The source term is the term that will get match in the text,
&quot;languageCode&quot;: &quot;A String&quot;, # The language for this glossary term.
Expand Down
27 changes: 25 additions & 2 deletions docs/dyn/translate_v3.projects.locations.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,28 @@ <h3>Method Details</h3>
The object takes the form of:

{ # The request for sending an AdaptiveMt translation query.
&quot;content&quot;: [ # Required. The content of the input in string format. For now only one sentence per request is supported.
&quot;content&quot;: [ # Required. The content of the input in string format.
&quot;A String&quot;,
],
&quot;dataset&quot;: &quot;A String&quot;, # Required. The resource name for the dataset to use for adaptive MT. `projects/{project}/locations/{location-id}/adaptiveMtDatasets/{dataset}`
&quot;glossaryConfig&quot;: { # Configures which glossary is used for a specific target language and defines options for applying that glossary. # 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.
&quot;glossary&quot;: &quot;A String&quot;, # Required. The `glossary` to be applied for this translation. The format depends on the glossary: - User-provided custom glossary: `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`
&quot;ignoreCase&quot;: True or False, # Optional. Indicates match is case insensitive. The default value is `false` if missing.
},
&quot;referenceSentenceConfig&quot;: { # Message of caller-provided reference configuration. # Configuration for caller provided reference sentences.
&quot;referenceSentencePairLists&quot;: [ # Reference sentences pair lists. Each list will be used as the references to translate the sentence under &quot;content&quot; field at the corresponding index. Length of the list is required to be equal to the length of &quot;content&quot; field.
{ # A list of reference sentence pairs.
&quot;referenceSentencePairs&quot;: [ # Reference sentence pairs.
{ # A pair of sentences used as reference in source and target languages.
&quot;sourceSentence&quot;: &quot;A String&quot;, # Source sentence in the sentence pair.
&quot;targetSentence&quot;: &quot;A String&quot;, # Target sentence in the sentence pair.
},
],
},
],
&quot;sourceLanguageCode&quot;: &quot;A String&quot;, # Source language code.
&quot;targetLanguageCode&quot;: &quot;A String&quot;, # Target language code.
},
}

x__xgafv: string, V1 error format.
Expand All @@ -161,6 +179,11 @@ <h3>Method Details</h3>
An object of the form:

{ # An AdaptiveMtTranslate response.
&quot;glossaryTranslations&quot;: [ # Text translation response if a glossary is provided in the request. This could be the same as &#x27;translation&#x27; above if no terms apply.
{ # An AdaptiveMt translation.
&quot;translatedText&quot;: &quot;A String&quot;, # Output only. The translated text.
},
],
&quot;languageCode&quot;: &quot;A String&quot;, # Output only. The translation&#x27;s language code.
&quot;translations&quot;: [ # Output only. The translation.
{ # An AdaptiveMt translation.
Expand Down Expand Up @@ -582,7 +605,7 @@ <h3>Method Details</h3>
&quot;a_key&quot;: &quot;A String&quot;,
},
&quot;mimeType&quot;: &quot;A String&quot;, # Optional. The format of the source text, for example, &quot;text/html&quot;, &quot;text/plain&quot;. If left blank, the MIME type defaults to &quot;text/html&quot;.
&quot;model&quot;: &quot;A String&quot;, # 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
&quot;model&quot;: &quot;A String&quot;, # 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
&quot;sourceLanguageCode&quot;: &quot;A String&quot;, # Optional. The ISO-639 language code of the input text if known, for example, &quot;en-US&quot; or &quot;sr-Latn&quot;. Supported language codes are listed in Language Support. If the source language isn&#x27;t specified, the API attempts to identify the source language automatically and returns the source language within the response.
&quot;targetLanguageCode&quot;: &quot;A String&quot;, # Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support.
&quot;transliterationConfig&quot;: { # Configures transliteration feature on top of translation. # Optional. Transliteration to be applied.
Expand Down
79 changes: 73 additions & 6 deletions googleapiclient/discovery_cache/documents/translate.v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,8 @@
"$ref": "Operation"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-translation"
]
}
},
Expand Down Expand Up @@ -1395,7 +1396,7 @@
],
"parameters": {
"name": {
"description": "Required. The resource name of the entry. Format: \"projects/*/locations/*/glossaries/*/glossaryEntries/*\"",
"description": "Identifier. The resource name of the entry. Format: \"projects/*/locations/*/glossaries/*/glossaryEntries/*\"",
"location": "path",
"pattern": "^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/glossaryEntries/[^/]+$",
"required": true,
Expand Down Expand Up @@ -1706,7 +1707,7 @@
}
}
},
"revision": "20240301",
"revision": "20240718",
"rootUrl": "https://translation.googleapis.com/",
"schemas": {
"AdaptiveMtDataset": {
Expand Down Expand Up @@ -1817,7 +1818,7 @@
"id": "AdaptiveMtTranslateRequest",
"properties": {
"content": {
"description": "Required. The content of the input in string format. For now only one sentence per request is supported.",
"description": "Required. The content of the input in string format.",
"items": {
"type": "string"
},
Expand All @@ -1826,6 +1827,14 @@
"dataset": {
"description": "Required. The resource name for the dataset to use for adaptive MT. `projects/{project}/locations/{location-id}/adaptiveMtDatasets/{dataset}`",
"type": "string"
},
"glossaryConfig": {
"$ref": "TranslateTextGlossaryConfig",
"description": "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."
},
"referenceSentenceConfig": {
"$ref": "ReferenceSentenceConfig",
"description": "Configuration for caller provided reference sentences."
}
},
"type": "object"
Expand All @@ -1834,6 +1843,13 @@
"description": "An AdaptiveMtTranslate response.",
"id": "AdaptiveMtTranslateResponse",
"properties": {
"glossaryTranslations": {
"description": "Text translation response if a glossary is provided in the request. This could be the same as 'translation' above if no terms apply.",
"items": {
"$ref": "AdaptiveMtTranslation"
},
"type": "array"
},
"languageCode": {
"description": "Output only. The translation's language code.",
"readOnly": true,
Expand Down Expand Up @@ -2360,7 +2376,7 @@
"type": "string"
},
"name": {
"description": "Required. The resource name of the entry. Format: \"projects/*/locations/*/glossaries/*/glossaryEntries/*\"",
"description": "Identifier. The resource name of the entry. Format: \"projects/*/locations/*/glossaries/*/glossaryEntries/*\"",
"type": "string"
},
"termsPair": {
Expand Down Expand Up @@ -2848,6 +2864,57 @@
},
"type": "object"
},
"ReferenceSentenceConfig": {
"description": "Message of caller-provided reference configuration.",
"id": "ReferenceSentenceConfig",
"properties": {
"referenceSentencePairLists": {
"description": "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.",
"items": {
"$ref": "ReferenceSentencePairList"
},
"type": "array"
},
"sourceLanguageCode": {
"description": "Source language code.",
"type": "string"
},
"targetLanguageCode": {
"description": "Target language code.",
"type": "string"
}
},
"type": "object"
},
"ReferenceSentencePair": {
"description": "A pair of sentences used as reference in source and target languages.",
"id": "ReferenceSentencePair",
"properties": {
"sourceSentence": {
"description": "Source sentence in the sentence pair.",
"type": "string"
},
"targetSentence": {
"description": "Target sentence in the sentence pair.",
"type": "string"
}
},
"type": "object"
},
"ReferenceSentencePairList": {
"description": "A list of reference sentence pairs.",
"id": "ReferenceSentencePairList",
"properties": {
"referenceSentencePairs": {
"description": "Reference sentence pairs.",
"items": {
"$ref": "ReferenceSentencePair"
},
"type": "array"
}
},
"type": "object"
},
"Romanization": {
"description": "A single romanization response.",
"id": "Romanization",
Expand Down Expand Up @@ -3078,7 +3145,7 @@
"type": "string"
},
"model": {
"description": "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",
"description": "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",
"type": "string"
},
"sourceLanguageCode": {
Expand Down

0 comments on commit 8fa1081

Please sign in to comment.