I think that you can essentially just combine the JSON of the glossary and model requests.
The HTTP method and URL is the same.
https://cloud.google.com/translate/docs/advanced/glossary#translate_v3_get_glossary-drest
HTTP method and URL:
POST https://translation.googleapis.com/v3/projects/PROJECT_NUMBER_OR_ID/locations/us-central1:translateText
Request JSON body:
{
"sourceLanguageCode": "en",
"targetLanguageCode": "ru",
"contents": "Dr. Watson, please discard your trash. You've shared > unsolicited email with me. Let's talk about spam and importance ranking in a confidential mode.",
"glossaryConfig": {
"glossary": "projects/project-number/locations/us-> central1/glossaries/glossary-id",
"ignoreCase": BOOLEAN
}
}
https://cloud.google.com/translate/automl/docs/predict#using-translate-api
HTTP method and URL:
POST https://translation.googleapis.com/v3/projects/project-number-or-id/locations/us-central1:translateText
Request JSON body:
{
"model": "projects/project-number-or-id/locations/us-central1/models/TRL1395675701985363739",
"sourceLanguageCode": "en",
"targetLanguageCode": "ru",
"contents": ["Dr. Watson, please discard your trash. You've shared unsolicited email with me.
Let's talk about spam and importance ranking in a confidential mode."]
}
You will end up with something like this.
{
"model": "projects/project-number-or-id/locations/us-central1/models/TRL1395675701985363739",
"glossaryConfig": {
"glossary": "projects/project-number/locations/us-> central1/glossaries/glossary-id",
"ignoreCase": BOOLEAN
}
"sourceLanguageCode": "en",
"targetLanguageCode": "ru",
"contents": ["Dr. Watson, please discard your trash. You've shared unsolicited email with me.
Let's talk about spam and importance ranking in a confidential mode."]
}