From f8d346b279b167e9c0f6d795e2a8e76bec14a5e8 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 21 Mar 2025 17:34:37 -0700 Subject: [PATCH 001/119] Update translate call to 2025-05-01 --- ...FindSentenceBoundaries_MaximumSet_Gen.json | 28 + ...FindSentenceBoundaries_MinimumSet_Gen.json | 29 + .../GetSupportedLanguages_MaximumSet_Gen.json | 80 + .../GetSupportedLanguages_MinimumSet_Gen.json | 12 + ...ookupDictionaryEntries_MaximumSet_Gen.json | 87 + ...ookupDictionaryEntries_MinimumSet_Gen.json | 86 + ...okupDictionaryExamples_MaximumSet_Gen.json | 44 + ...okupDictionaryExamples_MinimumSet_Gen.json | 43 + .../examples/Translate_MaximumSet_Gen.json | 63 + .../examples/Translate_MinimumSet_Gen.json | 29 + .../Transliterate_MaximumSet_Gen.json | 26 + .../Transliterate_MinimumSet_Gen.json | 25 + .../preview/2025-05-01/openapi.json | 1716 +++++++++++++++++ 13 files changed, 2268 insertions(+) create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/FindSentenceBoundaries_MaximumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/FindSentenceBoundaries_MinimumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/GetSupportedLanguages_MaximumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/GetSupportedLanguages_MinimumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryEntries_MaximumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryEntries_MinimumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryExamples_MaximumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryExamples_MinimumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Translate_MaximumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Translate_MinimumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Transliterate_MaximumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Transliterate_MinimumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/FindSentenceBoundaries_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/FindSentenceBoundaries_MaximumSet_Gen.json new file mode 100644 index 000000000000..1847c3f5e3d3 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/FindSentenceBoundaries_MaximumSet_Gen.json @@ -0,0 +1,28 @@ +{ + "title": "Find Sentence Boundaries", + "operationId": "FindSentenceBoundaries", + "parameters": { + "X-ClientTraceId": "svun", + "language": "en", + "script": "Latn", + "api-version": "3.0", + "body": [ + { + "text": "How are you? I am fine. What did you do today?" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "sentLen": [ + 13, + 11, + 22 + ] + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/FindSentenceBoundaries_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/FindSentenceBoundaries_MinimumSet_Gen.json new file mode 100644 index 000000000000..4175072f8566 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/FindSentenceBoundaries_MinimumSet_Gen.json @@ -0,0 +1,29 @@ +{ + "title": "Find Sentence Boundaries with minimum properties", + "operationId": "FindSentenceBoundaries", + "parameters": { + "api-version": "3.0", + "body": [ + { + "text": "How are you? I am fine. What did you do today?" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "detectedLanguage": { + "language": "en", + "score": 1.0 + }, + "sentLen": [ + 13, + 11, + 22 + ] + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/GetSupportedLanguages_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/GetSupportedLanguages_MaximumSet_Gen.json new file mode 100644 index 000000000000..0fdb83142178 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/GetSupportedLanguages_MaximumSet_Gen.json @@ -0,0 +1,80 @@ +{ + "title": "Gets the set of languages currently supported by other operations of the Translator.", + "operationId": "GetSupportedLanguages", + "parameters": { + "X-ClientTraceId": "kayfnugjec", + "scope": "translation,transliteration,dictionary", + "Accept-Language": "en", + "If-None-Match": "fpnhruttllvc", + "api-version": "3.0" + }, + "responses": { + "200": { + "body": { + "translation": { + "en": { + "name": "English", + "nativeName": "English", + "dir": "ltr" + }, + "es": { + "name": "Spanish", + "nativeName": "Español", + "dir": "ltr" + } + }, + "transliteration": { + "ar": { + "name": "Arabic", + "nativeName": "العربية", + "scripts": [ + { + "code": "Arab", + "name": "Arabic", + "nativeName": "العربية", + "dir": "rtl", + "toScripts": [ + { + "code": "Latn", + "name": "Latin", + "nativeName": "اللاتينية", + "dir": "ltr" + } + ] + }, + { + "code": "Latn", + "name": "Latin", + "nativeName": "اللاتينية", + "dir": "ltr", + "toScripts": [ + { + "code": "Arab", + "name": "Arabic", + "nativeName": "العربية", + "dir": "rtl" + } + ] + } + ] + } + }, + "dictionary": { + "cs": { + "name": "Czech", + "nativeName": "Čeština", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + } + } + } + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/GetSupportedLanguages_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/GetSupportedLanguages_MinimumSet_Gen.json new file mode 100644 index 000000000000..5f8405e887d9 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/GetSupportedLanguages_MinimumSet_Gen.json @@ -0,0 +1,12 @@ +{ + "title": "Gets the set of languages currently supported by other operations of the Translator with minimum properties.", + "operationId": "GetSupportedLanguages", + "parameters": { + "api-version": "3.0" + }, + "responses": { + "200": { + "body": {} + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryEntries_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryEntries_MaximumSet_Gen.json new file mode 100644 index 000000000000..636eb73b04f6 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryEntries_MaximumSet_Gen.json @@ -0,0 +1,87 @@ +{ + "title": "Lookup Dictionary Entries", + "operationId": "LookupDictionaryEntries", + "parameters": { + "X-ClientTraceId": "yqst", + "from": "en", + "to": "es", + "api-version": "3.0", + "body": [ + { + "text": "fly" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "normalizedSource": "fly", + "displaySource": "fly", + "translations": [ + { + "normalizedTarget": "volar", + "displayTarget": "volar", + "posTag": "VERB", + "confidence": 0.4081, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 4637 + }, + { + "normalizedText": "flying", + "displayText": "flying", + "numExamples": 15, + "frequencyCount": 1365 + }, + { + "normalizedText": "blow", + "displayText": "blow", + "numExamples": 15, + "frequencyCount": 503 + }, + { + "normalizedText": "flight", + "displayText": "flight", + "numExamples": 15, + "frequencyCount": 135 + } + ] + }, + { + "normalizedTarget": "mosca", + "displayTarget": "mosca", + "posTag": "NOUN", + "confidence": 0.2668, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 1697 + }, + { + "normalizedText": "flyweight", + "displayText": "flyweight", + "numExamples": 0, + "frequencyCount": 48 + }, + { + "normalizedText": "flies", + "displayText": "flies", + "numExamples": 9, + "frequencyCount": 34 + } + ] + } + ] + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryEntries_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryEntries_MinimumSet_Gen.json new file mode 100644 index 000000000000..dfc24a03bdea --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryEntries_MinimumSet_Gen.json @@ -0,0 +1,86 @@ +{ + "title": "Lookup Dictionary Entries with minimum properties", + "operationId": "LookupDictionaryEntries", + "parameters": { + "from": "en", + "to": "es", + "api-version": "3.0", + "body": [ + { + "text": "fly" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "normalizedSource": "fly", + "displaySource": "fly", + "translations": [ + { + "normalizedTarget": "volar", + "displayTarget": "volar", + "posTag": "VERB", + "confidence": 0.4081, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 4637 + }, + { + "normalizedText": "flying", + "displayText": "flying", + "numExamples": 15, + "frequencyCount": 1365 + }, + { + "normalizedText": "blow", + "displayText": "blow", + "numExamples": 15, + "frequencyCount": 503 + }, + { + "normalizedText": "flight", + "displayText": "flight", + "numExamples": 15, + "frequencyCount": 135 + } + ] + }, + { + "normalizedTarget": "mosca", + "displayTarget": "mosca", + "posTag": "NOUN", + "confidence": 0.2668, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 1697 + }, + { + "normalizedText": "flyweight", + "displayText": "flyweight", + "numExamples": 0, + "frequencyCount": 48 + }, + { + "normalizedText": "flies", + "displayText": "flies", + "numExamples": 9, + "frequencyCount": 34 + } + ] + } + ] + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryExamples_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryExamples_MaximumSet_Gen.json new file mode 100644 index 000000000000..00c751e3e39c --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryExamples_MaximumSet_Gen.json @@ -0,0 +1,44 @@ +{ + "title": "Lookup Dictionary Examples", + "operationId": "LookupDictionaryExamples", + "parameters": { + "X-ClientTraceId": "vykwwekvcncclrmsyjhbok", + "from": "en", + "to": "es", + "api-version": "3.0", + "body": [ + { + "text": "fly", + "translation": "volar" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "normalizedSource": "fly", + "normalizedTarget": "volar", + "examples": [ + { + "sourcePrefix": "They need machines to ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Necesitan máquinas para ", + "targetTerm": "volar", + "targetSuffix": "." + }, + { + "sourcePrefix": "That should really ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Eso realmente debe ", + "targetTerm": "volar", + "targetSuffix": "." + } + ] + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryExamples_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryExamples_MinimumSet_Gen.json new file mode 100644 index 000000000000..7f2b08865c25 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryExamples_MinimumSet_Gen.json @@ -0,0 +1,43 @@ +{ + "title": "Lookup Dictionary Examples with minimum properties", + "operationId": "LookupDictionaryExamples", + "parameters": { + "from": "en", + "to": "es", + "api-version": "3.0", + "body": [ + { + "text": "fly", + "translation": "volar" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "normalizedSource": "fly", + "normalizedTarget": "volar", + "examples": [ + { + "sourcePrefix": "They need machines to ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Necesitan máquinas para ", + "targetTerm": "volar", + "targetSuffix": "." + }, + { + "sourcePrefix": "That should really ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Eso realmente debe ", + "targetTerm": "volar", + "targetSuffix": "." + } + ] + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Translate_MaximumSet_Gen.json new file mode 100644 index 000000000000..06f74471d1df --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Translate_MaximumSet_Gen.json @@ -0,0 +1,63 @@ +{ + "title": "Translate Text", + "operationId": "Translate", + "parameters": { + "X-ClientTraceId": "ndbkaatzsnoetqkiehappoza", + "to": [ + "cs" + ], + "from": "en", + "textType": "Plain", + "category": "custom", + "profanityAction": "NoAction", + "profanityMarker": "Asterisk", + "includeAlignment": true, + "includeSentenceLength": true, + "suggestedFrom": "en", + "fromScript": "Latn", + "toScript": "Latn", + "allowFallback": true, + "api-version": "3.0", + "body": [ + { + "text": "This is a test." + } + ] + }, + "responses": { + "200": { + "body": [ + { + "detectedLanguage": { + "language": "en", + "score": 1.0 + }, + "translations": [ + { + "to": "cs", + "text": "Tohle je test.", + "transliteration": { + "text": "Tohle je test.", + "script": "Latn" + }, + "alignment": { + "proj": "okrxvzsagjgzrrv" + }, + "sentLen": { + "srcSentLen": [ + 30 + ], + "transSentLen": [ + 24 + ] + } + } + ], + "sourceText": { + "text": "This is a test" + } + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Translate_MinimumSet_Gen.json new file mode 100644 index 000000000000..b29982929425 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Translate_MinimumSet_Gen.json @@ -0,0 +1,29 @@ +{ + "title": "Translate Text with minimum properties", + "operationId": "Translate", + "parameters": { + "to": [ + "fmlxpuepn" + ], + "api-version": "3.0", + "body": [ + { + "text": "This is a test." + } + ] + }, + "responses": { + "200": { + "body": [ + { + "translations": [ + { + "text": "Tohle je test.", + "to": "cs" + } + ] + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Transliterate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Transliterate_MaximumSet_Gen.json new file mode 100644 index 000000000000..92f67b4a62d3 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Transliterate_MaximumSet_Gen.json @@ -0,0 +1,26 @@ +{ + "title": "Transliterate Text", + "operationId": "Transliterate", + "parameters": { + "X-ClientTraceId": "dzncrimwmvtwjnheh", + "language": "zh-Hans", + "fromScript": "Hans", + "toScript": "Latn", + "api-version": "3.0", + "body": [ + { + "text": "这是个测试。" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "text": "zhè shì gè cè shì。", + "script": "Latn" + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Transliterate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Transliterate_MinimumSet_Gen.json new file mode 100644 index 000000000000..24c5aee2ffb1 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Transliterate_MinimumSet_Gen.json @@ -0,0 +1,25 @@ +{ + "title": "Transliterate Text with minimum properties", + "operationId": "Transliterate", + "parameters": { + "language": "zh-Hans", + "fromScript": "Hans", + "toScript": "Latn", + "api-version": "3.0", + "body": [ + { + "text": "这是个测试。" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "text": "zhè shì gè cè shì。", + "script": "Latn" + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json new file mode 100644 index 000000000000..94a9b4201357 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json @@ -0,0 +1,1716 @@ +{ + "swagger": "2.0", + "info": { + "title": "Text Translation", + "version": "3.0", + "description": "Text translation is a cloud-based REST API feature of the Translator service that uses neural\nmachine translation technology to enable quick and accurate source-to-target text translation\nin real time across all supported languages.\n\nThe following methods are supported by the Text Translation feature:\n\nLanguages. Returns a list of languages supported by Translate, Transliterate, and Dictionary Lookup operations.\n\nTranslate. Renders single source-language text to multiple target-language texts with a single request.\n\nTransliterate. Converts characters or letters of a source language to the corresponding characters or letters of a target language.\n\nDetect. Returns the source code language code and a boolean variable denoting whether the detected language is supported for text translation and transliteration.\n\nDictionary lookup. Returns equivalent words for the source term in the target language.\n\nDictionary example Returns grammatical structure and context examples for the source term and target term pair.", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "Endpoint", + "in": "path", + "description": "Supported Text Translation endpoints (protocol and hostname, for example:\n https://api.cognitive.microsofttranslator.com).", + "required": true, + "type": "string", + "format": "uri", + "x-ms-skip-url-encoding": true + } + ] + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": { + "/breaksentence": { + "post": { + "operationId": "FindSentenceBoundaries", + "summary": "Find Sentence Boundaries", + "description": "Find Sentence Boundaries", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "description": "A client-generated GUID to uniquely identify the request.", + "required": false, + "type": "string", + "x-ms-client-name": "clientTraceId" + }, + { + "$ref": "#/parameters/BreakSentenceParameters.language" + }, + { + "$ref": "#/parameters/BreakSentenceParameters.script" + }, + { + "name": "api-version", + "in": "query", + "description": "Mandatory API version parameter", + "required": true, + "type": "string", + "x-ms-client-name": "apiVersion" + }, + { + "name": "body", + "in": "body", + "description": "Defines the content of the request", + "required": true, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [] + } + } + ], + "responses": { + "200": { + "description": "Response for the Break SEntence API.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/BreakSentenceItem" + }, + "x-ms-identifiers": [] + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + } + }, + "x-ms-examples": { + "Find Sentence Boundaries": { + "$ref": "./examples/FindSentenceBoundaries_MaximumSet_Gen.json" + }, + "Find Sentence Boundaries with minimum properties": { + "$ref": "./examples/FindSentenceBoundaries_MinimumSet_Gen.json" + } + } + } + }, + "/dictionary/examples": { + "post": { + "operationId": "LookupDictionaryExamples", + "summary": "Lookup Dictionary Examples", + "description": "Lookup Dictionary Examples", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "description": "A client-generated GUID to uniquely identify the request.", + "required": false, + "type": "string", + "x-ms-client-name": "clientTraceId" + }, + { + "$ref": "#/parameters/DictionaryExamplesParameters.from" + }, + { + "$ref": "#/parameters/DictionaryExamplesParameters.to" + }, + { + "name": "api-version", + "in": "query", + "description": "Mandatory API version parameter", + "required": true, + "type": "string", + "x-ms-client-name": "apiVersion" + }, + { + "name": "body", + "in": "body", + "description": "Defines the content of the request", + "required": true, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryExampleTextItem" + }, + "x-ms-identifiers": [] + } + } + ], + "responses": { + "200": { + "description": "Response for the dictionary examples API.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryExampleItem" + }, + "x-ms-identifiers": [] + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + } + }, + "x-ms-examples": { + "Lookup Dictionary Examples": { + "$ref": "./examples/LookupDictionaryExamples_MaximumSet_Gen.json" + }, + "Lookup Dictionary Examples with minimum properties": { + "$ref": "./examples/LookupDictionaryExamples_MinimumSet_Gen.json" + } + } + } + }, + "/dictionary/lookup": { + "post": { + "operationId": "LookupDictionaryEntries", + "summary": "Lookup Dictionary Entries", + "description": "Lookup Dictionary Entries", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "description": "A client-generated GUID to uniquely identify the request.", + "required": false, + "type": "string", + "x-ms-client-name": "clientTraceId" + }, + { + "$ref": "#/parameters/DictionaryLookupParameters.from" + }, + { + "$ref": "#/parameters/DictionaryLookupParameters.to" + }, + { + "name": "api-version", + "in": "query", + "description": "Mandatory API version parameter", + "required": true, + "type": "string", + "x-ms-client-name": "apiVersion" + }, + { + "name": "body", + "in": "body", + "description": "Defines the content of the request", + "required": true, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [] + } + } + ], + "responses": { + "200": { + "description": "Response for the dictionary lookup API.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryLookupItem" + }, + "x-ms-identifiers": [] + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + } + }, + "x-ms-examples": { + "Lookup Dictionary Entries": { + "$ref": "./examples/LookupDictionaryEntries_MaximumSet_Gen.json" + }, + "Lookup Dictionary Entries with minimum properties": { + "$ref": "./examples/LookupDictionaryEntries_MinimumSet_Gen.json" + } + } + } + }, + "/languages": { + "get": { + "operationId": "GetSupportedLanguages", + "summary": "Gets the set of languages currently supported by other operations of the Translator.", + "description": "Gets the set of languages currently supported by other operations of the Translator.", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "description": "A client-generated GUID to uniquely identify the request.", + "required": false, + "type": "string", + "x-ms-client-name": "clientTraceId" + }, + { + "$ref": "#/parameters/GetSupportedLanguagesParameters.scope" + }, + { + "$ref": "#/parameters/GetSupportedLanguagesParameters.acceptLanguage" + }, + { + "$ref": "#/parameters/GetSupportedLanguagesParameters.ifNoneMatch" + }, + { + "name": "api-version", + "in": "query", + "description": "Mandatory API version parameter", + "required": true, + "type": "string", + "x-ms-client-name": "apiVersion" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/GetSupportedLanguagesResult" + }, + "headers": { + "ETag": { + "type": "string", + "description": "Current value of the entity tag for the requested groups of supported languages. \nTo make subsequent requests more efficient, the client may send the `ETag` value in an \n`If-None-Match` header field." + }, + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + } + }, + "x-ms-examples": { + "Gets the set of languages currently supported by other operations of the Translator with minimum properties.": { + "$ref": "./examples/GetSupportedLanguages_MinimumSet_Gen.json" + }, + "Gets the set of languages currently supported by other operations of the Translator.": { + "$ref": "./examples/GetSupportedLanguages_MaximumSet_Gen.json" + } + } + } + }, + "/translate": { + "post": { + "operationId": "Translate", + "summary": "Translate Text", + "description": "Translate Text", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "description": "A client-generated GUID to uniquely identify the request.", + "required": false, + "type": "string", + "x-ms-client-name": "clientTraceId" + }, + { + "name": "targets.language", + "in": "body", + "description":"The language code for the source text. If not specified, the system will autodetect the language of the source text. Possible values are list of language code supported by the specified model.", + "required": false, + "type":"string" + }, + { + "name": "targets.textType", + "in": "body", + "description":"Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, complete element. Possible values are: plain (default) or html.", + "required": false, + "type":"string" + }, + { + "name": "targets.profanityAction", + "in": "body", + "description":"Specifies how profanities should be treated in translations. Possible values are: NoAction (default), Marked, or Deleted.", + "required": false, + "type":"string" + }, + { + "name": "targets.profanityMarker", + "in": "body", + "description":"Specifies how profanities should be marked in translations. Possible value or Tags are Asterisk (default).", + "required": false, + "type":"string" + }, + { + "name": "script", + "in": "body", + "description":"Specify the script of the source text.", + "required": false, + "type":"string" + }, + { + "name": "script", + "in": "body", + "description":"Specify the script of the source text.", + "required": false, + "type":"string" + }, + { + "name": "targets.script", + "in": "body", + "description":"Specify the script of the translated text.", + "required": false, + "type":"string" + }, + { + "name": "targets.script", + "in": "body", + "description":"Specify the script of the translated text.", + "required": false, + "type":"string" + }, + { + "name": "targets.deploymentNameModel", + "in": "body", + "description":"Model that should be used for translation.", + "required": false, + "type":"string" + }, + { + "name": "targets.allowFallback", + "in": "body", + "description":"Specifies that the service is allowed to fall back to a general system when a model specified isn’t supported for specified source and target language pair.", + "required": false, + "type":"string" + }, + { + "name": "targets.grade", + "in": "body", + "description":"Not Available", + "required": false, + "type":"string" + }, + { + "name": "targets.tone", + "in": "body", + "description":"Desired tone of target translation.", + "required": false, + "type":"string" + }, + { + "name": "targets.gender", + "in": "body", + "description":"Desired gender of target translation.", + "required": false, + "type":"string" + }, + { + "name": "targets.adaptiveDatasetId", + "in": "body", + "description":"Reference dataset ID having sentence pair to generate adaptive customized translation", + "required": false, + "type":"integer" + }, + { + "name": "targets.instruct", + "in":"body", + "description":"Free flow textual instruction for LLM translation. This negates all other key parameters within targets.", + "required": false, + "type": "string" + }, + { + "name": "api-version", + "in": "query", + "description": "Mandatory API version parameter", + "required": true, + "type": "string", + "x-ms-client-name": "apiVersion" + }, + { + "name": "targets.text", + "in": "body", + "description": "Defines the content of the request", + "required": true, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [] + } + }, + { + "name": "targets.referenceTextPairs", + "in": "body", + "description": "Reference text pairs to generate adaptive customized translation.", + "required": false, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ReferenceSentencePair" + }, + "x-ms-identifiers": [] + } + } + ], + "responses": { + "200": { + "description": "Response for the translation API.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TranslatedTextItem" + }, + "x-ms-identifiers": [] + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + }, + "x-metered-usage": { + "type": "integer", + "format": "int32", + "description": "Specifies consumption (the number of characters for which the user will be charged) for the translation \njob request. For example, if the word \"Hello\" is translated from English (en) to French (fr), \nthis field will return the value '5'." + }, + "x-mt-system": { + "type": "string", + "description": "Specifies the system type that was used for translation for each 'to' language requested for translation. \nThe value is a comma-separated list of strings. Each string indicates a type:\n\n* Custom - Request includes a custom system and at least one custom system was used during translation.\n* Team - All other requests" + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + } + }, + "x-ms-examples": { + "Translate Text": { + "$ref": "./examples/Translate_MaximumSet_Gen.json" + }, + "Translate Text with minimum properties": { + "$ref": "./examples/Translate_MinimumSet_Gen.json" + } + } + } + }, + "/transliterate": { + "post": { + "operationId": "Transliterate", + "summary": "Transliterate Text", + "description": "Transliterate Text", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "description": "A client-generated GUID to uniquely identify the request.", + "required": false, + "type": "string", + "x-ms-client-name": "clientTraceId" + }, + { + "$ref": "#/parameters/TransliterateParameters.language" + }, + { + "$ref": "#/parameters/TransliterateParameters.fromScript" + }, + { + "$ref": "#/parameters/TransliterateParameters.toScript" + }, + { + "name": "api-version", + "in": "query", + "description": "Mandatory API version parameter", + "required": true, + "type": "string", + "x-ms-client-name": "apiVersion" + }, + { + "name": "body", + "in": "body", + "description": "Defines the content of the request", + "required": true, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [] + } + } + ], + "responses": { + "200": { + "description": "Response for the transliteration API.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TransliteratedText" + }, + "x-ms-identifiers": [] + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + } + }, + "x-ms-examples": { + "Transliterate Text": { + "$ref": "./examples/Transliterate_MaximumSet_Gen.json" + }, + "Transliterate Text with minimum properties": { + "$ref": "./examples/Transliterate_MinimumSet_Gen.json" + } + } + } + } + }, + "definitions": { + "BackTranslation": { + "type": "object", + "description": "Back Translation", + "properties": { + "normalizedText": { + "type": "string", + "description": "A string giving the normalized form of the source term that is a back-translation of the target.\nThis value should be used as input to lookup examples." + }, + "displayText": { + "type": "string", + "description": "A string giving the source term that is a back-translation of the target in a form best\nsuited for end-user display." + }, + "numExamples": { + "type": "integer", + "format": "int32", + "description": "An integer representing the number of examples that are available for this translation pair.\nActual examples must be retrieved with a separate call to lookup examples. The number is mostly\nintended to facilitate display in a UX. For example, a user interface may add a hyperlink\nto the back-translation if the number of examples is greater than zero and show the back-translation\nas plain text if there are no examples. Note that the actual number of examples returned\nby a call to lookup examples may be less than numExamples, because additional filtering may be\napplied on the fly to remove \"bad\" examples." + }, + "frequencyCount": { + "type": "integer", + "format": "int32", + "description": "An integer representing the frequency of this translation pair in the data. The main purpose of this\nfield is to provide a user interface with a means to sort back-translations so the most frequent terms are first." + } + }, + "required": [ + "normalizedText", + "displayText", + "numExamples", + "frequencyCount" + ] + }, + "BreakSentenceItem": { + "type": "object", + "description": "Item containing break sentence result.", + "properties": { + "detectedLanguage": { + "$ref": "#/definitions/DetectedLanguage", + "description": "The detectedLanguage property is only present in the result object when language auto-detection is requested." + }, + "sentLen": { + "type": "array", + "description": "An integer array representing the lengths of the sentences in the input text.\nThe length of the array is the number of sentences, and the values are the length of each sentence.", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + "required": [ + "sentLen" + ] + }, + "BreakSentenceResult": { + "type": "object", + "description": "Response for the Break SEntence API.", + "properties": { + "result": { + "type": "array", + "description": "Array of the break sentence elements.", + "items": { + "$ref": "#/definitions/BreakSentenceItem" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "result" + ] + }, + "DetectedLanguage": { + "type": "object", + "description": "An object describing the detected language.", + "properties": { + "language": { + "type": "string", + "description": "A string representing the code of the detected language." + }, + "score": { + "type": "number", + "format": "float", + "description": "A float value indicating the confidence in the result.\nThe score is between zero and one and a low score indicates a low confidence." + } + }, + "required": [ + "language", + "score" + ] + }, + "DictionaryExample": { + "type": "object", + "description": "Dictionary Example", + "properties": { + "sourcePrefix": { + "type": "string", + "description": "The string to concatenate before the value of sourceTerm to form a complete example.\nDo not add a space character, since it is already there when it should be.\nThis value may be an empty string." + }, + "sourceTerm": { + "type": "string", + "description": "A string equal to the actual term looked up. The string is added with sourcePrefix\nand sourceSuffix to form the complete example. Its value is separated so it can be\nmarked in a user interface, e.g., by bolding it." + }, + "sourceSuffix": { + "type": "string", + "description": "The string to concatenate after the value of sourceTerm to form a complete example.\nDo not add a space character, since it is already there when it should be.\nThis value may be an empty string." + }, + "targetPrefix": { + "type": "string", + "description": "A string similar to sourcePrefix but for the target." + }, + "targetTerm": { + "type": "string", + "description": "A string similar to sourceTerm but for the target." + }, + "targetSuffix": { + "type": "string", + "description": "A string similar to sourceSuffix but for the target." + } + }, + "required": [ + "sourcePrefix", + "sourceTerm", + "sourceSuffix", + "targetPrefix", + "targetTerm", + "targetSuffix" + ] + }, + "DictionaryExampleItem": { + "type": "object", + "description": "Dictionary Example element", + "properties": { + "normalizedSource": { + "type": "string", + "description": "A string giving the normalized form of the source term. Generally, this should be identical\nto the value of the Text field at the matching list index in the body of the request." + }, + "normalizedTarget": { + "type": "string", + "description": "A string giving the normalized form of the target term. Generally, this should be identical\nto the value of the Translation field at the matching list index in the body of the request." + }, + "examples": { + "type": "array", + "description": "A list of examples for the (source term, target term) pair.", + "items": { + "$ref": "#/definitions/DictionaryExample" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "normalizedSource", + "normalizedTarget", + "examples" + ] + }, + "DictionaryExampleTextItem": { + "type": "object", + "description": "Element containing the text with translation.", + "properties": { + "translation": { + "type": "string", + "description": "A string specifying the translated text previously returned by the Dictionary lookup operation. \nThis should be the value from the normalizedTarget field in the translations list of the Dictionary \nlookup response. The service will return examples for the specific source-target word-pair." + } + }, + "required": [ + "translation" + ], + "allOf": [ + { + "$ref": "#/definitions/InputTextItem" + } + ] + }, + "DictionaryExamplesResult": { + "type": "object", + "description": "Response for the dictionary examples API.", + "properties": { + "result": { + "type": "array", + "description": "Array of the dictionary examples elements.", + "items": { + "$ref": "#/definitions/DictionaryExampleItem" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "result" + ] + }, + "DictionaryLookupItem": { + "type": "object", + "description": "Dictionary Lookup Element", + "properties": { + "normalizedSource": { + "type": "string", + "description": "A string giving the normalized form of the source term.\nFor example, if the request is \"JOHN\", the normalized form will be \"john\".\nThe content of this field becomes the input to lookup examples." + }, + "displaySource": { + "type": "string", + "description": "A string giving the source term in a form best suited for end-user display.\nFor example, if the input is \"JOHN\", the display form will reflect the usual\nspelling of the name: \"John\"." + }, + "translations": { + "type": "array", + "description": "A list of translations for the source term.", + "items": { + "$ref": "#/definitions/DictionaryTranslation" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "normalizedSource", + "displaySource", + "translations" + ] + }, + "DictionaryLookupResult": { + "type": "object", + "description": "Response for the dictionary lookup API.", + "properties": { + "result": { + "type": "array", + "description": "Array of the dictionary lookup elements.", + "items": { + "$ref": "#/definitions/DictionaryLookupItem" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "result" + ] + }, + "DictionaryTranslation": { + "type": "object", + "description": "Translation source term.", + "properties": { + "normalizedTarget": { + "type": "string", + "description": "A string giving the normalized form of this term in the target language.\nThis value should be used as input to lookup examples." + }, + "displayTarget": { + "type": "string", + "description": "A string giving the term in the target language and in a form best suited\nfor end-user display. Generally, this will only differ from the normalizedTarget\nin terms of capitalization. For example, a proper noun like \"Juan\" will have\nnormalizedTarget = \"juan\" and displayTarget = \"Juan\"." + }, + "posTag": { + "type": "string", + "description": "A string associating this term with a part-of-speech tag." + }, + "confidence": { + "type": "number", + "format": "float", + "description": "A value between 0.0 and 1.0 which represents the \"confidence\" \n(or perhaps more accurately, \"probability in the training data\") of that translation pair. \nThe sum of confidence scores for one source word may or may not sum to 1.0." + }, + "prefixWord": { + "type": "string", + "description": "A string giving the word to display as a prefix of the translation. Currently,\nthis is the gendered determiner of nouns, in languages that have gendered determiners.\nFor example, the prefix of the Spanish word \"mosca\" is \"la\", since \"mosca\" is a feminine noun in Spanish. \nThis is only dependent on the translation, and not on the source. \nIf there is no prefix, it will be the empty string." + }, + "backTranslations": { + "type": "array", + "description": "A list of \"back translations\" of the target. For example, source words that the target can translate to.\nThe list is guaranteed to contain the source word that was requested (e.g., if the source word being\nlooked up is \"fly\", then it is guaranteed that \"fly\" will be in the backTranslations list).\nHowever, it is not guaranteed to be in the first position, and often will not be.", + "items": { + "$ref": "#/definitions/BackTranslation" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "normalizedTarget", + "displayTarget", + "posTag", + "confidence", + "prefixWord", + "backTranslations" + ] + }, + "ErrorDetails": { + "type": "object", + "description": "Error details as returned by Translator Service.", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "description": "Number identifier of the error." + }, + "message": { + "type": "string", + "description": "Human readable error description." + } + }, + "required": [ + "code", + "message" + ] + }, + "ErrorResponse": { + "type": "object", + "description": "Representation of the Error Response from Translator Service.", + "properties": { + "error": { + "$ref": "#/definitions/ErrorDetails", + "description": "Error details." + } + }, + "required": [ + "error" + ] + }, + "GetSupportedLanguagesResult": { + "type": "object", + "description": "Response for the languages API.", + "properties": { + "translation": { + "type": "object", + "description": "Languages that support translate API.", + "additionalProperties": { + "$ref": "#/definitions/TranslationLanguage" + } + }, + "transliteration": { + "type": "object", + "description": "Languages that support transliteration API.", + "additionalProperties": { + "$ref": "#/definitions/TransliterationLanguage" + } + }, + "dictionary": { + "type": "object", + "description": "Languages that support dictionary API.", + "additionalProperties": { + "$ref": "#/definitions/SourceDictionaryLanguage" + } + } + } + }, + "InputTextItem": { + "type": "object", + "description": "Element containing the text for translation.", + "properties": { + "text": { + "type": "string", + "description": "Text to translate." + } + }, + "required": [ + "text" + ] + }, + "Instruction": { + "description": "Free flow textual instruction for LLM translation. This negates all other key parameters within targets.", + "properties": { + "TranslateParameters.targets.instruct": { + "type": "string", + "description":"Free flow textual instruction for LLM translation. This negates all other key parameters within targets." + } + } + }, + "LanguageDirectionality": { + "type": "string", + "description": "Language Directionality", + "enum": [ + "ltr", + "rtl" + ], + "x-ms-enum": { + "name": "LanguageDirectionality", + "modelAsString": false, + "values": [ + { + "name": "LeftToRight", + "value": "ltr", + "description": "Language is written left to right." + }, + { + "name": "RightToLeft", + "value": "rtl", + "description": "Language is written right to left." + } + ] + } + }, + "LanguageScript": { + "type": "object", + "description": "Common properties of language script", + "properties": { + "code": { + "type": "string", + "description": "Code identifying the script." + }, + "name": { + "type": "string", + "description": "Display name of the script in the locale requested via Accept-Language header." + }, + "nativeName": { + "type": "string", + "description": "Display name of the language in the locale native for the language." + }, + "dir": { + "$ref": "#/definitions/LanguageDirectionality", + "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." + } + }, + "required": [ + "code", + "name", + "nativeName", + "dir" + ] + }, + "ProfanityAction": { + "type": "string", + "description": "Translator profanity actions", + "enum": [ + "NoAction", + "Marked", + "Deleted" + ], + "x-ms-enum": { + "name": "ProfanityAction", + "modelAsString": false, + "values": [ + { + "name": "NoAction", + "value": "NoAction", + "description": "No Action is taken on profanity" + }, + { + "name": "Marked", + "value": "Marked", + "description": "Profanity is marked." + }, + { + "name": "Deleted", + "value": "Deleted", + "description": "Profanity is deleted from the translated text." + } + ] + } + }, + "ProfanityMarker": { + "type": "string", + "description": "Translator profanity markers", + "enum": [ + "Asterisk", + "Tag" + ], + "x-ms-enum": { + "name": "ProfanityMarker", + "modelAsString": false, + "values": [ + { + "name": "Asterisk", + "value": "Asterisk", + "description": "Profanity is marked with asterisk." + }, + { + "name": "Tag", + "value": "Tag", + "description": "Profanity is marked with the tags." + } + ] + } + }, + "ReferenceSentencePair": { + "type": "object", + "description": "Reference sentence pairs to generate adaptive customized translation", + "properties": { + "targets.referenceTextPairs.source": { + "$ref": "#/definitions/InputTextItem", + "description": "Source reference sentence." + }, + "targets.referenceTextPairs.target": { + "$ref": "#/definitions/InputTextItem", + "description": "Target reference sentence." + } + }, + "required": [ + "targets.referenceTextPairs.source", + "targets.referenceTextPairs.target" + ] + }, + "SentenceBoundaries": { + "type": "object", + "description": "An object returning sentence boundaries in the input and output texts.", + "properties": { + "srcSentLen": { + "type": "array", + "description": "An integer array representing the lengths of the sentences in the input text. \nThe length of the array is the number of sentences, and the values are the length of each sentence.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "transSentLen": { + "type": "array", + "description": "An integer array representing the lengths of the sentences in the translated text. \nThe length of the array is the number of sentences, and the values are the length of each sentence.", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + "required": [ + "srcSentLen", + "transSentLen" + ] + }, + "SourceDictionaryLanguage": { + "type": "object", + "description": "Properties ot the source dictionary language", + "properties": { + "name": { + "type": "string", + "description": "Display name of the language in the locale requested via Accept-Language header." + }, + "nativeName": { + "type": "string", + "description": "Display name of the language in the locale native for this language." + }, + "dir": { + "$ref": "#/definitions/LanguageDirectionality", + "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." + }, + "translations": { + "type": "array", + "description": "List of languages with alterative translations and examples for the query expressed in the source language.", + "items": { + "$ref": "#/definitions/TargetDictionaryLanguage" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "name", + "nativeName", + "dir", + "translations" + ] + }, + "SourceText": { + "type": "object", + "description": "Input text in the default script of the source language. ", + "properties": { + "text": { + "type": "string", + "description": "Input text in the default script of the source language." + } + }, + "required": [ + "text" + ] + }, + "TargetDictionaryLanguage": { + "type": "object", + "description": "Properties of the target dictionary language", + "properties": { + "name": { + "type": "string", + "description": "Display name of the language in the locale requested via Accept-Language header." + }, + "nativeName": { + "type": "string", + "description": "Display name of the language in the locale native for this language." + }, + "dir": { + "$ref": "#/definitions/LanguageDirectionality", + "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." + }, + "code": { + "type": "string", + "description": "Language code identifying the target language." + } + }, + "required": [ + "name", + "nativeName", + "dir", + "code" + ] + }, + "TextType": { + "type": "string", + "description": "Translation text type", + "enum": [ + "Plain", + "Html" + ], + "x-ms-enum": { + "name": "TextType", + "modelAsString": true, + "values": [ + { + "name": "Plain", + "value": "Plain", + "description": "Plain text." + }, + { + "name": "Html", + "value": "Html", + "description": "HTML-encoded text." + } + ] + } + }, + "TranslatedTextAlignment": { + "type": "object", + "description": "Alignment information object.", + "properties": { + "proj": { + "type": "string", + "description": "Maps input text to translated text. The alignment information is only provided when the request \nparameter includeAlignment is true. Alignment is returned as a string value of the following \nformat: [[SourceTextStartIndex]:[SourceTextEndIndex]–[TgtTextStartIndex]:[TgtTextEndIndex]]. \nThe colon separates start and end index, the dash separates the languages, and space separates the words. \nOne word may align with zero, one, or multiple words in the other language, and the aligned words may \nbe non-contiguous. When no alignment information is available, the alignment element will be empty." + } + }, + "required": [ + "proj" + ] + }, + "TranslatedTextItem": { + "type": "object", + "description": "Element containing the translated text", + "properties": { + "detectedLanguage": { + "$ref": "#/definitions/DetectedLanguage", + "description": "The detectedLanguage property is only present in the result object when language auto-detection is requested." + }, + "translations": { + "type": "array", + "description": "An array of translation results. The size of the array matches the number of target \nlanguages specified through the to query parameter.", + "items": { + "$ref": "#/definitions/TranslationText" + }, + "x-ms-identifiers": [] + }, + "sourceText": { + "$ref": "#/definitions/SourceText", + "description": "Input text in the default script of the source language. sourceText property is present only when \nthe input is expressed in a script that's not the usual script for the language. For example, \nif the input were Arabic written in Latin script, then sourceText.text would be the same Arabic text \nconverted into Arab script." + } + }, + "required": [ + "translations" + ] + }, + "TranslationLanguage": { + "type": "object", + "description": "The value of the translation property is a dictionary of (key, value) pairs. Each key is a BCP 47 language tag.\nA key identifies a language for which text can be translated to or translated from.", + "properties": { + "name": { + "type": "string", + "description": "Display name of the language in the locale requested via Accept-Language header." + }, + "nativeName": { + "type": "string", + "description": "Display name of the language in the locale native for this language." + }, + "dir": { + "$ref": "#/definitions/LanguageDirectionality", + "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." + } + }, + "required": [ + "name", + "nativeName", + "dir" + ] + }, + "TranslationResult": { + "type": "object", + "description": "Response for the translation API.", + "properties": { + "result": { + "type": "array", + "description": "Array of the translated text elements.", + "items": { + "$ref": "#/definitions/TranslatedTextItem" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "result" + ] + }, + "TranslationText": { + "type": "object", + "description": "Translation result", + "properties": { + "to": { + "type": "string", + "description": "A string representing the language code of the target language." + }, + "text": { + "type": "string", + "description": "A string giving the translated text." + }, + "transliteration": { + "$ref": "#/definitions/TransliteratedText", + "description": "An object giving the translated text in the script specified by the toScript parameter." + }, + "alignment": { + "$ref": "#/definitions/TranslatedTextAlignment", + "description": "Alignment information." + }, + "sentLen": { + "$ref": "#/definitions/SentenceBoundaries", + "description": "Sentence boundaries in the input and output texts." + } + }, + "required": [ + "to", + "text" + ] + }, + "TransliterableScript": { + "type": "object", + "description": "Script definition with list of script into which given script can be translitered.", + "properties": { + "toScripts": { + "type": "array", + "description": "List of scripts available to convert text to.", + "items": { + "$ref": "#/definitions/LanguageScript" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "toScripts" + ], + "allOf": [ + { + "$ref": "#/definitions/LanguageScript" + } + ] + }, + "TransliterateResult": { + "type": "object", + "description": "Response for the transliteration API.", + "properties": { + "result": { + "type": "array", + "description": "Array of transliterated texts", + "items": { + "$ref": "#/definitions/TransliteratedText" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "result" + ] + }, + "TransliteratedText": { + "type": "object", + "description": "Transliterated text element.", + "properties": { + "text": { + "type": "string", + "description": "A string which is the result of converting the input string to the output script." + }, + "script": { + "type": "string", + "description": "A string specifying the script used in the output." + } + }, + "required": [ + "text", + "script" + ] + }, + "TransliterationLanguage": { + "type": "object", + "description": "The value of the transliteration property is a dictionary of (key, value) pairs. \nEach key is a BCP 47 language tag. A key identifies a language for which text can be converted from one script \nto another script.", + "properties": { + "name": { + "type": "string", + "description": "Display name of the language in the locale requested via Accept-Language header." + }, + "nativeName": { + "type": "string", + "description": "Display name of the language in the locale native for this language." + }, + "scripts": { + "type": "array", + "description": "List of scripts to convert from.", + "items": { + "$ref": "#/definitions/TransliterableScript" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "name", + "nativeName", + "scripts" + ] + } + }, + "parameters": { + "BreakSentenceParameters.language": { + "name": "language", + "in": "query", + "description": "Language tag identifying the language of the input text. \nIf a code isn't specified, automatic language detection will be applied.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "BreakSentenceParameters.script": { + "name": "script", + "in": "query", + "description": "Script tag identifying the script used by the input text. \nIf a script isn't specified, the default script of the language will be assumed.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "DictionaryExamplesParameters.from": { + "name": "from", + "in": "query", + "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "DictionaryExamplesParameters.to": { + "name": "to", + "in": "query", + "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "DictionaryLookupParameters.from": { + "name": "from", + "in": "query", + "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "DictionaryLookupParameters.to": { + "name": "to", + "in": "query", + "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "GetSupportedLanguagesParameters.acceptLanguage": { + "name": "Accept-Language", + "in": "header", + "description": "The language to use for user interface strings. Some of the fields in the response are names of languages or \nnames of regions. Use this parameter to define the language in which these names are returned. \nThe language is specified by providing a well-formed BCP 47 language tag. For instance, use the value `fr` \nto request names in French or use the value `zh-Hant` to request names in Chinese Traditional.\nNames are provided in the English language when a target language is not specified or when localization \nis not available.", + "required": false, + "type": "string", + "default": "en", + "x-ms-parameter-location": "method", + "x-ms-client-name": "acceptLanguage" + }, + "GetSupportedLanguagesParameters.ifNoneMatch": { + "name": "If-None-Match", + "in": "header", + "description": "Passing the value of the ETag response header in an If-None-Match field will allow the service to optimize the response. \nIf the resource has not been modified, the service will return status code 304 and an empty response body.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-client-name": "ifNoneMatch" + }, + "GetSupportedLanguagesParameters.scope": { + "name": "scope", + "in": "query", + "description": "A comma-separated list of names defining the group of languages to return.\nAllowed group names are: `translation`, `transliteration` and `dictionary`.\nIf no scope is given, then all groups are returned, which is equivalent to passing \n`scope=translation,transliteration,dictionary`. To decide which set of supported languages \nis appropriate for your scenario, see the description of the [response object](#response-body).", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.allowFallback": { + "name": "allowFallback", + "in": "query", + "description": "Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. \nPossible values are: true (default) or false.\n\nallowFallback=false specifies that the translation should only use systems trained for the category specified \nby the request. If a translation for language X to language Y requires chaining through a pivot language E, \nthen all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. \nIf no system is found with the specific category, the request will return a 400 status code. allowFallback=true \nspecifies that the service is allowed to fall back to a general system when a custom system doesn't exist.", + "required": false, + "type": "boolean", + "default": true, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.category": { + "name": "category", + "in": "query", + "description": "A string specifying the category (domain) of the translation. This parameter is used to get translations \nfrom a customized system built with Custom Translator. Add the Category ID from your Custom Translator \nproject details to this parameter to use your deployed customized system. Default value is: general.", + "required": false, + "type": "string", + "default": "general", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.from": { + "name": "from", + "in": "query", + "description": "Specifies the language of the input text. Find which languages are available to translate from by \nlooking up supported languages using the translation scope. If the from parameter isn't specified, \nautomatic language detection is applied to determine the source language.\n\nYou must use the from parameter rather than autodetection when using the dynamic dictionary feature. \nNote: the dynamic dictionary feature is case-sensitive.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.fromScript": { + "name": "fromScript", + "in": "query", + "description": "Specifies the script of the input text.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.includeAlignment": { + "name": "includeAlignment", + "in": "query", + "description": "Specifies whether to include alignment projection from source text to translated text.\nPossible values are: true or false (default).", + "required": false, + "type": "boolean", + "default": false, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.includeSentenceLength": { + "name": "includeSentenceLength", + "in": "query", + "description": "Specifies whether to include sentence boundaries for the input text and the translated text.\nPossible values are: true or false (default).", + "required": false, + "type": "boolean", + "default": false, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.profanityAction": { + "name": "profanityAction", + "in": "query", + "description": "Specifies how profanities should be treated in translations.\nPossible values are: NoAction (default), Marked or Deleted.", + "required": false, + "type": "string", + "default": "NoAction", + "enum": [ + "NoAction", + "Marked", + "Deleted" + ], + "x-ms-enum": { + "name": "ProfanityAction", + "modelAsString": false, + "values": [ + { + "name": "NoAction", + "value": "NoAction", + "description": "No Action is taken on profanity" + }, + { + "name": "Marked", + "value": "Marked", + "description": "Profanity is marked." + }, + { + "name": "Deleted", + "value": "Deleted", + "description": "Profanity is deleted from the translated text." + } + ] + }, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.profanityMarker": { + "name": "profanityMarker", + "in": "query", + "description": "Specifies how profanities should be marked in translations.\nPossible values are: Asterisk (default) or Tag. ", + "required": false, + "type": "string", + "default": "Asterisk", + "enum": [ + "Asterisk", + "Tag" + ], + "x-ms-enum": { + "name": "ProfanityMarker", + "modelAsString": false, + "values": [ + { + "name": "Asterisk", + "value": "Asterisk", + "description": "Profanity is marked with asterisk." + }, + { + "name": "Tag", + "value": "Tag", + "description": "Profanity is marked with the tags." + } + ] + }, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.suggestedFrom": { + "name": "suggestedFrom", + "in": "query", + "description": "Specifies a fallback language if the language of the input text can't be identified. \nLanguage autodetection is applied when the from parameter is omitted. If detection fails, \nthe suggestedFrom language will be assumed.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.textType": { + "name": "textType", + "in": "query", + "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", + "required": false, + "type": "string", + "default": "Plain", + "enum": [ + "Plain", + "Html" + ], + "x-ms-enum": { + "name": "TextType", + "modelAsString": true, + "values": [ + { + "name": "Plain", + "value": "Plain", + "description": "Plain text." + }, + { + "name": "Html", + "value": "Html", + "description": "HTML-encoded text." + } + ] + }, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.to": { + "name": "to", + "in": "query", + "description": "Specifies the language of the output text. The target language must be one of the supported languages included \nin the translation scope. For example, use to=de to translate to German.\nIt's possible to translate to multiple languages simultaneously by repeating the parameter in the query string. \nFor example, use to=de&to=it to translate to German and Italian.", + "required": true, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.toScript": { + "name": "toScript", + "in": "query", + "description": "Specifies the script of the translated text.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "TransliterateParameters.fromScript": { + "name": "fromScript", + "in": "query", + "description": "Specifies the script used by the input text. Look up supported languages using the transliteration scope,\nto find input scripts available for the selected language.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "TransliterateParameters.language": { + "name": "language", + "in": "query", + "description": "Specifies the language of the text to convert from one script to another. \nPossible languages are listed in the transliteration scope obtained by querying the service \nfor its supported languages.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "TransliterateParameters.toScript": { + "name": "toScript", + "in": "query", + "description": "Specifies the output script. Look up supported languages using the transliteration scope, to find output \nscripts available for the selected combination of input language and input script.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + } + } +} From 604dc3b62d6c26c4c4c61d9b14e2190f988ffdb1 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Thu, 27 Mar 2025 14:29:25 -0700 Subject: [PATCH 002/119] Remove legacy api calls --- .../preview/2025-05-01/openapi.json | 246 ------------------ 1 file changed, 246 deletions(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json index 94a9b4201357..e187a87adf48 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json @@ -36,252 +36,6 @@ ], "tags": [], "paths": { - "/breaksentence": { - "post": { - "operationId": "FindSentenceBoundaries", - "summary": "Find Sentence Boundaries", - "description": "Find Sentence Boundaries", - "parameters": [ - { - "name": "X-ClientTraceId", - "in": "header", - "description": "A client-generated GUID to uniquely identify the request.", - "required": false, - "type": "string", - "x-ms-client-name": "clientTraceId" - }, - { - "$ref": "#/parameters/BreakSentenceParameters.language" - }, - { - "$ref": "#/parameters/BreakSentenceParameters.script" - }, - { - "name": "api-version", - "in": "query", - "description": "Mandatory API version parameter", - "required": true, - "type": "string", - "x-ms-client-name": "apiVersion" - }, - { - "name": "body", - "in": "body", - "description": "Defines the content of the request", - "required": true, - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [] - } - } - ], - "responses": { - "200": { - "description": "Response for the Break SEntence API.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/BreakSentenceItem" - }, - "x-ms-identifiers": [] - }, - "headers": { - "X-RequestId": { - "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - }, - "headers": { - "X-RequestId": { - "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - } - } - } - }, - "x-ms-examples": { - "Find Sentence Boundaries": { - "$ref": "./examples/FindSentenceBoundaries_MaximumSet_Gen.json" - }, - "Find Sentence Boundaries with minimum properties": { - "$ref": "./examples/FindSentenceBoundaries_MinimumSet_Gen.json" - } - } - } - }, - "/dictionary/examples": { - "post": { - "operationId": "LookupDictionaryExamples", - "summary": "Lookup Dictionary Examples", - "description": "Lookup Dictionary Examples", - "parameters": [ - { - "name": "X-ClientTraceId", - "in": "header", - "description": "A client-generated GUID to uniquely identify the request.", - "required": false, - "type": "string", - "x-ms-client-name": "clientTraceId" - }, - { - "$ref": "#/parameters/DictionaryExamplesParameters.from" - }, - { - "$ref": "#/parameters/DictionaryExamplesParameters.to" - }, - { - "name": "api-version", - "in": "query", - "description": "Mandatory API version parameter", - "required": true, - "type": "string", - "x-ms-client-name": "apiVersion" - }, - { - "name": "body", - "in": "body", - "description": "Defines the content of the request", - "required": true, - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/DictionaryExampleTextItem" - }, - "x-ms-identifiers": [] - } - } - ], - "responses": { - "200": { - "description": "Response for the dictionary examples API.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/DictionaryExampleItem" - }, - "x-ms-identifiers": [] - }, - "headers": { - "X-RequestId": { - "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - }, - "headers": { - "X-RequestId": { - "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - } - } - } - }, - "x-ms-examples": { - "Lookup Dictionary Examples": { - "$ref": "./examples/LookupDictionaryExamples_MaximumSet_Gen.json" - }, - "Lookup Dictionary Examples with minimum properties": { - "$ref": "./examples/LookupDictionaryExamples_MinimumSet_Gen.json" - } - } - } - }, - "/dictionary/lookup": { - "post": { - "operationId": "LookupDictionaryEntries", - "summary": "Lookup Dictionary Entries", - "description": "Lookup Dictionary Entries", - "parameters": [ - { - "name": "X-ClientTraceId", - "in": "header", - "description": "A client-generated GUID to uniquely identify the request.", - "required": false, - "type": "string", - "x-ms-client-name": "clientTraceId" - }, - { - "$ref": "#/parameters/DictionaryLookupParameters.from" - }, - { - "$ref": "#/parameters/DictionaryLookupParameters.to" - }, - { - "name": "api-version", - "in": "query", - "description": "Mandatory API version parameter", - "required": true, - "type": "string", - "x-ms-client-name": "apiVersion" - }, - { - "name": "body", - "in": "body", - "description": "Defines the content of the request", - "required": true, - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [] - } - } - ], - "responses": { - "200": { - "description": "Response for the dictionary lookup API.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/DictionaryLookupItem" - }, - "x-ms-identifiers": [] - }, - "headers": { - "X-RequestId": { - "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - }, - "headers": { - "X-RequestId": { - "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - } - } - } - }, - "x-ms-examples": { - "Lookup Dictionary Entries": { - "$ref": "./examples/LookupDictionaryEntries_MaximumSet_Gen.json" - }, - "Lookup Dictionary Entries with minimum properties": { - "$ref": "./examples/LookupDictionaryEntries_MinimumSet_Gen.json" - } - } - } - }, "/languages": { "get": { "operationId": "GetSupportedLanguages", From 99a73b3c6eb1762c7eaa438bf08dc2e44952bcfc Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Thu, 27 Mar 2025 15:03:09 -0700 Subject: [PATCH 003/119] Remove legacy api calls --- .../preview/2025-05-01/openapi.json | 415 +++--------------- 1 file changed, 53 insertions(+), 362 deletions(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json index e187a87adf48..35d7c5a66b62 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json @@ -127,105 +127,125 @@ "in": "body", "description":"The language code for the source text. If not specified, the system will autodetect the language of the source text. Possible values are list of language code supported by the specified model.", "required": false, - "type":"string" + "schema": { + "type":"string" + } }, { "name": "targets.textType", "in": "body", "description":"Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, complete element. Possible values are: plain (default) or html.", "required": false, - "type":"string" + "schema": { + "type":"string" + } }, { "name": "targets.profanityAction", "in": "body", "description":"Specifies how profanities should be treated in translations. Possible values are: NoAction (default), Marked, or Deleted.", "required": false, - "type":"string" + "schema": { + "type":"string" + } }, { "name": "targets.profanityMarker", "in": "body", "description":"Specifies how profanities should be marked in translations. Possible value or Tags are Asterisk (default).", "required": false, - "type":"string" - }, - { - "name": "script", - "in": "body", - "description":"Specify the script of the source text.", - "required": false, - "type":"string" + "schema": { + "type":"string" + } }, { "name": "script", "in": "body", "description":"Specify the script of the source text.", "required": false, - "type":"string" - }, - { - "name": "targets.script", - "in": "body", - "description":"Specify the script of the translated text.", - "required": false, - "type":"string" + "schema": { + "type":"string" + } }, { "name": "targets.script", "in": "body", "description":"Specify the script of the translated text.", "required": false, - "type":"string" + "schema": { + "type":"string" + } }, { "name": "targets.deploymentNameModel", "in": "body", "description":"Model that should be used for translation.", "required": false, - "type":"string" + "schema": { + "type":"string" + } }, { "name": "targets.allowFallback", "in": "body", "description":"Specifies that the service is allowed to fall back to a general system when a model specified isn’t supported for specified source and target language pair.", "required": false, - "type":"string" + "schema": { + "type":"string" + } }, { "name": "targets.grade", "in": "body", "description":"Not Available", "required": false, - "type":"string" + "schema": { + "type":"string" + } }, { "name": "targets.tone", "in": "body", "description":"Desired tone of target translation.", "required": false, - "type":"string" + "schema": { + "type":"string" + } }, { "name": "targets.gender", "in": "body", "description":"Desired gender of target translation.", "required": false, - "type":"string" + "schema": { + "type":"string" + } }, { "name": "targets.adaptiveDatasetId", "in": "body", "description":"Reference dataset ID having sentence pair to generate adaptive customized translation", "required": false, - "type":"integer" + "schema": { + "type": "string", + "items": { + "$ref": "#/definitions/AdaptiveDatasetId" + }, + "x-ms-identifiers": [] + } }, { "name": "targets.instruct", "in":"body", "description":"Free flow textual instruction for LLM translation. This negates all other key parameters within targets.", "required": false, - "type": "string" + "schema": { + "type": "string", + "items": { + "$ref": "#/definitions/Instruction" + }, + "x-ms-identifiers": [] + } }, { "name": "api-version", @@ -238,7 +258,7 @@ { "name": "targets.text", "in": "body", - "description": "Defines the content of the request", + "description": "Defines the translation content of the request", "required": true, "schema": { "type": "array", @@ -398,73 +418,13 @@ } }, "definitions": { - "BackTranslation": { - "type": "object", - "description": "Back Translation", - "properties": { - "normalizedText": { - "type": "string", - "description": "A string giving the normalized form of the source term that is a back-translation of the target.\nThis value should be used as input to lookup examples." - }, - "displayText": { - "type": "string", - "description": "A string giving the source term that is a back-translation of the target in a form best\nsuited for end-user display." - }, - "numExamples": { - "type": "integer", - "format": "int32", - "description": "An integer representing the number of examples that are available for this translation pair.\nActual examples must be retrieved with a separate call to lookup examples. The number is mostly\nintended to facilitate display in a UX. For example, a user interface may add a hyperlink\nto the back-translation if the number of examples is greater than zero and show the back-translation\nas plain text if there are no examples. Note that the actual number of examples returned\nby a call to lookup examples may be less than numExamples, because additional filtering may be\napplied on the fly to remove \"bad\" examples." - }, - "frequencyCount": { - "type": "integer", - "format": "int32", - "description": "An integer representing the frequency of this translation pair in the data. The main purpose of this\nfield is to provide a user interface with a means to sort back-translations so the most frequent terms are first." - } - }, - "required": [ - "normalizedText", - "displayText", - "numExamples", - "frequencyCount" - ] - }, - "BreakSentenceItem": { - "type": "object", - "description": "Item containing break sentence result.", + "AdaptiveDatasetId": { + "description": "Reference dataset ID having sentence pair to generate adaptive customized translation.", "properties": { - "detectedLanguage": { - "$ref": "#/definitions/DetectedLanguage", - "description": "The detectedLanguage property is only present in the result object when language auto-detection is requested." - }, - "sentLen": { - "type": "array", - "description": "An integer array representing the lengths of the sentences in the input text.\nThe length of the array is the number of sentences, and the values are the length of each sentence.", - "items": { - "type": "integer", - "format": "int32" - } + "TranslateParameters.targets.adaptiveDatasetId": { + "type": "string" } - }, - "required": [ - "sentLen" - ] - }, - "BreakSentenceResult": { - "type": "object", - "description": "Response for the Break SEntence API.", - "properties": { - "result": { - "type": "array", - "description": "Array of the break sentence elements.", - "items": { - "$ref": "#/definitions/BreakSentenceItem" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "result" - ] + } }, "DetectedLanguage": { "type": "object", @@ -485,193 +445,6 @@ "score" ] }, - "DictionaryExample": { - "type": "object", - "description": "Dictionary Example", - "properties": { - "sourcePrefix": { - "type": "string", - "description": "The string to concatenate before the value of sourceTerm to form a complete example.\nDo not add a space character, since it is already there when it should be.\nThis value may be an empty string." - }, - "sourceTerm": { - "type": "string", - "description": "A string equal to the actual term looked up. The string is added with sourcePrefix\nand sourceSuffix to form the complete example. Its value is separated so it can be\nmarked in a user interface, e.g., by bolding it." - }, - "sourceSuffix": { - "type": "string", - "description": "The string to concatenate after the value of sourceTerm to form a complete example.\nDo not add a space character, since it is already there when it should be.\nThis value may be an empty string." - }, - "targetPrefix": { - "type": "string", - "description": "A string similar to sourcePrefix but for the target." - }, - "targetTerm": { - "type": "string", - "description": "A string similar to sourceTerm but for the target." - }, - "targetSuffix": { - "type": "string", - "description": "A string similar to sourceSuffix but for the target." - } - }, - "required": [ - "sourcePrefix", - "sourceTerm", - "sourceSuffix", - "targetPrefix", - "targetTerm", - "targetSuffix" - ] - }, - "DictionaryExampleItem": { - "type": "object", - "description": "Dictionary Example element", - "properties": { - "normalizedSource": { - "type": "string", - "description": "A string giving the normalized form of the source term. Generally, this should be identical\nto the value of the Text field at the matching list index in the body of the request." - }, - "normalizedTarget": { - "type": "string", - "description": "A string giving the normalized form of the target term. Generally, this should be identical\nto the value of the Translation field at the matching list index in the body of the request." - }, - "examples": { - "type": "array", - "description": "A list of examples for the (source term, target term) pair.", - "items": { - "$ref": "#/definitions/DictionaryExample" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "normalizedSource", - "normalizedTarget", - "examples" - ] - }, - "DictionaryExampleTextItem": { - "type": "object", - "description": "Element containing the text with translation.", - "properties": { - "translation": { - "type": "string", - "description": "A string specifying the translated text previously returned by the Dictionary lookup operation. \nThis should be the value from the normalizedTarget field in the translations list of the Dictionary \nlookup response. The service will return examples for the specific source-target word-pair." - } - }, - "required": [ - "translation" - ], - "allOf": [ - { - "$ref": "#/definitions/InputTextItem" - } - ] - }, - "DictionaryExamplesResult": { - "type": "object", - "description": "Response for the dictionary examples API.", - "properties": { - "result": { - "type": "array", - "description": "Array of the dictionary examples elements.", - "items": { - "$ref": "#/definitions/DictionaryExampleItem" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "result" - ] - }, - "DictionaryLookupItem": { - "type": "object", - "description": "Dictionary Lookup Element", - "properties": { - "normalizedSource": { - "type": "string", - "description": "A string giving the normalized form of the source term.\nFor example, if the request is \"JOHN\", the normalized form will be \"john\".\nThe content of this field becomes the input to lookup examples." - }, - "displaySource": { - "type": "string", - "description": "A string giving the source term in a form best suited for end-user display.\nFor example, if the input is \"JOHN\", the display form will reflect the usual\nspelling of the name: \"John\"." - }, - "translations": { - "type": "array", - "description": "A list of translations for the source term.", - "items": { - "$ref": "#/definitions/DictionaryTranslation" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "normalizedSource", - "displaySource", - "translations" - ] - }, - "DictionaryLookupResult": { - "type": "object", - "description": "Response for the dictionary lookup API.", - "properties": { - "result": { - "type": "array", - "description": "Array of the dictionary lookup elements.", - "items": { - "$ref": "#/definitions/DictionaryLookupItem" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "result" - ] - }, - "DictionaryTranslation": { - "type": "object", - "description": "Translation source term.", - "properties": { - "normalizedTarget": { - "type": "string", - "description": "A string giving the normalized form of this term in the target language.\nThis value should be used as input to lookup examples." - }, - "displayTarget": { - "type": "string", - "description": "A string giving the term in the target language and in a form best suited\nfor end-user display. Generally, this will only differ from the normalizedTarget\nin terms of capitalization. For example, a proper noun like \"Juan\" will have\nnormalizedTarget = \"juan\" and displayTarget = \"Juan\"." - }, - "posTag": { - "type": "string", - "description": "A string associating this term with a part-of-speech tag." - }, - "confidence": { - "type": "number", - "format": "float", - "description": "A value between 0.0 and 1.0 which represents the \"confidence\" \n(or perhaps more accurately, \"probability in the training data\") of that translation pair. \nThe sum of confidence scores for one source word may or may not sum to 1.0." - }, - "prefixWord": { - "type": "string", - "description": "A string giving the word to display as a prefix of the translation. Currently,\nthis is the gendered determiner of nouns, in languages that have gendered determiners.\nFor example, the prefix of the Spanish word \"mosca\" is \"la\", since \"mosca\" is a feminine noun in Spanish. \nThis is only dependent on the translation, and not on the source. \nIf there is no prefix, it will be the empty string." - }, - "backTranslations": { - "type": "array", - "description": "A list of \"back translations\" of the target. For example, source words that the target can translate to.\nThe list is guaranteed to contain the source word that was requested (e.g., if the source word being\nlooked up is \"fly\", then it is guaranteed that \"fly\" will be in the backTranslations list).\nHowever, it is not guaranteed to be in the first position, and often will not be.", - "items": { - "$ref": "#/definitions/BackTranslation" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "normalizedTarget", - "displayTarget", - "posTag", - "confidence", - "prefixWord", - "backTranslations" - ] - }, "ErrorDetails": { "type": "object", "description": "Error details as returned by Translator Service.", @@ -877,32 +650,6 @@ "targets.referenceTextPairs.target" ] }, - "SentenceBoundaries": { - "type": "object", - "description": "An object returning sentence boundaries in the input and output texts.", - "properties": { - "srcSentLen": { - "type": "array", - "description": "An integer array representing the lengths of the sentences in the input text. \nThe length of the array is the number of sentences, and the values are the length of each sentence.", - "items": { - "type": "integer", - "format": "int32" - } - }, - "transSentLen": { - "type": "array", - "description": "An integer array representing the lengths of the sentences in the translated text. \nThe length of the array is the number of sentences, and the values are the length of each sentence.", - "items": { - "type": "integer", - "format": "int32" - } - } - }, - "required": [ - "srcSentLen", - "transSentLen" - ] - }, "SourceDictionaryLanguage": { "type": "object", "description": "Properties ot the source dictionary language", @@ -1093,14 +840,6 @@ "transliteration": { "$ref": "#/definitions/TransliteratedText", "description": "An object giving the translated text in the script specified by the toScript parameter." - }, - "alignment": { - "$ref": "#/definitions/TranslatedTextAlignment", - "description": "Alignment information." - }, - "sentLen": { - "$ref": "#/definitions/SentenceBoundaries", - "description": "Sentence boundaries in the input and output texts." } }, "required": [ @@ -1194,54 +933,6 @@ } }, "parameters": { - "BreakSentenceParameters.language": { - "name": "language", - "in": "query", - "description": "Language tag identifying the language of the input text. \nIf a code isn't specified, automatic language detection will be applied.", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - }, - "BreakSentenceParameters.script": { - "name": "script", - "in": "query", - "description": "Script tag identifying the script used by the input text. \nIf a script isn't specified, the default script of the language will be assumed.", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - }, - "DictionaryExamplesParameters.from": { - "name": "from", - "in": "query", - "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "DictionaryExamplesParameters.to": { - "name": "to", - "in": "query", - "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "DictionaryLookupParameters.from": { - "name": "from", - "in": "query", - "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "DictionaryLookupParameters.to": { - "name": "to", - "in": "query", - "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, "GetSupportedLanguagesParameters.acceptLanguage": { "name": "Accept-Language", "in": "header", From 257602509d8e5b955e515af8e6a45621d67f25aa Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Thu, 27 Mar 2025 15:32:32 -0700 Subject: [PATCH 004/119] Update version --- .../Azure.AI.TextTranslation/preview/2025-05-01/openapi.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json index 35d7c5a66b62..485367fdb13e 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "title": "Text Translation", - "version": "3.0", + "version": "2025-05-01-preview", "description": "Text translation is a cloud-based REST API feature of the Translator service that uses neural\nmachine translation technology to enable quick and accurate source-to-target text translation\nin real time across all supported languages.\n\nThe following methods are supported by the Text Translation feature:\n\nLanguages. Returns a list of languages supported by Translate, Transliterate, and Dictionary Lookup operations.\n\nTranslate. Renders single source-language text to multiple target-language texts with a single request.\n\nTransliterate. Converts characters or letters of a source language to the corresponding characters or letters of a target language.\n\nDetect. Returns the source code language code and a boolean variable denoting whether the detected language is supported for text translation and transliteration.\n\nDictionary lookup. Returns equivalent words for the source term in the target language.\n\nDictionary example Returns grammatical structure and context examples for the source term and target term pair.", "x-typespec-generated": [ { From 49e5a02396e49c443b9483a3616132ed9990130e Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Thu, 27 Mar 2025 15:55:05 -0700 Subject: [PATCH 005/119] Update grade description --- .../Azure.AI.TextTranslation/preview/2025-05-01/openapi.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json index 485367fdb13e..acdfc67a2806 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json @@ -197,7 +197,7 @@ { "name": "targets.grade", "in": "body", - "description":"Not Available", + "description":"Defines complexity of LLM prompts to provide high accuracy translation.", "required": false, "schema": { "type":"string" From 0a29d40fc3297f87c0ffa5eb9059602dbb40c7ea Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 31 Mar 2025 09:39:56 -0700 Subject: [PATCH 006/119] Update typespec for translate call --- .../Azure.AI.TextTranslation/client.tsp | 117 --------- .../Azure.AI.TextTranslation/main.tsp | 7 +- .../models-breaksentence.tsp | 50 ---- .../models-dictionary.tsp | 234 ------------------ .../models-translate.tsp | 138 ++++++++--- .../Azure.AI.TextTranslation/routes.tsp | 43 +--- 6 files changed, 103 insertions(+), 486 deletions(-) delete mode 100644 specification/translation/Azure.AI.TextTranslation/models-breaksentence.tsp delete mode 100644 specification/translation/Azure.AI.TextTranslation/models-dictionary.tsp diff --git a/specification/translation/Azure.AI.TextTranslation/client.tsp b/specification/translation/Azure.AI.TextTranslation/client.tsp index 9b5e64cb3cd3..e2ccbbbe50b2 100644 --- a/specification/translation/Azure.AI.TextTranslation/client.tsp +++ b/specification/translation/Azure.AI.TextTranslation/client.tsp @@ -1,6 +1,4 @@ import "./main.tsp"; -import "./models-breaksentence.tsp"; -import "./models-dictionary.tsp"; import "./models-languages.tsp"; import "./models-translate.tsp"; import "./models-transliterate.tsp"; @@ -8,76 +6,6 @@ import "@azure-tools/typespec-client-generator-core"; using Azure.ClientGenerator.Core; -@@clientName(TextTranslation.BreakSentenceItem.sentLen, - "SentencesLengths", - "dotnet" -); -@@clientName(TextTranslation.BreakSentenceItem.sentLen, - "SentencesLengths", - "java" -); - -@@clientName(TextTranslation.BackTranslation.numExamples, - "ExamplesCount", - "dotnet" -); -@@clientName(TextTranslation.BackTranslation.numExamples, - "ExamplesCount", - "java" -); - -@@clientName(TextTranslation.DictionaryLookupParameters.from, - "SourceLanguage", - "dotnet" -); -@@clientName(TextTranslation.DictionaryLookupParameters.from, - "SourceLanguage", - "java" -); -@@clientName(TextTranslation.DictionaryLookupParameters.from, - "from_language", - "python" -); - -@@clientName(TextTranslation.DictionaryLookupParameters.to, - "TargetLanguage", - "dotnet" -); -@@clientName(TextTranslation.DictionaryLookupParameters.to, - "TargetLanguage", - "java" -); -@@clientName(TextTranslation.DictionaryLookupParameters.to, - "to_language", - "python" -); - -@@clientName(TextTranslation.DictionaryExamplesParameters.from, - "SourceLanguage", - "dotnet" -); -@@clientName(TextTranslation.DictionaryExamplesParameters.from, - "SourceLanguage", - "java" -); -@@clientName(TextTranslation.DictionaryExamplesParameters.from, - "from_language", - "python" -); - -@@clientName(TextTranslation.DictionaryExamplesParameters.to, - "TargetLanguage", - "dotnet" -); -@@clientName(TextTranslation.DictionaryExamplesParameters.to, - "TargetLanguage", - "java" -); -@@clientName(TextTranslation.DictionaryExamplesParameters.to, - "to_language", - "python" -); - @@clientName(TextTranslation.TranslationLanguage.dir, "Directionality", "dotnet" @@ -105,36 +33,9 @@ using Azure.ClientGenerator.Core; @@clientName(TextTranslation.LanguageScript.dir, "Directionality", "dotnet"); @@clientName(TextTranslation.LanguageScript.dir, "Directionality", "java"); -@@clientName(TextTranslation.TranslationText.sentLen, - "SentenceBoundaries", - "dotnet" -); -@@clientName(TextTranslation.TranslationText.sentLen, - "SentenceBoundaries", - "java" -); - @@clientName(TextTranslation.TranslationText.to, "TargetLanguage", "dotnet"); @@clientName(TextTranslation.TranslationText.to, "TargetLanguage", "java"); -@@clientName(TextTranslation.SentenceBoundaries.srcSentLen, - "SourceSentencesLengths", - "dotnet" -); -@@clientName(TextTranslation.SentenceBoundaries.srcSentLen, - "SourceSentencesLengths", - "java" -); - -@@clientName(TextTranslation.SentenceBoundaries.transSentLen, - "TranslatedSentencesLengths", - "dotnet" -); -@@clientName(TextTranslation.SentenceBoundaries.transSentLen, - "TranslatedSentencesLengths", - "java" -); - @@clientName(TextTranslation.DetectedLanguage.score, "Confidence", "dotnet"); @@clientName(TextTranslation.DetectedLanguage.score, "Confidence", "java"); @@ -176,24 +77,6 @@ using Azure.ClientGenerator.Core; "java" ); -@@clientName(TextTranslation.TranslateParameters.suggestedFrom, - "SuggestedSourceLanguage", - "dotnet" -); -@@clientName(TextTranslation.TranslateParameters.suggestedFrom, - "SuggestedSourceLanguage", - "java" -); - -@@clientName(TextTranslation.TranslatedTextAlignment.proj, - "Projections", - "dotnet" -); -@@clientName(TextTranslation.TranslatedTextAlignment.proj, - "Projections", - "java" -); - @@clientName(TextTranslation.TransliterateParameters.fromScript, "SourceLanguageScript", "dotnet" diff --git a/specification/translation/Azure.AI.TextTranslation/main.tsp b/specification/translation/Azure.AI.TextTranslation/main.tsp index 8fcc8ff994da..b1255fd6512d 100644 --- a/specification/translation/Azure.AI.TextTranslation/main.tsp +++ b/specification/translation/Azure.AI.TextTranslation/main.tsp @@ -35,10 +35,6 @@ using TypeSpec.Versioning; Transliterate. Converts characters or letters of a source language to the corresponding characters or letters of a target language. Detect. Returns the source code language code and a boolean variable denoting whether the detected language is supported for text translation and transliteration. - - Dictionary lookup. Returns equivalent words for the source term in the target language. - - Dictionary example Returns grammatical structure and context examples for the source term and target term pair. """) @versioned(APIVersion) namespace TextTranslation; @@ -47,4 +43,7 @@ namespace TextTranslation; enum APIVersion { @doc("Version 3.0") v3_0: "3.0", + + @doc("Version 2025-05-01") + v2025_05_01_preview: "2025-05-01-preview" } diff --git a/specification/translation/Azure.AI.TextTranslation/models-breaksentence.tsp b/specification/translation/Azure.AI.TextTranslation/models-breaksentence.tsp deleted file mode 100644 index 06798cb40010..000000000000 --- a/specification/translation/Azure.AI.TextTranslation/models-breaksentence.tsp +++ /dev/null @@ -1,50 +0,0 @@ -import "@typespec/rest"; -import "@azure-tools/typespec-azure-core"; -import "./models-shared.tsp"; -import "./models-translate.tsp"; - -using TypeSpec.Http; -using TypeSpec.Rest; -using Azure.Core; - -namespace TextTranslation; - -@doc("Request parameters for the break sentence API.") -model BreakSentenceParameters { - ...CommonParameters; - - @query - @doc(""" - Language tag identifying the language of the input text. - If a code isn't specified, automatic language detection will be applied. - """) - language?: string; - - @query - @doc(""" - Script tag identifying the script used by the input text. - If a script isn't specified, the default script of the language will be assumed. - """) - script?: string; -} - -@doc("Response for the Break SEntence API.") -model BreakSentenceResult { - ...CommonResultHeaders; - - @bodyRoot - @doc("Array of the break sentence elements.") - result: BreakSentenceItem[]; -} - -@doc("Item containing break sentence result.") -model BreakSentenceItem { - @doc("The detectedLanguage property is only present in the result object when language auto-detection is requested.") - detectedLanguage?: DetectedLanguage; - - @doc(""" - An integer array representing the lengths of the sentences in the input text. - The length of the array is the number of sentences, and the values are the length of each sentence. - """) - sentLen: int32[]; -} diff --git a/specification/translation/Azure.AI.TextTranslation/models-dictionary.tsp b/specification/translation/Azure.AI.TextTranslation/models-dictionary.tsp deleted file mode 100644 index 57f11e35e4de..000000000000 --- a/specification/translation/Azure.AI.TextTranslation/models-dictionary.tsp +++ /dev/null @@ -1,234 +0,0 @@ -import "@typespec/rest"; -import "@azure-tools/typespec-azure-core"; -import "./models-shared.tsp"; - -using TypeSpec.Http; -using TypeSpec.Rest; -using Azure.Core; - -namespace TextTranslation; - -@doc("Request parameters for the dictionary lookup API.") -model DictionaryLookupParameters { - ...CommonParameters; - - @query - @doc(""" - Specifies the language of the input text. - The source language must be one of the supported languages included in the dictionary scope. - """) - from: string; - - @query - @doc(""" - Specifies the language of the output text. - The target language must be one of the supported languages included in the dictionary scope. - """) - to: string; -} - -@doc("Request parameters for the dictionary examples API.") -model DictionaryExamplesParameters { - ...CommonParameters; - - @query - @doc(""" - Specifies the language of the input text. - The source language must be one of the supported languages included in the dictionary scope. - """) - from: string; - - @query - @doc(""" - Specifies the language of the output text. - The target language must be one of the supported languages included in the dictionary scope. - """) - to: string; -} - -@doc("Response for the dictionary lookup API.") -model DictionaryLookupResult { - ...CommonResultHeaders; - - @bodyRoot - @doc("Array of the dictionary lookup elements.") - result: DictionaryLookupItem[]; -} - -@doc("Response for the dictionary examples API.") -model DictionaryExamplesResult { - ...CommonResultHeaders; - - @bodyRoot - @doc("Array of the dictionary examples elements.") - result: DictionaryExampleItem[]; -} - -@doc("Element containing the text with translation.") -model DictionaryExampleTextItem extends InputTextItem { - @doc(""" - A string specifying the translated text previously returned by the Dictionary lookup operation. - This should be the value from the normalizedTarget field in the translations list of the Dictionary - lookup response. The service will return examples for the specific source-target word-pair. - """) - translation: string; -} - -@doc("Dictionary Lookup Element") -model DictionaryLookupItem { - @doc(""" - A string giving the normalized form of the source term. - For example, if the request is "JOHN", the normalized form will be "john". - The content of this field becomes the input to lookup examples. - """) - normalizedSource: string; - - @doc(""" - A string giving the source term in a form best suited for end-user display. - For example, if the input is "JOHN", the display form will reflect the usual - spelling of the name: "John". - """) - displaySource: string; - - @doc(""" - A list of translations for the source term. - """) - translations: DictionaryTranslation[]; -} - -@doc("Translation source term.") -model DictionaryTranslation { - @doc(""" - A string giving the normalized form of this term in the target language. - This value should be used as input to lookup examples. - """) - normalizedTarget: string; - - @doc(""" - A string giving the term in the target language and in a form best suited - for end-user display. Generally, this will only differ from the normalizedTarget - in terms of capitalization. For example, a proper noun like "Juan" will have - normalizedTarget = "juan" and displayTarget = "Juan". - """) - displayTarget: string; - - @doc(""" - A string associating this term with a part-of-speech tag. - """) - posTag: string; - - @doc(""" - A value between 0.0 and 1.0 which represents the "confidence" - (or perhaps more accurately, "probability in the training data") of that translation pair. - The sum of confidence scores for one source word may or may not sum to 1.0. - """) - confidence: float32; - - @doc(""" - A string giving the word to display as a prefix of the translation. Currently, - this is the gendered determiner of nouns, in languages that have gendered determiners. - For example, the prefix of the Spanish word "mosca" is "la", since "mosca" is a feminine noun in Spanish. - This is only dependent on the translation, and not on the source. - If there is no prefix, it will be the empty string. - """) - prefixWord: string; - - @doc(""" - A list of "back translations" of the target. For example, source words that the target can translate to. - The list is guaranteed to contain the source word that was requested (e.g., if the source word being - looked up is "fly", then it is guaranteed that "fly" will be in the backTranslations list). - However, it is not guaranteed to be in the first position, and often will not be. - """) - backTranslations: BackTranslation[]; -} - -@doc("Back Translation") -model BackTranslation { - @doc(""" - A string giving the normalized form of the source term that is a back-translation of the target. - This value should be used as input to lookup examples. - """) - normalizedText: string; - - @doc(""" - A string giving the source term that is a back-translation of the target in a form best - suited for end-user display. - """) - displayText: string; - - @doc(""" - An integer representing the number of examples that are available for this translation pair. - Actual examples must be retrieved with a separate call to lookup examples. The number is mostly - intended to facilitate display in a UX. For example, a user interface may add a hyperlink - to the back-translation if the number of examples is greater than zero and show the back-translation - as plain text if there are no examples. Note that the actual number of examples returned - by a call to lookup examples may be less than numExamples, because additional filtering may be - applied on the fly to remove "bad" examples. - """) - numExamples: int32; - - @doc(""" - An integer representing the frequency of this translation pair in the data. The main purpose of this - field is to provide a user interface with a means to sort back-translations so the most frequent terms are first. - """) - frequencyCount: int32; -} - -@doc("Dictionary Example element") -model DictionaryExampleItem { - @doc(""" - A string giving the normalized form of the source term. Generally, this should be identical - to the value of the Text field at the matching list index in the body of the request. - """) - normalizedSource: string; - - @doc(""" - A string giving the normalized form of the target term. Generally, this should be identical - to the value of the Translation field at the matching list index in the body of the request. - """) - normalizedTarget: string; - - @doc(""" - A list of examples for the (source term, target term) pair. - """) - examples: DictionaryExample[]; -} - -@doc("Dictionary Example") -model DictionaryExample { - @doc(""" - The string to concatenate before the value of sourceTerm to form a complete example. - Do not add a space character, since it is already there when it should be. - This value may be an empty string. - """) - sourcePrefix: string; - - @doc(""" - A string equal to the actual term looked up. The string is added with sourcePrefix - and sourceSuffix to form the complete example. Its value is separated so it can be - marked in a user interface, e.g., by bolding it. - """) - sourceTerm: string; - - @doc(""" - The string to concatenate after the value of sourceTerm to form a complete example. - Do not add a space character, since it is already there when it should be. - This value may be an empty string. - """) - sourceSuffix: string; - - @doc(""" - A string similar to sourcePrefix but for the target. - """) - targetPrefix: string; - - @doc(""" - A string similar to sourceTerm but for the target. - """) - targetTerm: string; - - @doc(""" - A string similar to sourceSuffix but for the target. - """) - targetSuffix: string; -} diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index f6ae8af63ae2..dad81e70674e 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -9,6 +9,101 @@ using Azure.Core; namespace TextTranslation; +@doc("Request body parameters for the translate API.") +model TranslateBodyParameters { + ...CommonParameters; + + #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Existing Spec" + @query(#{ explode: true }) + @doc(""" + Specifies the language of the output text. The target language must be one of the supported languages included + in the translation scope. For example, use to=de to translate to German. + It's possible to translate to multiple languages simultaneously by repeating the parameter in the query string. + For example, use to=de&to=it to translate to German and Italian. + """) + targetsLanguage: string[]; + + @query + @doc(""" + Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, + complete element. Possible values are: plain (default) or html. + """) + targetsTextType?: TextType = "Plain"; + + @query + @doc(""" + Specifies how profanities should be treated in translations. + Possible values are: NoAction (default), Marked or Deleted. + """) + targetsProfanityAction?: ProfanityAction = ProfanityAction.NoAction; + + @query + @doc(""" + Specifies how profanities should be marked in translations. + Possible values are: Asterisk (default) or Tag. + """) + targetsProfanityMarker?: ProfanityMarker = ProfanityMarker.Asterisk; + + @query + @doc(""" + Specifies the script of the input text. + """) + script?: string; + + @query + @doc(""" + Specifies the script of the translated text. + """) + targetsScript?: string; + + @query + @doc(""" + Model that should be used for translation. + """) + targetsdeploymentNameModel?: string; + + + @query + @doc(""" + In the case where a custom system is being used, specifies that the service is allowed to fall back to a + general system when a custom system doesn't exist. + In the case where a Large Language Model is being used, specifies that the service is allowed to fall + back to a Small Language Model if an error occurs. + Possible values are: true (default) or false. + + allowFallback=false specifies that the translation should only use systems trained for the category specified + by the request. If a translation for language X to language Y requires chaining through a pivot language E, + then all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. + If no system is found with the specific category, the request will return a 400 status code. allowFallback=true + specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. + """) + targetsAllowFallback?: boolean = true; + + @query + @doc(""" + Defines complexity of LLM prompts to provide high accuracy translation. + """) + targetsGrade?: string; + + @query + @doc(""" + Desired tone of target translation. + """) + targetsTone?: string; + + @query + @doc(""" + Desired gender of target translation. + """) + targetsGender?: string; + + @query + @doc(""" + Reference dataset ID having sentence pair to generate adaptive customized translation + """) + targetsAdaptiveDatasetIds?: string[]; +} + @doc("Request parameters for the translate API.") model TranslateParameters { ...CommonParameters; @@ -99,7 +194,10 @@ model TranslateParameters { @query @doc(""" - Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. + In the case where a custom system is being used, specifies that the service is allowed to fall back to a + general system when a custom system doesn't exist. + In the case where a Large Language Model is being used, specifies that the service is allowed to fall + back to a Small Language Model if an error occurs. Possible values are: true (default) or false. allowFallback=false specifies that the translation should only use systems trained for the category specified @@ -220,44 +318,6 @@ model TranslationText { An object giving the translated text in the script specified by the toScript parameter. """) transliteration?: TransliteratedText; - - @doc(""" - Alignment information. - """) - alignment?: TranslatedTextAlignment; - - @doc(""" - Sentence boundaries in the input and output texts. - """) - sentLen?: SentenceBoundaries; -} - -@doc("Alignment information object.") -model TranslatedTextAlignment { - @doc(""" - Maps input text to translated text. The alignment information is only provided when the request - parameter includeAlignment is true. Alignment is returned as a string value of the following - format: [[SourceTextStartIndex]:[SourceTextEndIndex]–[TgtTextStartIndex]:[TgtTextEndIndex]]. - The colon separates start and end index, the dash separates the languages, and space separates the words. - One word may align with zero, one, or multiple words in the other language, and the aligned words may - be non-contiguous. When no alignment information is available, the alignment element will be empty. - """) - proj: string; -} - -@doc("An object returning sentence boundaries in the input and output texts.") -model SentenceBoundaries { - @doc(""" - An integer array representing the lengths of the sentences in the input text. - The length of the array is the number of sentences, and the values are the length of each sentence. - """) - srcSentLen: int32[]; - - @doc(""" - An integer array representing the lengths of the sentences in the translated text. - The length of the array is the number of sentences, and the values are the length of each sentence. - """) - transSentLen: int32[]; } @doc("Input text in the default script of the source language. ") diff --git a/specification/translation/Azure.AI.TextTranslation/routes.tsp b/specification/translation/Azure.AI.TextTranslation/routes.tsp index a59a25aa2362..97a6e3d072e4 100644 --- a/specification/translation/Azure.AI.TextTranslation/routes.tsp +++ b/specification/translation/Azure.AI.TextTranslation/routes.tsp @@ -3,8 +3,6 @@ import "@azure-tools/typespec-azure-core"; import "./models-languages.tsp"; import "./models-translate.tsp"; import "./models-transliterate.tsp"; -import "./models-breaksentence.tsp"; -import "./models-dictionary.tsp"; using Azure.Core; using TypeSpec.Rest; @@ -59,7 +57,7 @@ op getSupportedLanguages is CustomGetOperation< @summary("Translate Text") @doc("Translate Text") op translate is CustomOperation< - InputTextItem[], + TranslateBodyParameters, TranslateParameters, TranslationResult, {}, @@ -78,42 +76,3 @@ op transliterate is CustomOperation< {}, ErrorResponse >; - -#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." -@post -@route("breaksentence") -@summary("Find Sentence Boundaries") -@doc("Find Sentence Boundaries") -op findSentenceBoundaries is CustomOperation< - InputTextItem[], - BreakSentenceParameters, - BreakSentenceResult, - {}, - ErrorResponse ->; - -#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." -@post -@route("dictionary/lookup") -@summary("Lookup Dictionary Entries") -@doc("Lookup Dictionary Entries") -op lookupDictionaryEntries is CustomOperation< - InputTextItem[], - DictionaryLookupParameters, - DictionaryLookupResult, - {}, - ErrorResponse ->; - -#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." -@post -@route("dictionary/examples") -@summary("Lookup Dictionary Examples") -@doc("Lookup Dictionary Examples") -op lookupDictionaryExamples is CustomOperation< - DictionaryExampleTextItem[], - DictionaryExamplesParameters, - DictionaryExamplesResult, - {}, - ErrorResponse ->; From 04128285ab947c84f85e9f093233e2b6f60926a7 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 31 Mar 2025 09:53:04 -0700 Subject: [PATCH 007/119] Update typespec for translate call --- .../Azure.AI.TextTranslation/tspconfig.yaml | 2 +- .../preview/2025-05-01/openapi.json | 348 +++++++++--------- 2 files changed, 173 insertions(+), 177 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml b/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml index e1112abc09d8..4fed4cd3bdd8 100644 --- a/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml +++ b/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml @@ -16,7 +16,7 @@ options: azure-resource-provider-folder: "data-plane" emit-lro-options: "none" emitter-output-dir: "{project-root}/.." - output-file: "{azure-resource-provider-folder}/Azure.AI.TextTranslation/stable/v3.0/openapi.json" + output-file: "{azure-resource-provider-folder}/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json" "@azure-tools/typespec-csharp": package-dir: "Azure.AI.Translation.Text" clear-output-folder: true diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json index acdfc67a2806..d94fac6512d5 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json @@ -3,7 +3,7 @@ "info": { "title": "Text Translation", "version": "2025-05-01-preview", - "description": "Text translation is a cloud-based REST API feature of the Translator service that uses neural\nmachine translation technology to enable quick and accurate source-to-target text translation\nin real time across all supported languages.\n\nThe following methods are supported by the Text Translation feature:\n\nLanguages. Returns a list of languages supported by Translate, Transliterate, and Dictionary Lookup operations.\n\nTranslate. Renders single source-language text to multiple target-language texts with a single request.\n\nTransliterate. Converts characters or letters of a source language to the corresponding characters or letters of a target language.\n\nDetect. Returns the source code language code and a boolean variable denoting whether the detected language is supported for text translation and transliteration.\n\nDictionary lookup. Returns equivalent words for the source term in the target language.\n\nDictionary example Returns grammatical structure and context examples for the source term and target term pair.", + "description": "Text translation is a cloud-based REST API feature of the Translator service that uses neural\nmachine translation technology to enable quick and accurate source-to-target text translation\nin real time across all supported languages.\n\nThe following methods are supported by the Text Translation feature:\n\nLanguages. Returns a list of languages supported by Translate, Transliterate, and Dictionary Lookup operations.\n\nTranslate. Renders single source-language text to multiple target-language texts with a single request.\n\nTransliterate. Converts characters or letters of a source language to the corresponding characters or letters of a target language.\n\nDetect. Returns the source code language code and a boolean variable denoting whether the detected language is supported for text translation and transliteration.", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" @@ -97,14 +97,6 @@ } } } - }, - "x-ms-examples": { - "Gets the set of languages currently supported by other operations of the Translator with minimum properties.": { - "$ref": "./examples/GetSupportedLanguages_MinimumSet_Gen.json" - }, - "Gets the set of languages currently supported by other operations of the Translator.": { - "$ref": "./examples/GetSupportedLanguages_MaximumSet_Gen.json" - } } } }, @@ -123,129 +115,210 @@ "x-ms-client-name": "clientTraceId" }, { - "name": "targets.language", - "in": "body", - "description":"The language code for the source text. If not specified, the system will autodetect the language of the source text. Possible values are list of language code supported by the specified model.", - "required": false, - "schema": { - "type":"string" - } + "$ref": "#/parameters/TranslateParameters.to" }, { - "name": "targets.textType", - "in": "body", - "description":"Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, complete element. Possible values are: plain (default) or html.", + "$ref": "#/parameters/TranslateParameters.from" + }, + { + "$ref": "#/parameters/TranslateParameters.textType" + }, + { + "$ref": "#/parameters/TranslateParameters.category" + }, + { + "$ref": "#/parameters/TranslateParameters.profanityAction" + }, + { + "$ref": "#/parameters/TranslateParameters.profanityMarker" + }, + { + "$ref": "#/parameters/TranslateParameters.includeAlignment" + }, + { + "$ref": "#/parameters/TranslateParameters.includeSentenceLength" + }, + { + "$ref": "#/parameters/TranslateParameters.suggestedFrom" + }, + { + "$ref": "#/parameters/TranslateParameters.fromScript" + }, + { + "$ref": "#/parameters/TranslateParameters.toScript" + }, + { + "$ref": "#/parameters/TranslateParameters.allowFallback" + }, + { + "name": "X-ClientTraceId", + "in": "header", + "description": "A client-generated GUID to uniquely identify the request.", "required": false, - "schema": { - "type":"string" - } + "type": "string", + "x-ms-client-name": "clientTraceId" }, { - "name": "targets.profanityAction", - "in": "body", - "description":"Specifies how profanities should be treated in translations. Possible values are: NoAction (default), Marked, or Deleted.", + "name": "targetsLanguage", + "in": "query", + "description": "Specifies the language of the output text. The target language must be one of the supported languages included \nin the translation scope. For example, use to=de to translate to German.\nIt's possible to translate to multiple languages simultaneously by repeating the parameter in the query string. \nFor example, use to=de&to=it to translate to German and Italian.", + "required": true, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "targetsTextType", + "in": "query", + "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", "required": false, - "schema": { - "type":"string" + "type": "string", + "default": "Plain", + "enum": [ + "Plain", + "Html" + ], + "x-ms-enum": { + "name": "TextType", + "modelAsString": true, + "values": [ + { + "name": "Plain", + "value": "Plain", + "description": "Plain text." + }, + { + "name": "Html", + "value": "Html", + "description": "HTML-encoded text." + } + ] } }, { - "name": "targets.profanityMarker", - "in": "body", - "description":"Specifies how profanities should be marked in translations. Possible value or Tags are Asterisk (default).", + "name": "targetsProfanityAction", + "in": "query", + "description": "Specifies how profanities should be treated in translations.\nPossible values are: NoAction (default), Marked or Deleted.", "required": false, - "schema": { - "type":"string" + "type": "string", + "default": "NoAction", + "enum": [ + "NoAction", + "Marked", + "Deleted" + ], + "x-ms-enum": { + "name": "ProfanityAction", + "modelAsString": false, + "values": [ + { + "name": "NoAction", + "value": "NoAction", + "description": "No Action is taken on profanity" + }, + { + "name": "Marked", + "value": "Marked", + "description": "Profanity is marked." + }, + { + "name": "Deleted", + "value": "Deleted", + "description": "Profanity is deleted from the translated text." + } + ] } }, { - "name": "script", - "in": "body", - "description":"Specify the script of the source text.", + "name": "targetsProfanityMarker", + "in": "query", + "description": "Specifies how profanities should be marked in translations.\nPossible values are: Asterisk (default) or Tag. ", "required": false, - "schema": { - "type":"string" + "type": "string", + "default": "Asterisk", + "enum": [ + "Asterisk", + "Tag" + ], + "x-ms-enum": { + "name": "ProfanityMarker", + "modelAsString": false, + "values": [ + { + "name": "Asterisk", + "value": "Asterisk", + "description": "Profanity is marked with asterisk." + }, + { + "name": "Tag", + "value": "Tag", + "description": "Profanity is marked with the tags." + } + ] } }, { - "name": "targets.script", - "in": "body", - "description":"Specify the script of the translated text.", + "name": "script", + "in": "query", + "description": "Specifies the script of the input text.", "required": false, - "schema": { - "type":"string" - } + "type": "string" }, { - "name": "targets.deploymentNameModel", - "in": "body", - "description":"Model that should be used for translation.", + "name": "targetsScript", + "in": "query", + "description": "Specifies the script of the translated text.", "required": false, - "schema": { - "type":"string" - } + "type": "string" }, { - "name": "targets.allowFallback", - "in": "body", - "description":"Specifies that the service is allowed to fall back to a general system when a model specified isn’t supported for specified source and target language pair.", + "name": "targetsdeploymentNameModel", + "in": "query", + "description": "Model that should be used for translation.", "required": false, - "schema": { - "type":"string" - } + "type": "string" }, { - "name": "targets.grade", - "in": "body", - "description":"Defines complexity of LLM prompts to provide high accuracy translation.", + "name": "targetsAllowFallback", + "in": "query", + "description": "In the case where a custom system is being used, specifies that the service is allowed to fall back to a\ngeneral system when a custom system doesn't exist. \nIn the case where a Large Language Model is being used, specifies that the service is allowed to fall\nback to a Small Language Model if an error occurs.\nPossible values are: true (default) or false.\n\nallowFallback=false specifies that the translation should only use systems trained for the category specified \nby the request. If a translation for language X to language Y requires chaining through a pivot language E, \nthen all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. \nIf no system is found with the specific category, the request will return a 400 status code. allowFallback=true \nspecifies that the service is allowed to fall back to a general system when a custom system doesn't exist.", "required": false, - "schema": { - "type":"string" - } + "type": "boolean", + "default": true }, { - "name": "targets.tone", - "in": "body", - "description":"Desired tone of target translation.", + "name": "targetsGrade", + "in": "query", + "description": "Defines complexity of LLM prompts to provide high accuracy translation.", "required": false, - "schema": { - "type":"string" - } + "type": "string" }, { - "name": "targets.gender", - "in": "body", - "description":"Desired gender of target translation.", + "name": "targetsTone", + "in": "query", + "description": "Desired tone of target translation.", "required": false, - "schema": { - "type":"string" - } + "type": "string" }, { - "name": "targets.adaptiveDatasetId", - "in": "body", - "description":"Reference dataset ID having sentence pair to generate adaptive customized translation", + "name": "targetsGender", + "in": "query", + "description": "Desired gender of target translation.", "required": false, - "schema": { - "type": "string", - "items": { - "$ref": "#/definitions/AdaptiveDatasetId" - }, - "x-ms-identifiers": [] - } + "type": "string" }, { - "name": "targets.instruct", - "in":"body", - "description":"Free flow textual instruction for LLM translation. This negates all other key parameters within targets.", + "name": "targetsAdaptiveDatasetIds", + "in": "query", + "description": "Reference dataset ID having sentence pair to generate adaptive customized translation", "required": false, - "schema": { - "type": "string", - "items": { - "$ref": "#/definitions/Instruction" - }, - "x-ms-identifiers": [] - } + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "csv" }, { "name": "api-version", @@ -256,29 +329,12 @@ "x-ms-client-name": "apiVersion" }, { - "name": "targets.text", + "name": "body", "in": "body", - "description": "Defines the translation content of the request", + "description": "Defines the content of the request", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [] - } - }, - { - "name": "targets.referenceTextPairs", - "in": "body", - "description": "Reference text pairs to generate adaptive customized translation.", - "required": false, - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/ReferenceSentencePair" - }, - "x-ms-identifiers": [] + "$ref": "#/definitions/TranslateBodyParameters" } } ], @@ -320,14 +376,6 @@ } } } - }, - "x-ms-examples": { - "Translate Text": { - "$ref": "./examples/Translate_MaximumSet_Gen.json" - }, - "Translate Text with minimum properties": { - "$ref": "./examples/Translate_MinimumSet_Gen.json" - } } } }, @@ -405,27 +453,11 @@ } } } - }, - "x-ms-examples": { - "Transliterate Text": { - "$ref": "./examples/Transliterate_MaximumSet_Gen.json" - }, - "Transliterate Text with minimum properties": { - "$ref": "./examples/Transliterate_MinimumSet_Gen.json" - } } } } }, "definitions": { - "AdaptiveDatasetId": { - "description": "Reference dataset ID having sentence pair to generate adaptive customized translation.", - "properties": { - "TranslateParameters.targets.adaptiveDatasetId": { - "type": "string" - } - } - }, "DetectedLanguage": { "type": "object", "description": "An object describing the detected language.", @@ -517,15 +549,6 @@ "text" ] }, - "Instruction": { - "description": "Free flow textual instruction for LLM translation. This negates all other key parameters within targets.", - "properties": { - "TranslateParameters.targets.instruct": { - "type": "string", - "description":"Free flow textual instruction for LLM translation. This negates all other key parameters within targets." - } - } - }, "LanguageDirectionality": { "type": "string", "description": "Language Directionality", @@ -632,24 +655,6 @@ ] } }, - "ReferenceSentencePair": { - "type": "object", - "description": "Reference sentence pairs to generate adaptive customized translation", - "properties": { - "targets.referenceTextPairs.source": { - "$ref": "#/definitions/InputTextItem", - "description": "Source reference sentence." - }, - "targets.referenceTextPairs.target": { - "$ref": "#/definitions/InputTextItem", - "description": "Target reference sentence." - } - }, - "required": [ - "targets.referenceTextPairs.source", - "targets.referenceTextPairs.target" - ] - }, "SourceDictionaryLanguage": { "type": "object", "description": "Properties ot the source dictionary language", @@ -747,18 +752,9 @@ ] } }, - "TranslatedTextAlignment": { + "TranslateBodyParameters": { "type": "object", - "description": "Alignment information object.", - "properties": { - "proj": { - "type": "string", - "description": "Maps input text to translated text. The alignment information is only provided when the request \nparameter includeAlignment is true. Alignment is returned as a string value of the following \nformat: [[SourceTextStartIndex]:[SourceTextEndIndex]–[TgtTextStartIndex]:[TgtTextEndIndex]]. \nThe colon separates start and end index, the dash separates the languages, and space separates the words. \nOne word may align with zero, one, or multiple words in the other language, and the aligned words may \nbe non-contiguous. When no alignment information is available, the alignment element will be empty." - } - }, - "required": [ - "proj" - ] + "description": "Request body parameters for the translate API." }, "TranslatedTextItem": { "type": "object", @@ -963,7 +959,7 @@ "TranslateParameters.allowFallback": { "name": "allowFallback", "in": "query", - "description": "Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. \nPossible values are: true (default) or false.\n\nallowFallback=false specifies that the translation should only use systems trained for the category specified \nby the request. If a translation for language X to language Y requires chaining through a pivot language E, \nthen all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. \nIf no system is found with the specific category, the request will return a 400 status code. allowFallback=true \nspecifies that the service is allowed to fall back to a general system when a custom system doesn't exist.", + "description": "In the case where a custom system is being used, specifies that the service is allowed to fall back to a\ngeneral system when a custom system doesn't exist. \nIn the case where a Large Language Model is being used, specifies that the service is allowed to fall\nback to a Small Language Model if an error occurs.\nPossible values are: true (default) or false.\n\nallowFallback=false specifies that the translation should only use systems trained for the category specified \nby the request. If a translation for language X to language Y requires chaining through a pivot language E, \nthen all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. \nIf no system is found with the specific category, the request will return a 400 status code. allowFallback=true \nspecifies that the service is allowed to fall back to a general system when a custom system doesn't exist.", "required": false, "type": "boolean", "default": true, From f3ead0211860f94063c56301bb3a248426ca4835 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 31 Mar 2025 09:59:57 -0700 Subject: [PATCH 008/119] update typespec for translate call - Fix Formatting --- .../translation/Azure.AI.TextTranslation/main.tsp | 2 +- .../Azure.AI.TextTranslation/models-translate.tsp | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/main.tsp b/specification/translation/Azure.AI.TextTranslation/main.tsp index b1255fd6512d..878ffd2e4707 100644 --- a/specification/translation/Azure.AI.TextTranslation/main.tsp +++ b/specification/translation/Azure.AI.TextTranslation/main.tsp @@ -45,5 +45,5 @@ enum APIVersion { v3_0: "3.0", @doc("Version 2025-05-01") - v2025_05_01_preview: "2025-05-01-preview" + v2025_05_01_preview: "2025-05-01-preview", } diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index dad81e70674e..bc757241e704 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -16,11 +16,11 @@ model TranslateBodyParameters { #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Existing Spec" @query(#{ explode: true }) @doc(""" - Specifies the language of the output text. The target language must be one of the supported languages included - in the translation scope. For example, use to=de to translate to German. - It's possible to translate to multiple languages simultaneously by repeating the parameter in the query string. - For example, use to=de&to=it to translate to German and Italian. - """) + Specifies the language of the output text. The target language must be one of the supported languages included + in the translation scope. For example, use to=de to translate to German. + It's possible to translate to multiple languages simultaneously by repeating the parameter in the query string. + For example, use to=de&to=it to translate to German and Italian. + """) targetsLanguage: string[]; @query @@ -60,9 +60,8 @@ model TranslateBodyParameters { @doc(""" Model that should be used for translation. """) - targetsdeploymentNameModel?: string; + targetsdeploymentNameModel?: string; - @query @doc(""" In the case where a custom system is being used, specifies that the service is allowed to fall back to a From 7130eeccbb72765f662f963ae2f8202936038998 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Thu, 3 Apr 2025 17:25:13 -0700 Subject: [PATCH 009/119] CHeckpoint on translate API update --- .../models-translate.tsp | 33 +- .../preview/2025-05-01/openapi.json | 315 +++++++++--------- 2 files changed, 167 insertions(+), 181 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index bc757241e704..f8332ea24244 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -13,56 +13,61 @@ namespace TextTranslation; model TranslateBodyParameters { ...CommonParameters; - #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Existing Spec" - @query(#{ explode: true }) + @doc(""" + Details of the translate request + """) + @body + body: TranslateBodyDetails; +} + +@doc("Request body parameters for the translate API.") +model TranslateBodyDetails { + + @doc(""" + Specifies the text string to be translated in the translate API. + """) + text: InputTextItem; + @doc(""" Specifies the language of the output text. The target language must be one of the supported languages included - in the translation scope. For example, use to=de to translate to German. - It's possible to translate to multiple languages simultaneously by repeating the parameter in the query string. - For example, use to=de&to=it to translate to German and Italian. + in the translation scope. It's possible to translate to multiple languages simultaneously by including + multiple string values in the targetsLanguage array. """) targetsLanguage: string[]; - @query @doc(""" Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, complete element. Possible values are: plain (default) or html. """) targetsTextType?: TextType = "Plain"; - @query @doc(""" Specifies how profanities should be treated in translations. Possible values are: NoAction (default), Marked or Deleted. """) targetsProfanityAction?: ProfanityAction = ProfanityAction.NoAction; - @query @doc(""" Specifies how profanities should be marked in translations. Possible values are: Asterisk (default) or Tag. """) targetsProfanityMarker?: ProfanityMarker = ProfanityMarker.Asterisk; - @query @doc(""" Specifies the script of the input text. """) script?: string; - @query @doc(""" Specifies the script of the translated text. """) targetsScript?: string; - @query @doc(""" Model that should be used for translation. """) targetsdeploymentNameModel?: string; - @query @doc(""" In the case where a custom system is being used, specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. @@ -78,25 +83,21 @@ model TranslateBodyParameters { """) targetsAllowFallback?: boolean = true; - @query @doc(""" Defines complexity of LLM prompts to provide high accuracy translation. """) targetsGrade?: string; - @query @doc(""" Desired tone of target translation. """) targetsTone?: string; - @query @doc(""" Desired gender of target translation. """) targetsGender?: string; - @query @doc(""" Reference dataset ID having sentence pair to generate adaptive customized translation """) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json index d94fac6512d5..302cc10b8c3e 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json @@ -158,168 +158,6 @@ "type": "string", "x-ms-client-name": "clientTraceId" }, - { - "name": "targetsLanguage", - "in": "query", - "description": "Specifies the language of the output text. The target language must be one of the supported languages included \nin the translation scope. For example, use to=de to translate to German.\nIt's possible to translate to multiple languages simultaneously by repeating the parameter in the query string. \nFor example, use to=de&to=it to translate to German and Italian.", - "required": true, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "targetsTextType", - "in": "query", - "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", - "required": false, - "type": "string", - "default": "Plain", - "enum": [ - "Plain", - "Html" - ], - "x-ms-enum": { - "name": "TextType", - "modelAsString": true, - "values": [ - { - "name": "Plain", - "value": "Plain", - "description": "Plain text." - }, - { - "name": "Html", - "value": "Html", - "description": "HTML-encoded text." - } - ] - } - }, - { - "name": "targetsProfanityAction", - "in": "query", - "description": "Specifies how profanities should be treated in translations.\nPossible values are: NoAction (default), Marked or Deleted.", - "required": false, - "type": "string", - "default": "NoAction", - "enum": [ - "NoAction", - "Marked", - "Deleted" - ], - "x-ms-enum": { - "name": "ProfanityAction", - "modelAsString": false, - "values": [ - { - "name": "NoAction", - "value": "NoAction", - "description": "No Action is taken on profanity" - }, - { - "name": "Marked", - "value": "Marked", - "description": "Profanity is marked." - }, - { - "name": "Deleted", - "value": "Deleted", - "description": "Profanity is deleted from the translated text." - } - ] - } - }, - { - "name": "targetsProfanityMarker", - "in": "query", - "description": "Specifies how profanities should be marked in translations.\nPossible values are: Asterisk (default) or Tag. ", - "required": false, - "type": "string", - "default": "Asterisk", - "enum": [ - "Asterisk", - "Tag" - ], - "x-ms-enum": { - "name": "ProfanityMarker", - "modelAsString": false, - "values": [ - { - "name": "Asterisk", - "value": "Asterisk", - "description": "Profanity is marked with asterisk." - }, - { - "name": "Tag", - "value": "Tag", - "description": "Profanity is marked with the tags." - } - ] - } - }, - { - "name": "script", - "in": "query", - "description": "Specifies the script of the input text.", - "required": false, - "type": "string" - }, - { - "name": "targetsScript", - "in": "query", - "description": "Specifies the script of the translated text.", - "required": false, - "type": "string" - }, - { - "name": "targetsdeploymentNameModel", - "in": "query", - "description": "Model that should be used for translation.", - "required": false, - "type": "string" - }, - { - "name": "targetsAllowFallback", - "in": "query", - "description": "In the case where a custom system is being used, specifies that the service is allowed to fall back to a\ngeneral system when a custom system doesn't exist. \nIn the case where a Large Language Model is being used, specifies that the service is allowed to fall\nback to a Small Language Model if an error occurs.\nPossible values are: true (default) or false.\n\nallowFallback=false specifies that the translation should only use systems trained for the category specified \nby the request. If a translation for language X to language Y requires chaining through a pivot language E, \nthen all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. \nIf no system is found with the specific category, the request will return a 400 status code. allowFallback=true \nspecifies that the service is allowed to fall back to a general system when a custom system doesn't exist.", - "required": false, - "type": "boolean", - "default": true - }, - { - "name": "targetsGrade", - "in": "query", - "description": "Defines complexity of LLM prompts to provide high accuracy translation.", - "required": false, - "type": "string" - }, - { - "name": "targetsTone", - "in": "query", - "description": "Desired tone of target translation.", - "required": false, - "type": "string" - }, - { - "name": "targetsGender", - "in": "query", - "description": "Desired gender of target translation.", - "required": false, - "type": "string" - }, - { - "name": "targetsAdaptiveDatasetIds", - "in": "query", - "description": "Reference dataset ID having sentence pair to generate adaptive customized translation", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "csv" - }, { "name": "api-version", "in": "query", @@ -331,10 +169,10 @@ { "name": "body", "in": "body", - "description": "Defines the content of the request", + "description": "Details of the translate request", "required": true, "schema": { - "$ref": "#/definitions/TranslateBodyParameters" + "$ref": "#/definitions/TranslateBodyDetails" } } ], @@ -752,9 +590,156 @@ ] } }, + "TranslateBodyDetails": { + "type": "object", + "description": "Request body parameters for the translate API.", + "properties": { + "text": { + "$ref": "#/definitions/InputTextItem", + "description": "Specifies the text string to be translated in the translate API." + }, + "targetsLanguage": { + "type": "array", + "description": "Specifies the language of the output text. The target language must be one of the supported languages included \nin the translation scope. It's possible to translate to multiple languages simultaneously by including \nmultiple string values in the targetsLanguage array.", + "items": { + "type": "string" + } + }, + "targetsTextType": { + "type": "string", + "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", + "default": "Plain", + "enum": [ + "Plain", + "Html" + ], + "x-ms-enum": { + "name": "TextType", + "modelAsString": true, + "values": [ + { + "name": "Plain", + "value": "Plain", + "description": "Plain text." + }, + { + "name": "Html", + "value": "Html", + "description": "HTML-encoded text." + } + ] + } + }, + "targetsProfanityAction": { + "type": "string", + "description": "Specifies how profanities should be treated in translations.\nPossible values are: NoAction (default), Marked or Deleted.", + "default": "NoAction", + "enum": [ + "NoAction", + "Marked", + "Deleted" + ], + "x-ms-enum": { + "name": "ProfanityAction", + "modelAsString": false, + "values": [ + { + "name": "NoAction", + "value": "NoAction", + "description": "No Action is taken on profanity" + }, + { + "name": "Marked", + "value": "Marked", + "description": "Profanity is marked." + }, + { + "name": "Deleted", + "value": "Deleted", + "description": "Profanity is deleted from the translated text." + } + ] + } + }, + "targetsProfanityMarker": { + "type": "string", + "description": "Specifies how profanities should be marked in translations.\nPossible values are: Asterisk (default) or Tag. ", + "default": "Asterisk", + "enum": [ + "Asterisk", + "Tag" + ], + "x-ms-enum": { + "name": "ProfanityMarker", + "modelAsString": false, + "values": [ + { + "name": "Asterisk", + "value": "Asterisk", + "description": "Profanity is marked with asterisk." + }, + { + "name": "Tag", + "value": "Tag", + "description": "Profanity is marked with the tags." + } + ] + } + }, + "script": { + "type": "string", + "description": "Specifies the script of the input text." + }, + "targetsScript": { + "type": "string", + "description": "Specifies the script of the translated text." + }, + "targetsdeploymentNameModel": { + "type": "string", + "description": "Model that should be used for translation." + }, + "targetsAllowFallback": { + "type": "boolean", + "description": "In the case where a custom system is being used, specifies that the service is allowed to fall back to a\ngeneral system when a custom system doesn't exist. \nIn the case where a Large Language Model is being used, specifies that the service is allowed to fall\nback to a Small Language Model if an error occurs.\nPossible values are: true (default) or false.\n\nallowFallback=false specifies that the translation should only use systems trained for the category specified \nby the request. If a translation for language X to language Y requires chaining through a pivot language E, \nthen all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. \nIf no system is found with the specific category, the request will return a 400 status code. allowFallback=true \nspecifies that the service is allowed to fall back to a general system when a custom system doesn't exist.", + "default": true + }, + "targetsGrade": { + "type": "string", + "description": "Defines complexity of LLM prompts to provide high accuracy translation." + }, + "targetsTone": { + "type": "string", + "description": "Desired tone of target translation." + }, + "targetsGender": { + "type": "string", + "description": "Desired gender of target translation." + }, + "targetsAdaptiveDatasetIds": { + "type": "array", + "description": "Reference dataset ID having sentence pair to generate adaptive customized translation", + "items": { + "type": "string" + } + } + }, + "required": [ + "text", + "targetsLanguage" + ] + }, "TranslateBodyParameters": { "type": "object", - "description": "Request body parameters for the translate API." + "description": "Request body parameters for the translate API.", + "properties": { + "body": { + "$ref": "#/definitions/TranslateBodyDetails", + "description": "Details of the translate request" + } + }, + "required": [ + "body" + ] }, "TranslatedTextItem": { "type": "object", From ef4a153ba4ade586f824d61512f3f62e011e9f05 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 7 Apr 2025 13:43:08 -0700 Subject: [PATCH 010/119] Add reference sentences into set --- .../models-translate.tsp | 182 ++++++++++-------- .../Azure.AI.TextTranslation/routes.tsp | 2 +- ...FindSentenceBoundaries_MaximumSet_Gen.json | 28 --- ...FindSentenceBoundaries_MinimumSet_Gen.json | 29 --- ...ookupDictionaryEntries_MaximumSet_Gen.json | 87 --------- ...ookupDictionaryEntries_MinimumSet_Gen.json | 86 --------- ...okupDictionaryExamples_MaximumSet_Gen.json | 44 ----- ...okupDictionaryExamples_MinimumSet_Gen.json | 43 ----- .../preview/2025-05-01/openapi.json | 58 ++++-- 9 files changed, 142 insertions(+), 417 deletions(-) delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/FindSentenceBoundaries_MaximumSet_Gen.json delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/FindSentenceBoundaries_MinimumSet_Gen.json delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryEntries_MaximumSet_Gen.json delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryEntries_MinimumSet_Gen.json delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryExamples_MaximumSet_Gen.json delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryExamples_MinimumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index f8332ea24244..f1cad6b6feee 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -20,90 +20,6 @@ model TranslateBodyParameters { body: TranslateBodyDetails; } -@doc("Request body parameters for the translate API.") -model TranslateBodyDetails { - - @doc(""" - Specifies the text string to be translated in the translate API. - """) - text: InputTextItem; - - @doc(""" - Specifies the language of the output text. The target language must be one of the supported languages included - in the translation scope. It's possible to translate to multiple languages simultaneously by including - multiple string values in the targetsLanguage array. - """) - targetsLanguage: string[]; - - @doc(""" - Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, - complete element. Possible values are: plain (default) or html. - """) - targetsTextType?: TextType = "Plain"; - - @doc(""" - Specifies how profanities should be treated in translations. - Possible values are: NoAction (default), Marked or Deleted. - """) - targetsProfanityAction?: ProfanityAction = ProfanityAction.NoAction; - - @doc(""" - Specifies how profanities should be marked in translations. - Possible values are: Asterisk (default) or Tag. - """) - targetsProfanityMarker?: ProfanityMarker = ProfanityMarker.Asterisk; - - @doc(""" - Specifies the script of the input text. - """) - script?: string; - - @doc(""" - Specifies the script of the translated text. - """) - targetsScript?: string; - - @doc(""" - Model that should be used for translation. - """) - targetsdeploymentNameModel?: string; - - @doc(""" - In the case where a custom system is being used, specifies that the service is allowed to fall back to a - general system when a custom system doesn't exist. - In the case where a Large Language Model is being used, specifies that the service is allowed to fall - back to a Small Language Model if an error occurs. - Possible values are: true (default) or false. - - allowFallback=false specifies that the translation should only use systems trained for the category specified - by the request. If a translation for language X to language Y requires chaining through a pivot language E, - then all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. - If no system is found with the specific category, the request will return a 400 status code. allowFallback=true - specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. - """) - targetsAllowFallback?: boolean = true; - - @doc(""" - Defines complexity of LLM prompts to provide high accuracy translation. - """) - targetsGrade?: string; - - @doc(""" - Desired tone of target translation. - """) - targetsTone?: string; - - @doc(""" - Desired gender of target translation. - """) - targetsGender?: string; - - @doc(""" - Reference dataset ID having sentence pair to generate adaptive customized translation - """) - targetsAdaptiveDatasetIds?: string[]; -} - @doc("Request parameters for the translate API.") model TranslateParameters { ...CommonParameters; @@ -193,6 +109,67 @@ model TranslateParameters { toScript?: string; @query + @doc(""" + Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. + Possible values are: true (default) or false. + + allowFallback=false specifies that the translation should only use systems trained for the category specified + by the request. If a translation for language X to language Y requires chaining through a pivot language E, + then all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. + If no system is found with the specific category, the request will return a 400 status code. allowFallback=true + specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. + """) + allowFallback?: boolean = true; +} + +@doc("Request body parameters for the translate API.") +model TranslateBodyDetails { + + @doc(""" + Specifies the text string to be translated in the translate API. + """) + text: InputTextItem[]; + + @doc(""" + Specifies the language of the output text. The target language must be one of the supported languages included + in the translation scope. It's possible to translate to multiple languages simultaneously by including + multiple string values in the targetsLanguage array. + """) + targetsLanguage: string[]; + + @doc(""" + Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, + complete element. Possible values are: plain (default) or html. + """) + targetsTextType?: TextType = "Plain"; + + @doc(""" + Specifies how profanities should be treated in translations. + Possible values are: NoAction (default), Marked or Deleted. + """) + targetsProfanityAction?: ProfanityAction = ProfanityAction.NoAction; + + @doc(""" + Specifies how profanities should be marked in translations. + Possible values are: Asterisk (default) or Tag. + """) + targetsProfanityMarker?: ProfanityMarker = ProfanityMarker.Asterisk; + + @doc(""" + Specifies the script of the input text. + """) + script?: string; + + @doc(""" + Specifies the script of the translated text. + """) + targetsScript?: string; + + @doc(""" + Model that should be used for translation. + """) + targetsdeploymentNameModel?: string; + @doc(""" In the case where a custom system is being used, specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. @@ -206,7 +183,42 @@ model TranslateParameters { If no system is found with the specific category, the request will return a 400 status code. allowFallback=true specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. """) - allowFallback?: boolean = true; + targetsAllowFallback?: boolean = true; + + @doc(""" + Defines complexity of LLM prompts to provide high accuracy translation. + """) + targetsGrade?: string; + + @doc(""" + Desired tone of target translation. + """) + targetsTone?: string; + + @doc(""" + Desired gender of target translation. + """) + targetsGender?: string; + + @doc(""" + Reference dataset ID having sentence pair to generate adaptive customized translation. + """) + targetsAdaptiveDatasetIds?: string[]; + + @doc(""" + Reference sentence pairs to generate adaptive results. + """) + targetsReferenceTextPairs?: ReferenceSentencePair[] +} + +@doc("Reference sentence pair.") +model ReferenceSentencePair { + + @doc("Source reference sentence.") + targetsReferenceTextPairsSource: string; + + @doc("Target reference sentence.") + targetsReferenceTextPairsTarget: string; } @doc("Response for the translation API.") diff --git a/specification/translation/Azure.AI.TextTranslation/routes.tsp b/specification/translation/Azure.AI.TextTranslation/routes.tsp index 97a6e3d072e4..3be3767f09db 100644 --- a/specification/translation/Azure.AI.TextTranslation/routes.tsp +++ b/specification/translation/Azure.AI.TextTranslation/routes.tsp @@ -57,7 +57,7 @@ op getSupportedLanguages is CustomGetOperation< @summary("Translate Text") @doc("Translate Text") op translate is CustomOperation< - TranslateBodyParameters, + TranslateBodyParameters[], TranslateParameters, TranslationResult, {}, diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/FindSentenceBoundaries_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/FindSentenceBoundaries_MaximumSet_Gen.json deleted file mode 100644 index 1847c3f5e3d3..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/FindSentenceBoundaries_MaximumSet_Gen.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "title": "Find Sentence Boundaries", - "operationId": "FindSentenceBoundaries", - "parameters": { - "X-ClientTraceId": "svun", - "language": "en", - "script": "Latn", - "api-version": "3.0", - "body": [ - { - "text": "How are you? I am fine. What did you do today?" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "sentLen": [ - 13, - 11, - 22 - ] - } - ] - } - } -} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/FindSentenceBoundaries_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/FindSentenceBoundaries_MinimumSet_Gen.json deleted file mode 100644 index 4175072f8566..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/FindSentenceBoundaries_MinimumSet_Gen.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "title": "Find Sentence Boundaries with minimum properties", - "operationId": "FindSentenceBoundaries", - "parameters": { - "api-version": "3.0", - "body": [ - { - "text": "How are you? I am fine. What did you do today?" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "detectedLanguage": { - "language": "en", - "score": 1.0 - }, - "sentLen": [ - 13, - 11, - 22 - ] - } - ] - } - } -} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryEntries_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryEntries_MaximumSet_Gen.json deleted file mode 100644 index 636eb73b04f6..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryEntries_MaximumSet_Gen.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "title": "Lookup Dictionary Entries", - "operationId": "LookupDictionaryEntries", - "parameters": { - "X-ClientTraceId": "yqst", - "from": "en", - "to": "es", - "api-version": "3.0", - "body": [ - { - "text": "fly" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "normalizedSource": "fly", - "displaySource": "fly", - "translations": [ - { - "normalizedTarget": "volar", - "displayTarget": "volar", - "posTag": "VERB", - "confidence": 0.4081, - "prefixWord": "", - "backTranslations": [ - { - "normalizedText": "fly", - "displayText": "fly", - "numExamples": 15, - "frequencyCount": 4637 - }, - { - "normalizedText": "flying", - "displayText": "flying", - "numExamples": 15, - "frequencyCount": 1365 - }, - { - "normalizedText": "blow", - "displayText": "blow", - "numExamples": 15, - "frequencyCount": 503 - }, - { - "normalizedText": "flight", - "displayText": "flight", - "numExamples": 15, - "frequencyCount": 135 - } - ] - }, - { - "normalizedTarget": "mosca", - "displayTarget": "mosca", - "posTag": "NOUN", - "confidence": 0.2668, - "prefixWord": "", - "backTranslations": [ - { - "normalizedText": "fly", - "displayText": "fly", - "numExamples": 15, - "frequencyCount": 1697 - }, - { - "normalizedText": "flyweight", - "displayText": "flyweight", - "numExamples": 0, - "frequencyCount": 48 - }, - { - "normalizedText": "flies", - "displayText": "flies", - "numExamples": 9, - "frequencyCount": 34 - } - ] - } - ] - } - ] - } - } -} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryEntries_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryEntries_MinimumSet_Gen.json deleted file mode 100644 index dfc24a03bdea..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryEntries_MinimumSet_Gen.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "title": "Lookup Dictionary Entries with minimum properties", - "operationId": "LookupDictionaryEntries", - "parameters": { - "from": "en", - "to": "es", - "api-version": "3.0", - "body": [ - { - "text": "fly" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "normalizedSource": "fly", - "displaySource": "fly", - "translations": [ - { - "normalizedTarget": "volar", - "displayTarget": "volar", - "posTag": "VERB", - "confidence": 0.4081, - "prefixWord": "", - "backTranslations": [ - { - "normalizedText": "fly", - "displayText": "fly", - "numExamples": 15, - "frequencyCount": 4637 - }, - { - "normalizedText": "flying", - "displayText": "flying", - "numExamples": 15, - "frequencyCount": 1365 - }, - { - "normalizedText": "blow", - "displayText": "blow", - "numExamples": 15, - "frequencyCount": 503 - }, - { - "normalizedText": "flight", - "displayText": "flight", - "numExamples": 15, - "frequencyCount": 135 - } - ] - }, - { - "normalizedTarget": "mosca", - "displayTarget": "mosca", - "posTag": "NOUN", - "confidence": 0.2668, - "prefixWord": "", - "backTranslations": [ - { - "normalizedText": "fly", - "displayText": "fly", - "numExamples": 15, - "frequencyCount": 1697 - }, - { - "normalizedText": "flyweight", - "displayText": "flyweight", - "numExamples": 0, - "frequencyCount": 48 - }, - { - "normalizedText": "flies", - "displayText": "flies", - "numExamples": 9, - "frequencyCount": 34 - } - ] - } - ] - } - ] - } - } -} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryExamples_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryExamples_MaximumSet_Gen.json deleted file mode 100644 index 00c751e3e39c..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryExamples_MaximumSet_Gen.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "title": "Lookup Dictionary Examples", - "operationId": "LookupDictionaryExamples", - "parameters": { - "X-ClientTraceId": "vykwwekvcncclrmsyjhbok", - "from": "en", - "to": "es", - "api-version": "3.0", - "body": [ - { - "text": "fly", - "translation": "volar" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "normalizedSource": "fly", - "normalizedTarget": "volar", - "examples": [ - { - "sourcePrefix": "They need machines to ", - "sourceTerm": "fly", - "sourceSuffix": ".", - "targetPrefix": "Necesitan máquinas para ", - "targetTerm": "volar", - "targetSuffix": "." - }, - { - "sourcePrefix": "That should really ", - "sourceTerm": "fly", - "sourceSuffix": ".", - "targetPrefix": "Eso realmente debe ", - "targetTerm": "volar", - "targetSuffix": "." - } - ] - } - ] - } - } -} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryExamples_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryExamples_MinimumSet_Gen.json deleted file mode 100644 index 7f2b08865c25..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/LookupDictionaryExamples_MinimumSet_Gen.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "title": "Lookup Dictionary Examples with minimum properties", - "operationId": "LookupDictionaryExamples", - "parameters": { - "from": "en", - "to": "es", - "api-version": "3.0", - "body": [ - { - "text": "fly", - "translation": "volar" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "normalizedSource": "fly", - "normalizedTarget": "volar", - "examples": [ - { - "sourcePrefix": "They need machines to ", - "sourceTerm": "fly", - "sourceSuffix": ".", - "targetPrefix": "Necesitan máquinas para ", - "targetTerm": "volar", - "targetSuffix": "." - }, - { - "sourcePrefix": "That should really ", - "sourceTerm": "fly", - "sourceSuffix": ".", - "targetPrefix": "Eso realmente debe ", - "targetTerm": "volar", - "targetSuffix": "." - } - ] - } - ] - } - } -} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json index 302cc10b8c3e..f3963447873b 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json @@ -150,14 +150,6 @@ { "$ref": "#/parameters/TranslateParameters.allowFallback" }, - { - "name": "X-ClientTraceId", - "in": "header", - "description": "A client-generated GUID to uniquely identify the request.", - "required": false, - "type": "string", - "x-ms-client-name": "clientTraceId" - }, { "name": "api-version", "in": "query", @@ -169,10 +161,14 @@ { "name": "body", "in": "body", - "description": "Details of the translate request", + "description": "Defines the content of the request", "required": true, "schema": { - "$ref": "#/definitions/TranslateBodyDetails" + "type": "array", + "items": { + "$ref": "#/definitions/TranslateBodyParameters" + }, + "x-ms-identifiers": [] } } ], @@ -493,6 +489,24 @@ ] } }, + "ReferenceSentencePair": { + "type": "object", + "description": "Reference sentence pair.", + "properties": { + "targetsReferenceTextPairsSource": { + "type": "string", + "description": "Source reference sentence." + }, + "targetsReferenceTextPairsTarget": { + "type": "string", + "description": "Target reference sentence." + } + }, + "required": [ + "targetsReferenceTextPairsSource", + "targetsReferenceTextPairsTarget" + ] + }, "SourceDictionaryLanguage": { "type": "object", "description": "Properties ot the source dictionary language", @@ -595,8 +609,12 @@ "description": "Request body parameters for the translate API.", "properties": { "text": { - "$ref": "#/definitions/InputTextItem", - "description": "Specifies the text string to be translated in the translate API." + "type": "array", + "description": "Specifies the text string to be translated in the translate API.", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [] }, "targetsLanguage": { "type": "array", @@ -717,10 +735,18 @@ }, "targetsAdaptiveDatasetIds": { "type": "array", - "description": "Reference dataset ID having sentence pair to generate adaptive customized translation", + "description": "Reference dataset ID having sentence pair to generate adaptive customized translation.", "items": { "type": "string" } + }, + "targetsReferenceTextPairs": { + "type": "array", + "description": " Reference sentence pairs to generate adaptive results.", + "items": { + "$ref": "#/definitions/ReferenceSentencePair" + }, + "x-ms-identifiers": [] } }, "required": [ @@ -732,6 +758,10 @@ "type": "object", "description": "Request body parameters for the translate API.", "properties": { + "clientTraceId": { + "type": "string", + "description": "A client-generated GUID to uniquely identify the request." + }, "body": { "$ref": "#/definitions/TranslateBodyDetails", "description": "Details of the translate request" @@ -944,7 +974,7 @@ "TranslateParameters.allowFallback": { "name": "allowFallback", "in": "query", - "description": "In the case where a custom system is being used, specifies that the service is allowed to fall back to a\ngeneral system when a custom system doesn't exist. \nIn the case where a Large Language Model is being used, specifies that the service is allowed to fall\nback to a Small Language Model if an error occurs.\nPossible values are: true (default) or false.\n\nallowFallback=false specifies that the translation should only use systems trained for the category specified \nby the request. If a translation for language X to language Y requires chaining through a pivot language E, \nthen all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. \nIf no system is found with the specific category, the request will return a 400 status code. allowFallback=true \nspecifies that the service is allowed to fall back to a general system when a custom system doesn't exist.", + "description": "Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. \nPossible values are: true (default) or false.\n\nallowFallback=false specifies that the translation should only use systems trained for the category specified \nby the request. If a translation for language X to language Y requires chaining through a pivot language E, \nthen all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. \nIf no system is found with the specific category, the request will return a 400 status code. allowFallback=true \nspecifies that the service is allowed to fall back to a general system when a custom system doesn't exist.", "required": false, "type": "boolean", "default": true, From 085613598688e8695ced5cbd549018cee7d43249 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 7 Apr 2025 16:26:08 -0700 Subject: [PATCH 011/119] Add reference sentences into set --- .../Azure.AI.TextTranslation/models-translate.tsp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index f1cad6b6feee..2834d8c1dd32 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -14,8 +14,8 @@ model TranslateBodyParameters { ...CommonParameters; @doc(""" - Details of the translate request - """) + Details of the translate request + """) @body body: TranslateBodyDetails; } @@ -124,7 +124,6 @@ model TranslateParameters { @doc("Request body parameters for the translate API.") model TranslateBodyDetails { - @doc(""" Specifies the text string to be translated in the translate API. """) @@ -206,14 +205,13 @@ model TranslateBodyDetails { targetsAdaptiveDatasetIds?: string[]; @doc(""" - Reference sentence pairs to generate adaptive results. - """) - targetsReferenceTextPairs?: ReferenceSentencePair[] + Reference sentence pairs to generate adaptive results. + """) + targetsReferenceTextPairs?: ReferenceSentencePair[]; } @doc("Reference sentence pair.") model ReferenceSentencePair { - @doc("Source reference sentence.") targetsReferenceTextPairsSource: string; From b435220c8464ee3bc31841e57209217b4d249e34 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Wed, 9 Apr 2025 12:12:02 -0700 Subject: [PATCH 012/119] Several updates to spec --- .../models-translate.tsp | 141 ++++++++++-------- .../Azure.AI.TextTranslation/routes.tsp | 2 +- 2 files changed, 83 insertions(+), 60 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index 2834d8c1dd32..95d31d2c6c46 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -1,17 +1,18 @@ import "@typespec/rest"; +import "@typespec/versioning"; import "@azure-tools/typespec-azure-core"; import "./models-shared.tsp"; import "./models-transliterate.tsp"; using TypeSpec.Http; using TypeSpec.Rest; +using TypeSpec.Versioning; using Azure.Core; namespace TextTranslation; @doc("Request body parameters for the translate API.") model TranslateBodyParameters { - ...CommonParameters; @doc(""" Details of the translate request @@ -25,6 +26,7 @@ model TranslateParameters { ...CommonParameters; #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Existing Spec" + @removed(APIVersion.v2025_05_01_preview) @query(#{ explode: true }) @doc(""" Specifies the language of the output text. The target language must be one of the supported languages included @@ -34,6 +36,7 @@ model TranslateParameters { """) to: string[]; + @removed(APIVersion.v2025_05_01_preview) @query @doc(""" Specifies the language of the input text. Find which languages are available to translate from by @@ -45,6 +48,7 @@ model TranslateParameters { """) from?: string; + @removed(APIVersion.v2025_05_01_preview) @query @doc(""" Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, @@ -52,6 +56,7 @@ model TranslateParameters { """) textType?: TextType = "Plain"; + @removed(APIVersion.v2025_05_01_preview) @query @doc(""" A string specifying the category (domain) of the translation. This parameter is used to get translations @@ -60,6 +65,7 @@ model TranslateParameters { """) category?: string = "general"; + @removed(APIVersion.v2025_05_01_preview) @query @doc(""" Specifies how profanities should be treated in translations. @@ -67,6 +73,7 @@ model TranslateParameters { """) profanityAction?: ProfanityAction = ProfanityAction.NoAction; + @removed(APIVersion.v2025_05_01_preview) @query @doc(""" Specifies how profanities should be marked in translations. @@ -74,6 +81,7 @@ model TranslateParameters { """) profanityMarker?: ProfanityMarker = ProfanityMarker.Asterisk; + @removed(APIVersion.v2025_05_01_preview) @query @doc(""" Specifies whether to include alignment projection from source text to translated text. @@ -81,6 +89,7 @@ model TranslateParameters { """) includeAlignment?: boolean = false; + @removed(APIVersion.v2025_05_01_preview) @query @doc(""" Specifies whether to include sentence boundaries for the input text and the translated text. @@ -88,6 +97,7 @@ model TranslateParameters { """) includeSentenceLength?: boolean = false; + @removed(APIVersion.v2025_05_01_preview) @query @doc(""" Specifies a fallback language if the language of the input text can't be identified. @@ -96,18 +106,21 @@ model TranslateParameters { """) suggestedFrom?: string; + @removed(APIVersion.v2025_05_01_preview) @query @doc(""" Specifies the script of the input text. """) fromScript?: string; + @removed(APIVersion.v2025_05_01_preview) @query @doc(""" Specifies the script of the translated text. """) toScript?: string; + @removed(APIVersion.v2025_05_01_preview) @query @doc(""" Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. @@ -122,101 +135,111 @@ model TranslateParameters { allowFallback?: boolean = true; } -@doc("Request body parameters for the translate API.") -model TranslateBodyDetails { +@doc("Translate targets parameters") +model TranslateTarget { @doc(""" - Specifies the text string to be translated in the translate API. - """) - text: InputTextItem[]; + Specifies the language of the output text. The target language must be one of the supported languages included + in the translation scope. It's possible to translate to multiple languages simultaneously by including + multiple string values in the targetsLanguage array. + """) + language: string[]; @doc(""" - Specifies the language of the output text. The target language must be one of the supported languages included - in the translation scope. It's possible to translate to multiple languages simultaneously by including - multiple string values in the targetsLanguage array. - """) - targetsLanguage: string[]; + Specifies the script of the translated text. + """) + script?: string; @doc(""" - Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, - complete element. Possible values are: plain (default) or html. - """) - targetsTextType?: TextType = "Plain"; + Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, + complete element. Possible values are: plain (default) or html. + """) + textType?: TextType = "Plain"; @doc(""" - Specifies how profanities should be treated in translations. - Possible values are: NoAction (default), Marked or Deleted. - """) - targetsProfanityAction?: ProfanityAction = ProfanityAction.NoAction; + Specifies how profanities should be treated in translations. + Possible values are: NoAction (default), Marked or Deleted. + """) + profanityAction?: ProfanityAction = ProfanityAction.NoAction; @doc(""" - Specifies how profanities should be marked in translations. - Possible values are: Asterisk (default) or Tag. - """) - targetsProfanityMarker?: ProfanityMarker = ProfanityMarker.Asterisk; + Specifies how profanities should be marked in translations. + Possible values are: Asterisk (default) or Tag. + """) + profanityMarker?: ProfanityMarker = ProfanityMarker.Asterisk; @doc(""" - Specifies the script of the input text. - """) - script?: string; + Model that should be used for translation. + """) + deploymentNameModel?: string; @doc(""" - Specifies the script of the translated text. - """) - targetsScript?: string; + In the case where a custom system is being used, specifies that the service is allowed to fall back to a + general system when a custom system doesn't exist. + In the case where a Large Language Model is being used, specifies that the service is allowed to fall + back to a Small Language Model if an error occurs. + Possible values are: true (default) or false. + + allowFallback=false specifies that the translation should only use systems trained for the category specified + by the request. If a translation for language X to language Y requires chaining through a pivot language E, + then all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. + If no system is found with the specific category, the request will return a 400 status code. allowFallback=true + specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. + """) + allowFallback?: boolean = true; @doc(""" - Model that should be used for translation. - """) - targetsdeploymentNameModel?: string; + Defines complexity of LLM prompts to provide high accuracy translation. + """) + grade?: string; @doc(""" - In the case where a custom system is being used, specifies that the service is allowed to fall back to a - general system when a custom system doesn't exist. - In the case where a Large Language Model is being used, specifies that the service is allowed to fall - back to a Small Language Model if an error occurs. - Possible values are: true (default) or false. - - allowFallback=false specifies that the translation should only use systems trained for the category specified - by the request. If a translation for language X to language Y requires chaining through a pivot language E, - then all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. - If no system is found with the specific category, the request will return a 400 status code. allowFallback=true - specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. - """) - targetsAllowFallback?: boolean = true; + Desired tone of target translation. + """) + tone?: string; @doc(""" - Defines complexity of LLM prompts to provide high accuracy translation. - """) - targetsGrade?: string; + Desired gender of target translation. + """) + gender?: string; @doc(""" - Desired tone of target translation. - """) - targetsTone?: string; + Reference dataset ID having sentence pair to generate adaptive customized translation. + """) + adaptiveDatasetIds?: string[]; @doc(""" - Desired gender of target translation. + Reference sentence pairs to generate adaptive results. + """) + @maxItems(5) + referenceTextPairs?: ReferenceSentencePair[]; + +} + +@doc("Request body parameters for the translate API.") +model TranslateBodyDetails { + @doc(""" + Specifies the text string to be translated in the translate API. """) - targetsGender?: string; + text: string; @doc(""" - Reference dataset ID having sentence pair to generate adaptive customized translation. + Specifies the script of the input text. """) - targetsAdaptiveDatasetIds?: string[]; + script?: string; @doc(""" - Reference sentence pairs to generate adaptive results. + Translation target parameters. """) - targetsReferenceTextPairs?: ReferenceSentencePair[]; + targets: TranslateTarget } @doc("Reference sentence pair.") model ReferenceSentencePair { @doc("Source reference sentence.") - targetsReferenceTextPairsSource: string; + referenceTextPairsSource: string; @doc("Target reference sentence.") - targetsReferenceTextPairsTarget: string; + referenceTextPairsTarget: string; } @doc("Response for the translation API.") diff --git a/specification/translation/Azure.AI.TextTranslation/routes.tsp b/specification/translation/Azure.AI.TextTranslation/routes.tsp index 3be3767f09db..a0cdcfb5f7ef 100644 --- a/specification/translation/Azure.AI.TextTranslation/routes.tsp +++ b/specification/translation/Azure.AI.TextTranslation/routes.tsp @@ -57,7 +57,7 @@ op getSupportedLanguages is CustomGetOperation< @summary("Translate Text") @doc("Translate Text") op translate is CustomOperation< - TranslateBodyParameters[], + TranslateBodyDetails[], TranslateParameters, TranslationResult, {}, From d506548b4c5d0a0e56f32345e98f95a7ad96ffb0 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Wed, 9 Apr 2025 17:27:21 -0700 Subject: [PATCH 013/119] sync new openapi.json --- .../preview/2025-05-01/openapi.json | 319 ++++-------------- 1 file changed, 60 insertions(+), 259 deletions(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json index f3963447873b..95789dad9e25 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json @@ -114,42 +114,6 @@ "type": "string", "x-ms-client-name": "clientTraceId" }, - { - "$ref": "#/parameters/TranslateParameters.to" - }, - { - "$ref": "#/parameters/TranslateParameters.from" - }, - { - "$ref": "#/parameters/TranslateParameters.textType" - }, - { - "$ref": "#/parameters/TranslateParameters.category" - }, - { - "$ref": "#/parameters/TranslateParameters.profanityAction" - }, - { - "$ref": "#/parameters/TranslateParameters.profanityMarker" - }, - { - "$ref": "#/parameters/TranslateParameters.includeAlignment" - }, - { - "$ref": "#/parameters/TranslateParameters.includeSentenceLength" - }, - { - "$ref": "#/parameters/TranslateParameters.suggestedFrom" - }, - { - "$ref": "#/parameters/TranslateParameters.fromScript" - }, - { - "$ref": "#/parameters/TranslateParameters.toScript" - }, - { - "$ref": "#/parameters/TranslateParameters.allowFallback" - }, { "name": "api-version", "in": "query", @@ -166,7 +130,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/TranslateBodyParameters" + "$ref": "#/definitions/TranslateBodyDetails" }, "x-ms-identifiers": [] } @@ -493,18 +457,18 @@ "type": "object", "description": "Reference sentence pair.", "properties": { - "targetsReferenceTextPairsSource": { + "referenceTextPairsSource": { "type": "string", "description": "Source reference sentence." }, - "targetsReferenceTextPairsTarget": { + "referenceTextPairsTarget": { "type": "string", "description": "Target reference sentence." } }, "required": [ - "targetsReferenceTextPairsSource", - "targetsReferenceTextPairsTarget" + "referenceTextPairsSource", + "referenceTextPairsTarget" ] }, "SourceDictionaryLanguage": { @@ -609,21 +573,56 @@ "description": "Request body parameters for the translate API.", "properties": { "text": { - "type": "array", - "description": "Specifies the text string to be translated in the translate API.", - "items": { - "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [] + "type": "string", + "description": "Specifies the text string to be translated in the translate API." }, - "targetsLanguage": { + "script": { + "type": "string", + "description": "Specifies the script of the input text." + }, + "targets": { + "$ref": "#/definitions/TranslateTarget", + "description": "Translation target parameters." + } + }, + "required": [ + "text", + "targets" + ] + }, + "TranslateBodyParameters": { + "type": "object", + "description": "Request body parameters for the translate API.", + "properties": { + "body": { + "$ref": "#/definitions/TranslateBodyDetails", + "description": "Details of the translate request" + } + }, + "required": [ + "body" + ] + }, + "TranslateParameters": { + "type": "object", + "description": "Request parameters for the translate API." + }, + "TranslateTarget": { + "type": "object", + "description": "Translate targets parameters", + "properties": { + "language": { "type": "array", "description": "Specifies the language of the output text. The target language must be one of the supported languages included \nin the translation scope. It's possible to translate to multiple languages simultaneously by including \nmultiple string values in the targetsLanguage array.", "items": { "type": "string" } }, - "targetsTextType": { + "script": { + "type": "string", + "description": "Specifies the script of the translated text." + }, + "textType": { "type": "string", "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", "default": "Plain", @@ -648,7 +647,7 @@ ] } }, - "targetsProfanityAction": { + "profanityAction": { "type": "string", "description": "Specifies how profanities should be treated in translations.\nPossible values are: NoAction (default), Marked or Deleted.", "default": "NoAction", @@ -679,7 +678,7 @@ ] } }, - "targetsProfanityMarker": { + "profanityMarker": { "type": "string", "description": "Specifies how profanities should be marked in translations.\nPossible values are: Asterisk (default) or Tag. ", "default": "Asterisk", @@ -704,45 +703,38 @@ ] } }, - "script": { - "type": "string", - "description": "Specifies the script of the input text." - }, - "targetsScript": { - "type": "string", - "description": "Specifies the script of the translated text." - }, - "targetsdeploymentNameModel": { + "deploymentNameModel": { "type": "string", "description": "Model that should be used for translation." }, - "targetsAllowFallback": { + "allowFallback": { "type": "boolean", "description": "In the case where a custom system is being used, specifies that the service is allowed to fall back to a\ngeneral system when a custom system doesn't exist. \nIn the case where a Large Language Model is being used, specifies that the service is allowed to fall\nback to a Small Language Model if an error occurs.\nPossible values are: true (default) or false.\n\nallowFallback=false specifies that the translation should only use systems trained for the category specified \nby the request. If a translation for language X to language Y requires chaining through a pivot language E, \nthen all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. \nIf no system is found with the specific category, the request will return a 400 status code. allowFallback=true \nspecifies that the service is allowed to fall back to a general system when a custom system doesn't exist.", "default": true }, - "targetsGrade": { + "grade": { "type": "string", "description": "Defines complexity of LLM prompts to provide high accuracy translation." }, - "targetsTone": { + "tone": { "type": "string", "description": "Desired tone of target translation." }, - "targetsGender": { + "gender": { "type": "string", "description": "Desired gender of target translation." }, - "targetsAdaptiveDatasetIds": { + "adaptiveDatasetIds": { "type": "array", "description": "Reference dataset ID having sentence pair to generate adaptive customized translation.", "items": { "type": "string" } }, - "targetsReferenceTextPairs": { + "referenceTextPairs": { "type": "array", - "description": " Reference sentence pairs to generate adaptive results.", + "description": "Reference sentence pairs to generate adaptive results.", + "maxItems": 5, "items": { "$ref": "#/definitions/ReferenceSentencePair" }, @@ -750,25 +742,7 @@ } }, "required": [ - "text", - "targetsLanguage" - ] - }, - "TranslateBodyParameters": { - "type": "object", - "description": "Request body parameters for the translate API.", - "properties": { - "clientTraceId": { - "type": "string", - "description": "A client-generated GUID to uniquely identify the request." - }, - "body": { - "$ref": "#/definitions/TranslateBodyDetails", - "description": "Details of the translate request" - } - }, - "required": [ - "body" + "language" ] }, "TranslatedTextItem": { @@ -971,179 +945,6 @@ "type": "string", "x-ms-parameter-location": "method" }, - "TranslateParameters.allowFallback": { - "name": "allowFallback", - "in": "query", - "description": "Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. \nPossible values are: true (default) or false.\n\nallowFallback=false specifies that the translation should only use systems trained for the category specified \nby the request. If a translation for language X to language Y requires chaining through a pivot language E, \nthen all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. \nIf no system is found with the specific category, the request will return a 400 status code. allowFallback=true \nspecifies that the service is allowed to fall back to a general system when a custom system doesn't exist.", - "required": false, - "type": "boolean", - "default": true, - "x-ms-parameter-location": "method" - }, - "TranslateParameters.category": { - "name": "category", - "in": "query", - "description": "A string specifying the category (domain) of the translation. This parameter is used to get translations \nfrom a customized system built with Custom Translator. Add the Category ID from your Custom Translator \nproject details to this parameter to use your deployed customized system. Default value is: general.", - "required": false, - "type": "string", - "default": "general", - "x-ms-parameter-location": "method" - }, - "TranslateParameters.from": { - "name": "from", - "in": "query", - "description": "Specifies the language of the input text. Find which languages are available to translate from by \nlooking up supported languages using the translation scope. If the from parameter isn't specified, \nautomatic language detection is applied to determine the source language.\n\nYou must use the from parameter rather than autodetection when using the dynamic dictionary feature. \nNote: the dynamic dictionary feature is case-sensitive.", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - }, - "TranslateParameters.fromScript": { - "name": "fromScript", - "in": "query", - "description": "Specifies the script of the input text.", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - }, - "TranslateParameters.includeAlignment": { - "name": "includeAlignment", - "in": "query", - "description": "Specifies whether to include alignment projection from source text to translated text.\nPossible values are: true or false (default).", - "required": false, - "type": "boolean", - "default": false, - "x-ms-parameter-location": "method" - }, - "TranslateParameters.includeSentenceLength": { - "name": "includeSentenceLength", - "in": "query", - "description": "Specifies whether to include sentence boundaries for the input text and the translated text.\nPossible values are: true or false (default).", - "required": false, - "type": "boolean", - "default": false, - "x-ms-parameter-location": "method" - }, - "TranslateParameters.profanityAction": { - "name": "profanityAction", - "in": "query", - "description": "Specifies how profanities should be treated in translations.\nPossible values are: NoAction (default), Marked or Deleted.", - "required": false, - "type": "string", - "default": "NoAction", - "enum": [ - "NoAction", - "Marked", - "Deleted" - ], - "x-ms-enum": { - "name": "ProfanityAction", - "modelAsString": false, - "values": [ - { - "name": "NoAction", - "value": "NoAction", - "description": "No Action is taken on profanity" - }, - { - "name": "Marked", - "value": "Marked", - "description": "Profanity is marked." - }, - { - "name": "Deleted", - "value": "Deleted", - "description": "Profanity is deleted from the translated text." - } - ] - }, - "x-ms-parameter-location": "method" - }, - "TranslateParameters.profanityMarker": { - "name": "profanityMarker", - "in": "query", - "description": "Specifies how profanities should be marked in translations.\nPossible values are: Asterisk (default) or Tag. ", - "required": false, - "type": "string", - "default": "Asterisk", - "enum": [ - "Asterisk", - "Tag" - ], - "x-ms-enum": { - "name": "ProfanityMarker", - "modelAsString": false, - "values": [ - { - "name": "Asterisk", - "value": "Asterisk", - "description": "Profanity is marked with asterisk." - }, - { - "name": "Tag", - "value": "Tag", - "description": "Profanity is marked with the tags." - } - ] - }, - "x-ms-parameter-location": "method" - }, - "TranslateParameters.suggestedFrom": { - "name": "suggestedFrom", - "in": "query", - "description": "Specifies a fallback language if the language of the input text can't be identified. \nLanguage autodetection is applied when the from parameter is omitted. If detection fails, \nthe suggestedFrom language will be assumed.", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - }, - "TranslateParameters.textType": { - "name": "textType", - "in": "query", - "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", - "required": false, - "type": "string", - "default": "Plain", - "enum": [ - "Plain", - "Html" - ], - "x-ms-enum": { - "name": "TextType", - "modelAsString": true, - "values": [ - { - "name": "Plain", - "value": "Plain", - "description": "Plain text." - }, - { - "name": "Html", - "value": "Html", - "description": "HTML-encoded text." - } - ] - }, - "x-ms-parameter-location": "method" - }, - "TranslateParameters.to": { - "name": "to", - "in": "query", - "description": "Specifies the language of the output text. The target language must be one of the supported languages included \nin the translation scope. For example, use to=de to translate to German.\nIt's possible to translate to multiple languages simultaneously by repeating the parameter in the query string. \nFor example, use to=de&to=it to translate to German and Italian.", - "required": true, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "x-ms-parameter-location": "method" - }, - "TranslateParameters.toScript": { - "name": "toScript", - "in": "query", - "description": "Specifies the script of the translated text.", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - }, "TransliterateParameters.fromScript": { "name": "fromScript", "in": "query", From f0b1cbf428d35fc74b1ff10a6397860e9d985553 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Wed, 9 Apr 2025 17:34:40 -0700 Subject: [PATCH 014/119] sync new openapi.json --- .../models-translate.tsp | 82 +++++++++---------- 1 file changed, 40 insertions(+), 42 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index 95d31d2c6c46..67f66b1ae3b8 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -13,7 +13,6 @@ namespace TextTranslation; @doc("Request body parameters for the translate API.") model TranslateBodyParameters { - @doc(""" Details of the translate request """) @@ -138,81 +137,80 @@ model TranslateParameters { @doc("Translate targets parameters") model TranslateTarget { @doc(""" - Specifies the language of the output text. The target language must be one of the supported languages included - in the translation scope. It's possible to translate to multiple languages simultaneously by including - multiple string values in the targetsLanguage array. - """) + Specifies the language of the output text. The target language must be one of the supported languages included + in the translation scope. It's possible to translate to multiple languages simultaneously by including + multiple string values in the targetsLanguage array. + """) language: string[]; @doc(""" - Specifies the script of the translated text. - """) + Specifies the script of the translated text. + """) script?: string; @doc(""" - Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, - complete element. Possible values are: plain (default) or html. - """) + Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, + complete element. Possible values are: plain (default) or html. + """) textType?: TextType = "Plain"; @doc(""" - Specifies how profanities should be treated in translations. - Possible values are: NoAction (default), Marked or Deleted. - """) + Specifies how profanities should be treated in translations. + Possible values are: NoAction (default), Marked or Deleted. + """) profanityAction?: ProfanityAction = ProfanityAction.NoAction; @doc(""" - Specifies how profanities should be marked in translations. - Possible values are: Asterisk (default) or Tag. - """) + Specifies how profanities should be marked in translations. + Possible values are: Asterisk (default) or Tag. + """) profanityMarker?: ProfanityMarker = ProfanityMarker.Asterisk; @doc(""" - Model that should be used for translation. - """) + Model that should be used for translation. + """) deploymentNameModel?: string; @doc(""" - In the case where a custom system is being used, specifies that the service is allowed to fall back to a - general system when a custom system doesn't exist. - In the case where a Large Language Model is being used, specifies that the service is allowed to fall - back to a Small Language Model if an error occurs. - Possible values are: true (default) or false. - - allowFallback=false specifies that the translation should only use systems trained for the category specified - by the request. If a translation for language X to language Y requires chaining through a pivot language E, - then all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. - If no system is found with the specific category, the request will return a 400 status code. allowFallback=true - specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. - """) + In the case where a custom system is being used, specifies that the service is allowed to fall back to a + general system when a custom system doesn't exist. + In the case where a Large Language Model is being used, specifies that the service is allowed to fall + back to a Small Language Model if an error occurs. + Possible values are: true (default) or false. + + allowFallback=false specifies that the translation should only use systems trained for the category specified + by the request. If a translation for language X to language Y requires chaining through a pivot language E, + then all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. + If no system is found with the specific category, the request will return a 400 status code. allowFallback=true + specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. + """) allowFallback?: boolean = true; @doc(""" - Defines complexity of LLM prompts to provide high accuracy translation. - """) + Defines complexity of LLM prompts to provide high accuracy translation. + """) grade?: string; @doc(""" - Desired tone of target translation. - """) + Desired tone of target translation. + """) tone?: string; @doc(""" - Desired gender of target translation. - """) + Desired gender of target translation. + """) gender?: string; @doc(""" - Reference dataset ID having sentence pair to generate adaptive customized translation. - """) + Reference dataset ID having sentence pair to generate adaptive customized translation. + """) adaptiveDatasetIds?: string[]; @doc(""" - Reference sentence pairs to generate adaptive results. - """) + Reference sentence pairs to generate adaptive results. + """) @maxItems(5) referenceTextPairs?: ReferenceSentencePair[]; - } @doc("Request body parameters for the translate API.") @@ -230,7 +228,7 @@ model TranslateBodyDetails { @doc(""" Translation target parameters. """) - targets: TranslateTarget + targets: TranslateTarget; } @doc("Reference sentence pair.") From 3ba9fc5da72a0429ebcb7a05f9bef28242e5148c Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Wed, 9 Apr 2025 20:38:26 -0700 Subject: [PATCH 015/119] Fix examples and api --- ...FindSentenceBoundaries_MaximumSet_Gen.json | 28 ++++++ ...FindSentenceBoundaries_MinimumSet_Gen.json | 29 ++++++ .../GetSupportedLanguages_MaximumSet_Gen.json | 80 +++++++++++++++++ .../GetSupportedLanguages_MinimumSet_Gen.json | 12 +++ ...ookupDictionaryEntries_MaximumSet_Gen.json | 87 ++++++++++++++++++ ...ookupDictionaryEntries_MinimumSet_Gen.json | 86 ++++++++++++++++++ ...okupDictionaryExamples_MaximumSet_Gen.json | 44 +++++++++ ...okupDictionaryExamples_MinimumSet_Gen.json | 43 +++++++++ .../Translate_MaximumSet_Gen.json | 74 +++++++++++++++ .../Translate_MinimumSet_Gen.json | 31 +++++++ .../Transliterate_MaximumSet_Gen.json | 26 ++++++ .../Transliterate_MinimumSet_Gen.json | 25 ++++++ .../models-translate.tsp | 41 ++++++--- .../examples/Translate_MaximumSet_Gen.json | 43 +++++---- .../examples/Translate_MinimumSet_Gen.json | 12 +-- .../preview/2025-05-01/openapi.json | 90 +++++++++++++------ 16 files changed, 689 insertions(+), 62 deletions(-) create mode 100644 specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/FindSentenceBoundaries_MaximumSet_Gen.json create mode 100644 specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/FindSentenceBoundaries_MinimumSet_Gen.json create mode 100644 specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MaximumSet_Gen.json create mode 100644 specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MinimumSet_Gen.json create mode 100644 specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryEntries_MaximumSet_Gen.json create mode 100644 specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryEntries_MinimumSet_Gen.json create mode 100644 specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryExamples_MaximumSet_Gen.json create mode 100644 specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryExamples_MinimumSet_Gen.json create mode 100644 specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json create mode 100644 specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json create mode 100644 specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Transliterate_MaximumSet_Gen.json create mode 100644 specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Transliterate_MinimumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/FindSentenceBoundaries_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/FindSentenceBoundaries_MaximumSet_Gen.json new file mode 100644 index 000000000000..1847c3f5e3d3 --- /dev/null +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/FindSentenceBoundaries_MaximumSet_Gen.json @@ -0,0 +1,28 @@ +{ + "title": "Find Sentence Boundaries", + "operationId": "FindSentenceBoundaries", + "parameters": { + "X-ClientTraceId": "svun", + "language": "en", + "script": "Latn", + "api-version": "3.0", + "body": [ + { + "text": "How are you? I am fine. What did you do today?" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "sentLen": [ + 13, + 11, + 22 + ] + } + ] + } + } +} diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/FindSentenceBoundaries_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/FindSentenceBoundaries_MinimumSet_Gen.json new file mode 100644 index 000000000000..4175072f8566 --- /dev/null +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/FindSentenceBoundaries_MinimumSet_Gen.json @@ -0,0 +1,29 @@ +{ + "title": "Find Sentence Boundaries with minimum properties", + "operationId": "FindSentenceBoundaries", + "parameters": { + "api-version": "3.0", + "body": [ + { + "text": "How are you? I am fine. What did you do today?" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "detectedLanguage": { + "language": "en", + "score": 1.0 + }, + "sentLen": [ + 13, + 11, + 22 + ] + } + ] + } + } +} diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MaximumSet_Gen.json new file mode 100644 index 000000000000..0fdb83142178 --- /dev/null +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MaximumSet_Gen.json @@ -0,0 +1,80 @@ +{ + "title": "Gets the set of languages currently supported by other operations of the Translator.", + "operationId": "GetSupportedLanguages", + "parameters": { + "X-ClientTraceId": "kayfnugjec", + "scope": "translation,transliteration,dictionary", + "Accept-Language": "en", + "If-None-Match": "fpnhruttllvc", + "api-version": "3.0" + }, + "responses": { + "200": { + "body": { + "translation": { + "en": { + "name": "English", + "nativeName": "English", + "dir": "ltr" + }, + "es": { + "name": "Spanish", + "nativeName": "Español", + "dir": "ltr" + } + }, + "transliteration": { + "ar": { + "name": "Arabic", + "nativeName": "العربية", + "scripts": [ + { + "code": "Arab", + "name": "Arabic", + "nativeName": "العربية", + "dir": "rtl", + "toScripts": [ + { + "code": "Latn", + "name": "Latin", + "nativeName": "اللاتينية", + "dir": "ltr" + } + ] + }, + { + "code": "Latn", + "name": "Latin", + "nativeName": "اللاتينية", + "dir": "ltr", + "toScripts": [ + { + "code": "Arab", + "name": "Arabic", + "nativeName": "العربية", + "dir": "rtl" + } + ] + } + ] + } + }, + "dictionary": { + "cs": { + "name": "Czech", + "nativeName": "Čeština", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + } + } + } + } + } +} diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MinimumSet_Gen.json new file mode 100644 index 000000000000..5f8405e887d9 --- /dev/null +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MinimumSet_Gen.json @@ -0,0 +1,12 @@ +{ + "title": "Gets the set of languages currently supported by other operations of the Translator with minimum properties.", + "operationId": "GetSupportedLanguages", + "parameters": { + "api-version": "3.0" + }, + "responses": { + "200": { + "body": {} + } + } +} diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryEntries_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryEntries_MaximumSet_Gen.json new file mode 100644 index 000000000000..636eb73b04f6 --- /dev/null +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryEntries_MaximumSet_Gen.json @@ -0,0 +1,87 @@ +{ + "title": "Lookup Dictionary Entries", + "operationId": "LookupDictionaryEntries", + "parameters": { + "X-ClientTraceId": "yqst", + "from": "en", + "to": "es", + "api-version": "3.0", + "body": [ + { + "text": "fly" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "normalizedSource": "fly", + "displaySource": "fly", + "translations": [ + { + "normalizedTarget": "volar", + "displayTarget": "volar", + "posTag": "VERB", + "confidence": 0.4081, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 4637 + }, + { + "normalizedText": "flying", + "displayText": "flying", + "numExamples": 15, + "frequencyCount": 1365 + }, + { + "normalizedText": "blow", + "displayText": "blow", + "numExamples": 15, + "frequencyCount": 503 + }, + { + "normalizedText": "flight", + "displayText": "flight", + "numExamples": 15, + "frequencyCount": 135 + } + ] + }, + { + "normalizedTarget": "mosca", + "displayTarget": "mosca", + "posTag": "NOUN", + "confidence": 0.2668, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 1697 + }, + { + "normalizedText": "flyweight", + "displayText": "flyweight", + "numExamples": 0, + "frequencyCount": 48 + }, + { + "normalizedText": "flies", + "displayText": "flies", + "numExamples": 9, + "frequencyCount": 34 + } + ] + } + ] + } + ] + } + } +} diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryEntries_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryEntries_MinimumSet_Gen.json new file mode 100644 index 000000000000..dfc24a03bdea --- /dev/null +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryEntries_MinimumSet_Gen.json @@ -0,0 +1,86 @@ +{ + "title": "Lookup Dictionary Entries with minimum properties", + "operationId": "LookupDictionaryEntries", + "parameters": { + "from": "en", + "to": "es", + "api-version": "3.0", + "body": [ + { + "text": "fly" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "normalizedSource": "fly", + "displaySource": "fly", + "translations": [ + { + "normalizedTarget": "volar", + "displayTarget": "volar", + "posTag": "VERB", + "confidence": 0.4081, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 4637 + }, + { + "normalizedText": "flying", + "displayText": "flying", + "numExamples": 15, + "frequencyCount": 1365 + }, + { + "normalizedText": "blow", + "displayText": "blow", + "numExamples": 15, + "frequencyCount": 503 + }, + { + "normalizedText": "flight", + "displayText": "flight", + "numExamples": 15, + "frequencyCount": 135 + } + ] + }, + { + "normalizedTarget": "mosca", + "displayTarget": "mosca", + "posTag": "NOUN", + "confidence": 0.2668, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 1697 + }, + { + "normalizedText": "flyweight", + "displayText": "flyweight", + "numExamples": 0, + "frequencyCount": 48 + }, + { + "normalizedText": "flies", + "displayText": "flies", + "numExamples": 9, + "frequencyCount": 34 + } + ] + } + ] + } + ] + } + } +} diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryExamples_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryExamples_MaximumSet_Gen.json new file mode 100644 index 000000000000..00c751e3e39c --- /dev/null +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryExamples_MaximumSet_Gen.json @@ -0,0 +1,44 @@ +{ + "title": "Lookup Dictionary Examples", + "operationId": "LookupDictionaryExamples", + "parameters": { + "X-ClientTraceId": "vykwwekvcncclrmsyjhbok", + "from": "en", + "to": "es", + "api-version": "3.0", + "body": [ + { + "text": "fly", + "translation": "volar" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "normalizedSource": "fly", + "normalizedTarget": "volar", + "examples": [ + { + "sourcePrefix": "They need machines to ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Necesitan máquinas para ", + "targetTerm": "volar", + "targetSuffix": "." + }, + { + "sourcePrefix": "That should really ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Eso realmente debe ", + "targetTerm": "volar", + "targetSuffix": "." + } + ] + } + ] + } + } +} diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryExamples_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryExamples_MinimumSet_Gen.json new file mode 100644 index 000000000000..7f2b08865c25 --- /dev/null +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryExamples_MinimumSet_Gen.json @@ -0,0 +1,43 @@ +{ + "title": "Lookup Dictionary Examples with minimum properties", + "operationId": "LookupDictionaryExamples", + "parameters": { + "from": "en", + "to": "es", + "api-version": "3.0", + "body": [ + { + "text": "fly", + "translation": "volar" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "normalizedSource": "fly", + "normalizedTarget": "volar", + "examples": [ + { + "sourcePrefix": "They need machines to ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Necesitan máquinas para ", + "targetTerm": "volar", + "targetSuffix": "." + }, + { + "sourcePrefix": "That should really ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Eso realmente debe ", + "targetTerm": "volar", + "targetSuffix": "." + } + ] + } + ] + } + } +} diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json new file mode 100644 index 000000000000..9453cd03b29b --- /dev/null +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json @@ -0,0 +1,74 @@ +{ + "title": "Translate Text", + "operationId": "Translate", + "parameters": { + "X-ClientTraceId": "ndbkaatzsnoetqkiehappoza", + "api-version": "2025-05-01-preview", + "body": [ + { + "text": "This is a test.", + "script": "Latn", + "language": "en", + "textType": "Plain", + "targets": { + "language": [ + "cs" + ], + "script": "Latn", + "profanityAction": "NoAction", + "profanityMarker": "Asterisk", + "deploymentNameModel": "general", + "allowFallback": true, + "grade": "basic", + "tone": "formal", + "gender": "neutral", + "adaptiveDatasetIds": [ + "21000" + ], + "referenceTextPairs": [ + { + "referenceTextPairsSource": "Please test this out.", + "referenceTextPairsTarget": "Vyzkoušejte si to." + } + ] + } + } + ] + }, + "responses": { + "200": { + "body": [ + { + "detectedLanguage": { + "language": "en", + "score": 1.0 + }, + "translations": [ + { + "to": "cs", + "text": "Tohle je test.", + "transliteration": { + "text": "Tohle je test.", + "script": "Latn" + }, + "alignment": { + "proj": "okrxvzsagjgzrrv" + }, + "sentLen": { + "srcSentLen": [ + 30 + ], + "transSentLen": [ + 24 + ] + } + } + ], + "sourceText": { + "text": "This is a test" + } + } + ] + } + } +} diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json new file mode 100644 index 000000000000..c8671436af34 --- /dev/null +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json @@ -0,0 +1,31 @@ +{ + "title": "Translate Text with minimum properties", + "operationId": "Translate", + "parameters": { + "api-version": "2025-05-01-preview", + "body": [ + { + "text": "This is a test.", + "targets": { + "language": [ + "cs" + ] + } + } + ] + }, + "responses": { + "200": { + "body": [ + { + "translations": [ + { + "text": "Tohle je test.", + "to": "cs" + } + ] + } + ] + } + } +} diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Transliterate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Transliterate_MaximumSet_Gen.json new file mode 100644 index 000000000000..92f67b4a62d3 --- /dev/null +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Transliterate_MaximumSet_Gen.json @@ -0,0 +1,26 @@ +{ + "title": "Transliterate Text", + "operationId": "Transliterate", + "parameters": { + "X-ClientTraceId": "dzncrimwmvtwjnheh", + "language": "zh-Hans", + "fromScript": "Hans", + "toScript": "Latn", + "api-version": "3.0", + "body": [ + { + "text": "这是个测试。" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "text": "zhè shì gè cè shì。", + "script": "Latn" + } + ] + } + } +} diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Transliterate_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Transliterate_MinimumSet_Gen.json new file mode 100644 index 000000000000..24c5aee2ffb1 --- /dev/null +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Transliterate_MinimumSet_Gen.json @@ -0,0 +1,25 @@ +{ + "title": "Transliterate Text with minimum properties", + "operationId": "Transliterate", + "parameters": { + "language": "zh-Hans", + "fromScript": "Hans", + "toScript": "Latn", + "api-version": "3.0", + "body": [ + { + "text": "这是个测试。" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "text": "zhè shì gè cè shì。", + "script": "Latn" + } + ] + } + } +} diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index 67f66b1ae3b8..277f2ba88cd3 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -148,12 +148,6 @@ model TranslateTarget { """) script?: string; - @doc(""" - Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, - complete element. Possible values are: plain (default) or html. - """) - textType?: TextType = "Plain"; - @doc(""" Specifies how profanities should be treated in translations. Possible values are: NoAction (default), Marked or Deleted. @@ -167,9 +161,16 @@ model TranslateTarget { profanityMarker?: ProfanityMarker = ProfanityMarker.Asterisk; @doc(""" - Model that should be used for translation. + Default is ‘general’, which uses NMT system. + ‘abc-inc-gpt-4o’, and ‘abc-inc-gpt-4o-mini’ are examples of deployment names which use GPT-4o uses or + GPT-4o-mini model. ‘gpt-4o’ uses GPT-4o model. + + ‘’ uses the custom NMT model tuned by customer. + ‘best’ system determines which is the best model to use for the request. This intelligence could be introduced + in future. Customer should have deployed it in their resource. + """) - deploymentNameModel?: string; + deploymentNameModel?: string = "general"; @doc(""" In the case where a custom system is being used, specifies that the service is allowed to fall back to a @@ -189,17 +190,17 @@ model TranslateTarget { @doc(""" Defines complexity of LLM prompts to provide high accuracy translation. """) - grade?: string; + grade?: string = "basic"; @doc(""" - Desired tone of target translation. + Desired tone of target translation. Default is 'informal' """) - tone?: string; + tone?: string = "informal"; @doc(""" Desired gender of target translation. """) - gender?: string; + gender?: string = "neutral"; @doc(""" Reference dataset ID having sentence pair to generate adaptive customized translation. @@ -225,6 +226,22 @@ model TranslateBodyDetails { """) script?: string; + @doc(""" + Specifies the language of the input text. Find which languages are available to translate by + looking up supported languages using the translation scope. If the language parameter isn't + specified, automatic language detection is applied to determine the source language. + + You must use the language parameter rather than autodetection when using the dynamic dictionary feature. + Note: the dynamic dictionary feature is case-sensitive. + """) + language?: string; + + @doc(""" + Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, + complete element. Possible values are: plain (default) or html. + """) + textType?: TextType = "Plain"; + @doc(""" Translation target parameters. """) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Translate_MaximumSet_Gen.json index 06f74471d1df..9453cd03b29b 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Translate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Translate_MaximumSet_Gen.json @@ -3,24 +3,35 @@ "operationId": "Translate", "parameters": { "X-ClientTraceId": "ndbkaatzsnoetqkiehappoza", - "to": [ - "cs" - ], - "from": "en", - "textType": "Plain", - "category": "custom", - "profanityAction": "NoAction", - "profanityMarker": "Asterisk", - "includeAlignment": true, - "includeSentenceLength": true, - "suggestedFrom": "en", - "fromScript": "Latn", - "toScript": "Latn", - "allowFallback": true, - "api-version": "3.0", + "api-version": "2025-05-01-preview", "body": [ { - "text": "This is a test." + "text": "This is a test.", + "script": "Latn", + "language": "en", + "textType": "Plain", + "targets": { + "language": [ + "cs" + ], + "script": "Latn", + "profanityAction": "NoAction", + "profanityMarker": "Asterisk", + "deploymentNameModel": "general", + "allowFallback": true, + "grade": "basic", + "tone": "formal", + "gender": "neutral", + "adaptiveDatasetIds": [ + "21000" + ], + "referenceTextPairs": [ + { + "referenceTextPairsSource": "Please test this out.", + "referenceTextPairsTarget": "Vyzkoušejte si to." + } + ] + } } ] }, diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Translate_MinimumSet_Gen.json index b29982929425..c8671436af34 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Translate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Translate_MinimumSet_Gen.json @@ -2,13 +2,15 @@ "title": "Translate Text with minimum properties", "operationId": "Translate", "parameters": { - "to": [ - "fmlxpuepn" - ], - "api-version": "3.0", + "api-version": "2025-05-01-preview", "body": [ { - "text": "This is a test." + "text": "This is a test.", + "targets": { + "language": [ + "cs" + ] + } } ] }, diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json index 95789dad9e25..0918a8f7d63d 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json @@ -97,6 +97,14 @@ } } } + }, + "x-ms-examples": { + "Gets the set of languages currently supported by other operations of the Translator with minimum properties.": { + "$ref": "./examples/GetSupportedLanguages_MinimumSet_Gen.json" + }, + "Gets the set of languages currently supported by other operations of the Translator.": { + "$ref": "./examples/GetSupportedLanguages_MaximumSet_Gen.json" + } } } }, @@ -174,6 +182,14 @@ } } } + }, + "x-ms-examples": { + "Translate Text": { + "$ref": "./examples/Translate_MaximumSet_Gen.json" + }, + "Translate Text with minimum properties": { + "$ref": "./examples/Translate_MinimumSet_Gen.json" + } } } }, @@ -251,6 +267,14 @@ } } } + }, + "x-ms-examples": { + "Transliterate Text": { + "$ref": "./examples/Transliterate_MaximumSet_Gen.json" + }, + "Transliterate Text with minimum properties": { + "$ref": "./examples/Transliterate_MinimumSet_Gen.json" + } } } } @@ -580,6 +604,35 @@ "type": "string", "description": "Specifies the script of the input text." }, + "language": { + "type": "string", + "description": "Specifies the language of the input text. Find which languages are available to translate by \nlooking up supported languages using the translation scope. If the language parameter isn't \nspecified, automatic language detection is applied to determine the source language.\n\nYou must use the language parameter rather than autodetection when using the dynamic dictionary feature. \nNote: the dynamic dictionary feature is case-sensitive." + }, + "textType": { + "type": "string", + "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", + "default": "Plain", + "enum": [ + "Plain", + "Html" + ], + "x-ms-enum": { + "name": "TextType", + "modelAsString": true, + "values": [ + { + "name": "Plain", + "value": "Plain", + "description": "Plain text." + }, + { + "name": "Html", + "value": "Html", + "description": "HTML-encoded text." + } + ] + } + }, "targets": { "$ref": "#/definitions/TranslateTarget", "description": "Translation target parameters." @@ -622,31 +675,6 @@ "type": "string", "description": "Specifies the script of the translated text." }, - "textType": { - "type": "string", - "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", - "default": "Plain", - "enum": [ - "Plain", - "Html" - ], - "x-ms-enum": { - "name": "TextType", - "modelAsString": true, - "values": [ - { - "name": "Plain", - "value": "Plain", - "description": "Plain text." - }, - { - "name": "Html", - "value": "Html", - "description": "HTML-encoded text." - } - ] - } - }, "profanityAction": { "type": "string", "description": "Specifies how profanities should be treated in translations.\nPossible values are: NoAction (default), Marked or Deleted.", @@ -705,7 +733,8 @@ }, "deploymentNameModel": { "type": "string", - "description": "Model that should be used for translation." + "description": "Default is ‘general’, which uses NMT system.\n‘abc-inc-gpt-4o’, and ‘abc-inc-gpt-4o-mini’ are examples of deployment names which use GPT-4o uses or \nGPT-4o-mini model. ‘gpt-4o’ uses GPT-4o model. \n\n‘’ uses the custom NMT model tuned by customer.\n‘best’ system determines which is the best model to use for the request. This intelligence could be introduced\nin future. Customer should have deployed it in their resource.\n", + "default": "general" }, "allowFallback": { "type": "boolean", @@ -714,15 +743,18 @@ }, "grade": { "type": "string", - "description": "Defines complexity of LLM prompts to provide high accuracy translation." + "description": "Defines complexity of LLM prompts to provide high accuracy translation.", + "default": "basic" }, "tone": { "type": "string", - "description": "Desired tone of target translation." + "description": "Desired tone of target translation. Default is 'informal'", + "default": "informal" }, "gender": { "type": "string", - "description": "Desired gender of target translation." + "description": "Desired gender of target translation.", + "default": "neutral" }, "adaptiveDatasetIds": { "type": "array", From 9c1262cf7296fcfb99311cf0f1d80e6db9efffb9 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Wed, 9 Apr 2025 20:43:56 -0700 Subject: [PATCH 016/119] Fix examples and api --- .../translation/Azure.AI.TextTranslation/models-translate.tsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index 277f2ba88cd3..dbc72bdd707d 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -164,11 +164,11 @@ model TranslateTarget { Default is ‘general’, which uses NMT system. ‘abc-inc-gpt-4o’, and ‘abc-inc-gpt-4o-mini’ are examples of deployment names which use GPT-4o uses or GPT-4o-mini model. ‘gpt-4o’ uses GPT-4o model. - + ‘’ uses the custom NMT model tuned by customer. ‘best’ system determines which is the best model to use for the request. This intelligence could be introduced in future. Customer should have deployed it in their resource. - + """) deploymentNameModel?: string = "general"; From a3aeb82dc3c34202cb6d17ec4488dcbba0f5f11b Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Thu, 10 Apr 2025 14:30:13 -0700 Subject: [PATCH 017/119] Remove old files --- .../Azure.AI.TextTranslation/main.tsp | 2 - .../models-translate.tsp | 1 - .../Azure.AI.TextTranslation/routes.tsp | 8 +- .../stable/v3.0/openapi.json | 1607 ----------------- 4 files changed, 1 insertion(+), 1617 deletions(-) delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json diff --git a/specification/translation/Azure.AI.TextTranslation/main.tsp b/specification/translation/Azure.AI.TextTranslation/main.tsp index 878ffd2e4707..6781c417d002 100644 --- a/specification/translation/Azure.AI.TextTranslation/main.tsp +++ b/specification/translation/Azure.AI.TextTranslation/main.tsp @@ -3,9 +3,7 @@ import "@typespec/versioning"; import "@azure-tools/typespec-azure-core"; import "./routes.tsp"; -using TypeSpec.Rest; using TypeSpec.Http; -using Azure.Core; using TypeSpec.Versioning; #suppress "@azure-tools/typespec-azure-core/auth-required" "!!FIXME!!" diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index dbc72bdd707d..b8767b3a0e79 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -5,7 +5,6 @@ import "./models-shared.tsp"; import "./models-transliterate.tsp"; using TypeSpec.Http; -using TypeSpec.Rest; using TypeSpec.Versioning; using Azure.Core; diff --git a/specification/translation/Azure.AI.TextTranslation/routes.tsp b/specification/translation/Azure.AI.TextTranslation/routes.tsp index a0cdcfb5f7ef..11a18854e0da 100644 --- a/specification/translation/Azure.AI.TextTranslation/routes.tsp +++ b/specification/translation/Azure.AI.TextTranslation/routes.tsp @@ -4,8 +4,6 @@ import "./models-languages.tsp"; import "./models-translate.tsp"; import "./models-transliterate.tsp"; -using Azure.Core; -using TypeSpec.Rest; using TypeSpec.Http; namespace TextTranslation; @@ -15,7 +13,6 @@ op CustomOperation< TBody, TParams, TResponse, - Traits = {}, TError = ErrorResponse >( ...TParams, @@ -31,7 +28,7 @@ op CustomOperation< ): TResponse | TError; @doc("Defines Text Translation custom Operations which doesn't have any content in the request") -op CustomGetOperation( +op CustomGetOperation( ...TParams, @doc("Mandatory API version parameter") @@ -47,7 +44,6 @@ op CustomGetOperation( op getSupportedLanguages is CustomGetOperation< GetSupportedLanguagesParameters, GetSupportedLanguagesResult, - {}, ErrorResponse >; @@ -60,7 +56,6 @@ op translate is CustomOperation< TranslateBodyDetails[], TranslateParameters, TranslationResult, - {}, ErrorResponse >; @@ -73,6 +68,5 @@ op transliterate is CustomOperation< InputTextItem[], TransliterateParameters, TransliterateResult, - {}, ErrorResponse >; diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json deleted file mode 100644 index d2b9652b31e6..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json +++ /dev/null @@ -1,1607 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Text Translation", - "version": "3.0", - "description": "Text translation is a cloud-based REST API feature of the Translator service that uses neural\nmachine translation technology to enable quick and accurate source-to-target text translation\nin real time across all supported languages.\n\nThe following methods are supported by the Text Translation feature:\n\nLanguages. Returns a list of languages supported by Translate, Transliterate, and Dictionary Lookup operations.\n\nTranslate. Renders single source-language text to multiple target-language texts with a single request.\n\nTransliterate. Converts characters or letters of a source language to the corresponding characters or letters of a target language.\n\nDetect. Returns the source code language code and a boolean variable denoting whether the detected language is supported for text translation and transliteration.\n\nDictionary lookup. Returns equivalent words for the source term in the target language.\n\nDictionary example Returns grammatical structure and context examples for the source term and target term pair.", - "x-typespec-generated": [ - { - "emitter": "@azure-tools/typespec-autorest" - } - ] - }, - "schemes": [ - "https" - ], - "x-ms-parameterized-host": { - "hostTemplate": "{Endpoint}", - "useSchemePrefix": false, - "parameters": [ - { - "name": "Endpoint", - "in": "path", - "description": "Supported Text Translation endpoints (protocol and hostname, for example:\n https://api.cognitive.microsofttranslator.com).", - "required": true, - "type": "string", - "format": "uri", - "x-ms-skip-url-encoding": true - } - ] - }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "tags": [], - "paths": { - "/breaksentence": { - "post": { - "operationId": "FindSentenceBoundaries", - "summary": "Find Sentence Boundaries", - "description": "Find Sentence Boundaries", - "parameters": [ - { - "name": "X-ClientTraceId", - "in": "header", - "description": "A client-generated GUID to uniquely identify the request.", - "required": false, - "type": "string", - "x-ms-client-name": "clientTraceId" - }, - { - "$ref": "#/parameters/BreakSentenceParameters.language" - }, - { - "$ref": "#/parameters/BreakSentenceParameters.script" - }, - { - "name": "api-version", - "in": "query", - "description": "Mandatory API version parameter", - "required": true, - "type": "string", - "x-ms-client-name": "apiVersion" - }, - { - "name": "body", - "in": "body", - "description": "Defines the content of the request", - "required": true, - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [] - } - } - ], - "responses": { - "200": { - "description": "Response for the Break SEntence API.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/BreakSentenceItem" - }, - "x-ms-identifiers": [] - }, - "headers": { - "X-RequestId": { - "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - }, - "headers": { - "X-RequestId": { - "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - } - } - } - }, - "x-ms-examples": { - "Find Sentence Boundaries": { - "$ref": "./examples/FindSentenceBoundaries_MaximumSet_Gen.json" - }, - "Find Sentence Boundaries with minimum properties": { - "$ref": "./examples/FindSentenceBoundaries_MinimumSet_Gen.json" - } - } - } - }, - "/dictionary/examples": { - "post": { - "operationId": "LookupDictionaryExamples", - "summary": "Lookup Dictionary Examples", - "description": "Lookup Dictionary Examples", - "parameters": [ - { - "name": "X-ClientTraceId", - "in": "header", - "description": "A client-generated GUID to uniquely identify the request.", - "required": false, - "type": "string", - "x-ms-client-name": "clientTraceId" - }, - { - "$ref": "#/parameters/DictionaryExamplesParameters.from" - }, - { - "$ref": "#/parameters/DictionaryExamplesParameters.to" - }, - { - "name": "api-version", - "in": "query", - "description": "Mandatory API version parameter", - "required": true, - "type": "string", - "x-ms-client-name": "apiVersion" - }, - { - "name": "body", - "in": "body", - "description": "Defines the content of the request", - "required": true, - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/DictionaryExampleTextItem" - }, - "x-ms-identifiers": [] - } - } - ], - "responses": { - "200": { - "description": "Response for the dictionary examples API.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/DictionaryExampleItem" - }, - "x-ms-identifiers": [] - }, - "headers": { - "X-RequestId": { - "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - }, - "headers": { - "X-RequestId": { - "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - } - } - } - }, - "x-ms-examples": { - "Lookup Dictionary Examples": { - "$ref": "./examples/LookupDictionaryExamples_MaximumSet_Gen.json" - }, - "Lookup Dictionary Examples with minimum properties": { - "$ref": "./examples/LookupDictionaryExamples_MinimumSet_Gen.json" - } - } - } - }, - "/dictionary/lookup": { - "post": { - "operationId": "LookupDictionaryEntries", - "summary": "Lookup Dictionary Entries", - "description": "Lookup Dictionary Entries", - "parameters": [ - { - "name": "X-ClientTraceId", - "in": "header", - "description": "A client-generated GUID to uniquely identify the request.", - "required": false, - "type": "string", - "x-ms-client-name": "clientTraceId" - }, - { - "$ref": "#/parameters/DictionaryLookupParameters.from" - }, - { - "$ref": "#/parameters/DictionaryLookupParameters.to" - }, - { - "name": "api-version", - "in": "query", - "description": "Mandatory API version parameter", - "required": true, - "type": "string", - "x-ms-client-name": "apiVersion" - }, - { - "name": "body", - "in": "body", - "description": "Defines the content of the request", - "required": true, - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [] - } - } - ], - "responses": { - "200": { - "description": "Response for the dictionary lookup API.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/DictionaryLookupItem" - }, - "x-ms-identifiers": [] - }, - "headers": { - "X-RequestId": { - "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - }, - "headers": { - "X-RequestId": { - "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - } - } - } - }, - "x-ms-examples": { - "Lookup Dictionary Entries": { - "$ref": "./examples/LookupDictionaryEntries_MaximumSet_Gen.json" - }, - "Lookup Dictionary Entries with minimum properties": { - "$ref": "./examples/LookupDictionaryEntries_MinimumSet_Gen.json" - } - } - } - }, - "/languages": { - "get": { - "operationId": "GetSupportedLanguages", - "summary": "Gets the set of languages currently supported by other operations of the Translator.", - "description": "Gets the set of languages currently supported by other operations of the Translator.", - "parameters": [ - { - "name": "X-ClientTraceId", - "in": "header", - "description": "A client-generated GUID to uniquely identify the request.", - "required": false, - "type": "string", - "x-ms-client-name": "clientTraceId" - }, - { - "$ref": "#/parameters/GetSupportedLanguagesParameters.scope" - }, - { - "$ref": "#/parameters/GetSupportedLanguagesParameters.acceptLanguage" - }, - { - "$ref": "#/parameters/GetSupportedLanguagesParameters.ifNoneMatch" - }, - { - "name": "api-version", - "in": "query", - "description": "Mandatory API version parameter", - "required": true, - "type": "string", - "x-ms-client-name": "apiVersion" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/GetSupportedLanguagesResult" - }, - "headers": { - "ETag": { - "type": "string", - "description": "Current value of the entity tag for the requested groups of supported languages. \nTo make subsequent requests more efficient, the client may send the `ETag` value in an \n`If-None-Match` header field." - }, - "X-RequestId": { - "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - }, - "headers": { - "X-RequestId": { - "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - } - } - } - }, - "x-ms-examples": { - "Gets the set of languages currently supported by other operations of the Translator with minimum properties.": { - "$ref": "./examples/GetSupportedLanguages_MinimumSet_Gen.json" - }, - "Gets the set of languages currently supported by other operations of the Translator.": { - "$ref": "./examples/GetSupportedLanguages_MaximumSet_Gen.json" - } - } - } - }, - "/translate": { - "post": { - "operationId": "Translate", - "summary": "Translate Text", - "description": "Translate Text", - "parameters": [ - { - "name": "X-ClientTraceId", - "in": "header", - "description": "A client-generated GUID to uniquely identify the request.", - "required": false, - "type": "string", - "x-ms-client-name": "clientTraceId" - }, - { - "$ref": "#/parameters/TranslateParameters.to" - }, - { - "$ref": "#/parameters/TranslateParameters.from" - }, - { - "$ref": "#/parameters/TranslateParameters.textType" - }, - { - "$ref": "#/parameters/TranslateParameters.category" - }, - { - "$ref": "#/parameters/TranslateParameters.profanityAction" - }, - { - "$ref": "#/parameters/TranslateParameters.profanityMarker" - }, - { - "$ref": "#/parameters/TranslateParameters.includeAlignment" - }, - { - "$ref": "#/parameters/TranslateParameters.includeSentenceLength" - }, - { - "$ref": "#/parameters/TranslateParameters.suggestedFrom" - }, - { - "$ref": "#/parameters/TranslateParameters.fromScript" - }, - { - "$ref": "#/parameters/TranslateParameters.toScript" - }, - { - "$ref": "#/parameters/TranslateParameters.allowFallback" - }, - { - "name": "api-version", - "in": "query", - "description": "Mandatory API version parameter", - "required": true, - "type": "string", - "x-ms-client-name": "apiVersion" - }, - { - "name": "body", - "in": "body", - "description": "Defines the content of the request", - "required": true, - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [] - } - } - ], - "responses": { - "200": { - "description": "Response for the translation API.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/TranslatedTextItem" - }, - "x-ms-identifiers": [] - }, - "headers": { - "X-RequestId": { - "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - }, - "x-metered-usage": { - "type": "integer", - "format": "int32", - "description": "Specifies consumption (the number of characters for which the user will be charged) for the translation \njob request. For example, if the word \"Hello\" is translated from English (en) to French (fr), \nthis field will return the value '5'." - }, - "x-mt-system": { - "type": "string", - "description": "Specifies the system type that was used for translation for each 'to' language requested for translation. \nThe value is a comma-separated list of strings. Each string indicates a type:\n\n* Custom - Request includes a custom system and at least one custom system was used during translation.\n* Team - All other requests" - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - }, - "headers": { - "X-RequestId": { - "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - } - } - } - }, - "x-ms-examples": { - "Translate Text": { - "$ref": "./examples/Translate_MaximumSet_Gen.json" - }, - "Translate Text with minimum properties": { - "$ref": "./examples/Translate_MinimumSet_Gen.json" - } - } - } - }, - "/transliterate": { - "post": { - "operationId": "Transliterate", - "summary": "Transliterate Text", - "description": "Transliterate Text", - "parameters": [ - { - "name": "X-ClientTraceId", - "in": "header", - "description": "A client-generated GUID to uniquely identify the request.", - "required": false, - "type": "string", - "x-ms-client-name": "clientTraceId" - }, - { - "$ref": "#/parameters/TransliterateParameters.language" - }, - { - "$ref": "#/parameters/TransliterateParameters.fromScript" - }, - { - "$ref": "#/parameters/TransliterateParameters.toScript" - }, - { - "name": "api-version", - "in": "query", - "description": "Mandatory API version parameter", - "required": true, - "type": "string", - "x-ms-client-name": "apiVersion" - }, - { - "name": "body", - "in": "body", - "description": "Defines the content of the request", - "required": true, - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [] - } - } - ], - "responses": { - "200": { - "description": "Response for the transliteration API.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/TransliteratedText" - }, - "x-ms-identifiers": [] - }, - "headers": { - "X-RequestId": { - "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - }, - "headers": { - "X-RequestId": { - "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - } - } - } - }, - "x-ms-examples": { - "Transliterate Text": { - "$ref": "./examples/Transliterate_MaximumSet_Gen.json" - }, - "Transliterate Text with minimum properties": { - "$ref": "./examples/Transliterate_MinimumSet_Gen.json" - } - } - } - } - }, - "definitions": { - "BackTranslation": { - "type": "object", - "description": "Back Translation", - "properties": { - "normalizedText": { - "type": "string", - "description": "A string giving the normalized form of the source term that is a back-translation of the target.\nThis value should be used as input to lookup examples." - }, - "displayText": { - "type": "string", - "description": "A string giving the source term that is a back-translation of the target in a form best\nsuited for end-user display." - }, - "numExamples": { - "type": "integer", - "format": "int32", - "description": "An integer representing the number of examples that are available for this translation pair.\nActual examples must be retrieved with a separate call to lookup examples. The number is mostly\nintended to facilitate display in a UX. For example, a user interface may add a hyperlink\nto the back-translation if the number of examples is greater than zero and show the back-translation\nas plain text if there are no examples. Note that the actual number of examples returned\nby a call to lookup examples may be less than numExamples, because additional filtering may be\napplied on the fly to remove \"bad\" examples." - }, - "frequencyCount": { - "type": "integer", - "format": "int32", - "description": "An integer representing the frequency of this translation pair in the data. The main purpose of this\nfield is to provide a user interface with a means to sort back-translations so the most frequent terms are first." - } - }, - "required": [ - "normalizedText", - "displayText", - "numExamples", - "frequencyCount" - ] - }, - "BreakSentenceItem": { - "type": "object", - "description": "Item containing break sentence result.", - "properties": { - "detectedLanguage": { - "$ref": "#/definitions/DetectedLanguage", - "description": "The detectedLanguage property is only present in the result object when language auto-detection is requested." - }, - "sentLen": { - "type": "array", - "description": "An integer array representing the lengths of the sentences in the input text.\nThe length of the array is the number of sentences, and the values are the length of each sentence.", - "items": { - "type": "integer", - "format": "int32" - } - } - }, - "required": [ - "sentLen" - ] - }, - "BreakSentenceResult": { - "type": "object", - "description": "Response for the Break SEntence API.", - "properties": { - "result": { - "type": "array", - "description": "Array of the break sentence elements.", - "items": { - "$ref": "#/definitions/BreakSentenceItem" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "result" - ] - }, - "DetectedLanguage": { - "type": "object", - "description": "An object describing the detected language.", - "properties": { - "language": { - "type": "string", - "description": "A string representing the code of the detected language." - }, - "score": { - "type": "number", - "format": "float", - "description": "A float value indicating the confidence in the result.\nThe score is between zero and one and a low score indicates a low confidence." - } - }, - "required": [ - "language", - "score" - ] - }, - "DictionaryExample": { - "type": "object", - "description": "Dictionary Example", - "properties": { - "sourcePrefix": { - "type": "string", - "description": "The string to concatenate before the value of sourceTerm to form a complete example.\nDo not add a space character, since it is already there when it should be.\nThis value may be an empty string." - }, - "sourceTerm": { - "type": "string", - "description": "A string equal to the actual term looked up. The string is added with sourcePrefix\nand sourceSuffix to form the complete example. Its value is separated so it can be\nmarked in a user interface, e.g., by bolding it." - }, - "sourceSuffix": { - "type": "string", - "description": "The string to concatenate after the value of sourceTerm to form a complete example.\nDo not add a space character, since it is already there when it should be.\nThis value may be an empty string." - }, - "targetPrefix": { - "type": "string", - "description": "A string similar to sourcePrefix but for the target." - }, - "targetTerm": { - "type": "string", - "description": "A string similar to sourceTerm but for the target." - }, - "targetSuffix": { - "type": "string", - "description": "A string similar to sourceSuffix but for the target." - } - }, - "required": [ - "sourcePrefix", - "sourceTerm", - "sourceSuffix", - "targetPrefix", - "targetTerm", - "targetSuffix" - ] - }, - "DictionaryExampleItem": { - "type": "object", - "description": "Dictionary Example element", - "properties": { - "normalizedSource": { - "type": "string", - "description": "A string giving the normalized form of the source term. Generally, this should be identical\nto the value of the Text field at the matching list index in the body of the request." - }, - "normalizedTarget": { - "type": "string", - "description": "A string giving the normalized form of the target term. Generally, this should be identical\nto the value of the Translation field at the matching list index in the body of the request." - }, - "examples": { - "type": "array", - "description": "A list of examples for the (source term, target term) pair.", - "items": { - "$ref": "#/definitions/DictionaryExample" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "normalizedSource", - "normalizedTarget", - "examples" - ] - }, - "DictionaryExampleTextItem": { - "type": "object", - "description": "Element containing the text with translation.", - "properties": { - "translation": { - "type": "string", - "description": "A string specifying the translated text previously returned by the Dictionary lookup operation. \nThis should be the value from the normalizedTarget field in the translations list of the Dictionary \nlookup response. The service will return examples for the specific source-target word-pair." - } - }, - "required": [ - "translation" - ], - "allOf": [ - { - "$ref": "#/definitions/InputTextItem" - } - ] - }, - "DictionaryExamplesResult": { - "type": "object", - "description": "Response for the dictionary examples API.", - "properties": { - "result": { - "type": "array", - "description": "Array of the dictionary examples elements.", - "items": { - "$ref": "#/definitions/DictionaryExampleItem" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "result" - ] - }, - "DictionaryLookupItem": { - "type": "object", - "description": "Dictionary Lookup Element", - "properties": { - "normalizedSource": { - "type": "string", - "description": "A string giving the normalized form of the source term.\nFor example, if the request is \"JOHN\", the normalized form will be \"john\".\nThe content of this field becomes the input to lookup examples." - }, - "displaySource": { - "type": "string", - "description": "A string giving the source term in a form best suited for end-user display.\nFor example, if the input is \"JOHN\", the display form will reflect the usual\nspelling of the name: \"John\"." - }, - "translations": { - "type": "array", - "description": "A list of translations for the source term.", - "items": { - "$ref": "#/definitions/DictionaryTranslation" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "normalizedSource", - "displaySource", - "translations" - ] - }, - "DictionaryLookupResult": { - "type": "object", - "description": "Response for the dictionary lookup API.", - "properties": { - "result": { - "type": "array", - "description": "Array of the dictionary lookup elements.", - "items": { - "$ref": "#/definitions/DictionaryLookupItem" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "result" - ] - }, - "DictionaryTranslation": { - "type": "object", - "description": "Translation source term.", - "properties": { - "normalizedTarget": { - "type": "string", - "description": "A string giving the normalized form of this term in the target language.\nThis value should be used as input to lookup examples." - }, - "displayTarget": { - "type": "string", - "description": "A string giving the term in the target language and in a form best suited\nfor end-user display. Generally, this will only differ from the normalizedTarget\nin terms of capitalization. For example, a proper noun like \"Juan\" will have\nnormalizedTarget = \"juan\" and displayTarget = \"Juan\"." - }, - "posTag": { - "type": "string", - "description": "A string associating this term with a part-of-speech tag." - }, - "confidence": { - "type": "number", - "format": "float", - "description": "A value between 0.0 and 1.0 which represents the \"confidence\" \n(or perhaps more accurately, \"probability in the training data\") of that translation pair. \nThe sum of confidence scores for one source word may or may not sum to 1.0." - }, - "prefixWord": { - "type": "string", - "description": "A string giving the word to display as a prefix of the translation. Currently,\nthis is the gendered determiner of nouns, in languages that have gendered determiners.\nFor example, the prefix of the Spanish word \"mosca\" is \"la\", since \"mosca\" is a feminine noun in Spanish. \nThis is only dependent on the translation, and not on the source. \nIf there is no prefix, it will be the empty string." - }, - "backTranslations": { - "type": "array", - "description": "A list of \"back translations\" of the target. For example, source words that the target can translate to.\nThe list is guaranteed to contain the source word that was requested (e.g., if the source word being\nlooked up is \"fly\", then it is guaranteed that \"fly\" will be in the backTranslations list).\nHowever, it is not guaranteed to be in the first position, and often will not be.", - "items": { - "$ref": "#/definitions/BackTranslation" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "normalizedTarget", - "displayTarget", - "posTag", - "confidence", - "prefixWord", - "backTranslations" - ] - }, - "ErrorDetails": { - "type": "object", - "description": "Error details as returned by Translator Service.", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "description": "Number identifier of the error." - }, - "message": { - "type": "string", - "description": "Human readable error description." - } - }, - "required": [ - "code", - "message" - ] - }, - "ErrorResponse": { - "type": "object", - "description": "Representation of the Error Response from Translator Service.", - "properties": { - "error": { - "$ref": "#/definitions/ErrorDetails", - "description": "Error details." - } - }, - "required": [ - "error" - ] - }, - "GetSupportedLanguagesResult": { - "type": "object", - "description": "Response for the languages API.", - "properties": { - "translation": { - "type": "object", - "description": "Languages that support translate API.", - "additionalProperties": { - "$ref": "#/definitions/TranslationLanguage" - } - }, - "transliteration": { - "type": "object", - "description": "Languages that support transliteration API.", - "additionalProperties": { - "$ref": "#/definitions/TransliterationLanguage" - } - }, - "dictionary": { - "type": "object", - "description": "Languages that support dictionary API.", - "additionalProperties": { - "$ref": "#/definitions/SourceDictionaryLanguage" - } - } - } - }, - "InputTextItem": { - "type": "object", - "description": "Element containing the text for translation.", - "properties": { - "text": { - "type": "string", - "description": "Text to translate." - } - }, - "required": [ - "text" - ] - }, - "LanguageDirectionality": { - "type": "string", - "description": "Language Directionality", - "enum": [ - "ltr", - "rtl" - ], - "x-ms-enum": { - "name": "LanguageDirectionality", - "modelAsString": false, - "values": [ - { - "name": "LeftToRight", - "value": "ltr", - "description": "Language is written left to right." - }, - { - "name": "RightToLeft", - "value": "rtl", - "description": "Language is written right to left." - } - ] - } - }, - "LanguageScript": { - "type": "object", - "description": "Common properties of language script", - "properties": { - "code": { - "type": "string", - "description": "Code identifying the script." - }, - "name": { - "type": "string", - "description": "Display name of the script in the locale requested via Accept-Language header." - }, - "nativeName": { - "type": "string", - "description": "Display name of the language in the locale native for the language." - }, - "dir": { - "$ref": "#/definitions/LanguageDirectionality", - "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." - } - }, - "required": [ - "code", - "name", - "nativeName", - "dir" - ] - }, - "ProfanityAction": { - "type": "string", - "description": "Translator profanity actions", - "enum": [ - "NoAction", - "Marked", - "Deleted" - ], - "x-ms-enum": { - "name": "ProfanityAction", - "modelAsString": false, - "values": [ - { - "name": "NoAction", - "value": "NoAction", - "description": "No Action is taken on profanity" - }, - { - "name": "Marked", - "value": "Marked", - "description": "Profanity is marked." - }, - { - "name": "Deleted", - "value": "Deleted", - "description": "Profanity is deleted from the translated text." - } - ] - } - }, - "ProfanityMarker": { - "type": "string", - "description": "Translator profanity markers", - "enum": [ - "Asterisk", - "Tag" - ], - "x-ms-enum": { - "name": "ProfanityMarker", - "modelAsString": false, - "values": [ - { - "name": "Asterisk", - "value": "Asterisk", - "description": "Profanity is marked with asterisk." - }, - { - "name": "Tag", - "value": "Tag", - "description": "Profanity is marked with the tags." - } - ] - } - }, - "SentenceBoundaries": { - "type": "object", - "description": "An object returning sentence boundaries in the input and output texts.", - "properties": { - "srcSentLen": { - "type": "array", - "description": "An integer array representing the lengths of the sentences in the input text. \nThe length of the array is the number of sentences, and the values are the length of each sentence.", - "items": { - "type": "integer", - "format": "int32" - } - }, - "transSentLen": { - "type": "array", - "description": "An integer array representing the lengths of the sentences in the translated text. \nThe length of the array is the number of sentences, and the values are the length of each sentence.", - "items": { - "type": "integer", - "format": "int32" - } - } - }, - "required": [ - "srcSentLen", - "transSentLen" - ] - }, - "SourceDictionaryLanguage": { - "type": "object", - "description": "Properties ot the source dictionary language", - "properties": { - "name": { - "type": "string", - "description": "Display name of the language in the locale requested via Accept-Language header." - }, - "nativeName": { - "type": "string", - "description": "Display name of the language in the locale native for this language." - }, - "dir": { - "$ref": "#/definitions/LanguageDirectionality", - "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." - }, - "translations": { - "type": "array", - "description": "List of languages with alterative translations and examples for the query expressed in the source language.", - "items": { - "$ref": "#/definitions/TargetDictionaryLanguage" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "name", - "nativeName", - "dir", - "translations" - ] - }, - "SourceText": { - "type": "object", - "description": "Input text in the default script of the source language. ", - "properties": { - "text": { - "type": "string", - "description": "Input text in the default script of the source language." - } - }, - "required": [ - "text" - ] - }, - "TargetDictionaryLanguage": { - "type": "object", - "description": "Properties of the target dictionary language", - "properties": { - "name": { - "type": "string", - "description": "Display name of the language in the locale requested via Accept-Language header." - }, - "nativeName": { - "type": "string", - "description": "Display name of the language in the locale native for this language." - }, - "dir": { - "$ref": "#/definitions/LanguageDirectionality", - "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." - }, - "code": { - "type": "string", - "description": "Language code identifying the target language." - } - }, - "required": [ - "name", - "nativeName", - "dir", - "code" - ] - }, - "TextType": { - "type": "string", - "description": "Translation text type", - "enum": [ - "Plain", - "Html" - ], - "x-ms-enum": { - "name": "TextType", - "modelAsString": true, - "values": [ - { - "name": "Plain", - "value": "Plain", - "description": "Plain text." - }, - { - "name": "Html", - "value": "Html", - "description": "HTML-encoded text." - } - ] - } - }, - "TranslatedTextAlignment": { - "type": "object", - "description": "Alignment information object.", - "properties": { - "proj": { - "type": "string", - "description": "Maps input text to translated text. The alignment information is only provided when the request \nparameter includeAlignment is true. Alignment is returned as a string value of the following \nformat: [[SourceTextStartIndex]:[SourceTextEndIndex]–[TgtTextStartIndex]:[TgtTextEndIndex]]. \nThe colon separates start and end index, the dash separates the languages, and space separates the words. \nOne word may align with zero, one, or multiple words in the other language, and the aligned words may \nbe non-contiguous. When no alignment information is available, the alignment element will be empty." - } - }, - "required": [ - "proj" - ] - }, - "TranslatedTextItem": { - "type": "object", - "description": "Element containing the translated text", - "properties": { - "detectedLanguage": { - "$ref": "#/definitions/DetectedLanguage", - "description": "The detectedLanguage property is only present in the result object when language auto-detection is requested." - }, - "translations": { - "type": "array", - "description": "An array of translation results. The size of the array matches the number of target \nlanguages specified through the to query parameter.", - "items": { - "$ref": "#/definitions/TranslationText" - }, - "x-ms-identifiers": [] - }, - "sourceText": { - "$ref": "#/definitions/SourceText", - "description": "Input text in the default script of the source language. sourceText property is present only when \nthe input is expressed in a script that's not the usual script for the language. For example, \nif the input were Arabic written in Latin script, then sourceText.text would be the same Arabic text \nconverted into Arab script." - } - }, - "required": [ - "translations" - ] - }, - "TranslationLanguage": { - "type": "object", - "description": "The value of the translation property is a dictionary of (key, value) pairs. Each key is a BCP 47 language tag.\nA key identifies a language for which text can be translated to or translated from.", - "properties": { - "name": { - "type": "string", - "description": "Display name of the language in the locale requested via Accept-Language header." - }, - "nativeName": { - "type": "string", - "description": "Display name of the language in the locale native for this language." - }, - "dir": { - "$ref": "#/definitions/LanguageDirectionality", - "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." - } - }, - "required": [ - "name", - "nativeName", - "dir" - ] - }, - "TranslationResult": { - "type": "object", - "description": "Response for the translation API.", - "properties": { - "result": { - "type": "array", - "description": "Array of the translated text elements.", - "items": { - "$ref": "#/definitions/TranslatedTextItem" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "result" - ] - }, - "TranslationText": { - "type": "object", - "description": "Translation result", - "properties": { - "to": { - "type": "string", - "description": "A string representing the language code of the target language." - }, - "text": { - "type": "string", - "description": "A string giving the translated text." - }, - "transliteration": { - "$ref": "#/definitions/TransliteratedText", - "description": "An object giving the translated text in the script specified by the toScript parameter." - }, - "alignment": { - "$ref": "#/definitions/TranslatedTextAlignment", - "description": "Alignment information." - }, - "sentLen": { - "$ref": "#/definitions/SentenceBoundaries", - "description": "Sentence boundaries in the input and output texts." - } - }, - "required": [ - "to", - "text" - ] - }, - "TransliterableScript": { - "type": "object", - "description": "Script definition with list of script into which given script can be translitered.", - "properties": { - "toScripts": { - "type": "array", - "description": "List of scripts available to convert text to.", - "items": { - "$ref": "#/definitions/LanguageScript" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "toScripts" - ], - "allOf": [ - { - "$ref": "#/definitions/LanguageScript" - } - ] - }, - "TransliterateResult": { - "type": "object", - "description": "Response for the transliteration API.", - "properties": { - "result": { - "type": "array", - "description": "Array of transliterated texts", - "items": { - "$ref": "#/definitions/TransliteratedText" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "result" - ] - }, - "TransliteratedText": { - "type": "object", - "description": "Transliterated text element.", - "properties": { - "text": { - "type": "string", - "description": "A string which is the result of converting the input string to the output script." - }, - "script": { - "type": "string", - "description": "A string specifying the script used in the output." - } - }, - "required": [ - "text", - "script" - ] - }, - "TransliterationLanguage": { - "type": "object", - "description": "The value of the transliteration property is a dictionary of (key, value) pairs. \nEach key is a BCP 47 language tag. A key identifies a language for which text can be converted from one script \nto another script.", - "properties": { - "name": { - "type": "string", - "description": "Display name of the language in the locale requested via Accept-Language header." - }, - "nativeName": { - "type": "string", - "description": "Display name of the language in the locale native for this language." - }, - "scripts": { - "type": "array", - "description": "List of scripts to convert from.", - "items": { - "$ref": "#/definitions/TransliterableScript" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "name", - "nativeName", - "scripts" - ] - } - }, - "parameters": { - "BreakSentenceParameters.language": { - "name": "language", - "in": "query", - "description": "Language tag identifying the language of the input text. \nIf a code isn't specified, automatic language detection will be applied.", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - }, - "BreakSentenceParameters.script": { - "name": "script", - "in": "query", - "description": "Script tag identifying the script used by the input text. \nIf a script isn't specified, the default script of the language will be assumed.", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - }, - "DictionaryExamplesParameters.from": { - "name": "from", - "in": "query", - "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "DictionaryExamplesParameters.to": { - "name": "to", - "in": "query", - "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "DictionaryLookupParameters.from": { - "name": "from", - "in": "query", - "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "DictionaryLookupParameters.to": { - "name": "to", - "in": "query", - "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "GetSupportedLanguagesParameters.acceptLanguage": { - "name": "Accept-Language", - "in": "header", - "description": "The language to use for user interface strings. Some of the fields in the response are names of languages or \nnames of regions. Use this parameter to define the language in which these names are returned. \nThe language is specified by providing a well-formed BCP 47 language tag. For instance, use the value `fr` \nto request names in French or use the value `zh-Hant` to request names in Chinese Traditional.\nNames are provided in the English language when a target language is not specified or when localization \nis not available.", - "required": false, - "type": "string", - "default": "en", - "x-ms-parameter-location": "method", - "x-ms-client-name": "acceptLanguage" - }, - "GetSupportedLanguagesParameters.ifNoneMatch": { - "name": "If-None-Match", - "in": "header", - "description": "Passing the value of the ETag response header in an If-None-Match field will allow the service to optimize the response. \nIf the resource has not been modified, the service will return status code 304 and an empty response body.", - "required": false, - "type": "string", - "x-ms-parameter-location": "method", - "x-ms-client-name": "ifNoneMatch" - }, - "GetSupportedLanguagesParameters.scope": { - "name": "scope", - "in": "query", - "description": "A comma-separated list of names defining the group of languages to return.\nAllowed group names are: `translation`, `transliteration` and `dictionary`.\nIf no scope is given, then all groups are returned, which is equivalent to passing \n`scope=translation,transliteration,dictionary`. To decide which set of supported languages \nis appropriate for your scenario, see the description of the [response object](#response-body).", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - }, - "TranslateParameters.allowFallback": { - "name": "allowFallback", - "in": "query", - "description": "Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. \nPossible values are: true (default) or false.\n\nallowFallback=false specifies that the translation should only use systems trained for the category specified \nby the request. If a translation for language X to language Y requires chaining through a pivot language E, \nthen all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. \nIf no system is found with the specific category, the request will return a 400 status code. allowFallback=true \nspecifies that the service is allowed to fall back to a general system when a custom system doesn't exist.", - "required": false, - "type": "boolean", - "default": true, - "x-ms-parameter-location": "method" - }, - "TranslateParameters.category": { - "name": "category", - "in": "query", - "description": "A string specifying the category (domain) of the translation. This parameter is used to get translations \nfrom a customized system built with Custom Translator. Add the Category ID from your Custom Translator \nproject details to this parameter to use your deployed customized system. Default value is: general.", - "required": false, - "type": "string", - "default": "general", - "x-ms-parameter-location": "method" - }, - "TranslateParameters.from": { - "name": "from", - "in": "query", - "description": "Specifies the language of the input text. Find which languages are available to translate from by \nlooking up supported languages using the translation scope. If the from parameter isn't specified, \nautomatic language detection is applied to determine the source language.\n\nYou must use the from parameter rather than autodetection when using the dynamic dictionary feature. \nNote: the dynamic dictionary feature is case-sensitive.", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - }, - "TranslateParameters.fromScript": { - "name": "fromScript", - "in": "query", - "description": "Specifies the script of the input text.", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - }, - "TranslateParameters.includeAlignment": { - "name": "includeAlignment", - "in": "query", - "description": "Specifies whether to include alignment projection from source text to translated text.\nPossible values are: true or false (default).", - "required": false, - "type": "boolean", - "default": false, - "x-ms-parameter-location": "method" - }, - "TranslateParameters.includeSentenceLength": { - "name": "includeSentenceLength", - "in": "query", - "description": "Specifies whether to include sentence boundaries for the input text and the translated text.\nPossible values are: true or false (default).", - "required": false, - "type": "boolean", - "default": false, - "x-ms-parameter-location": "method" - }, - "TranslateParameters.profanityAction": { - "name": "profanityAction", - "in": "query", - "description": "Specifies how profanities should be treated in translations.\nPossible values are: NoAction (default), Marked or Deleted.", - "required": false, - "type": "string", - "default": "NoAction", - "enum": [ - "NoAction", - "Marked", - "Deleted" - ], - "x-ms-enum": { - "name": "ProfanityAction", - "modelAsString": false, - "values": [ - { - "name": "NoAction", - "value": "NoAction", - "description": "No Action is taken on profanity" - }, - { - "name": "Marked", - "value": "Marked", - "description": "Profanity is marked." - }, - { - "name": "Deleted", - "value": "Deleted", - "description": "Profanity is deleted from the translated text." - } - ] - }, - "x-ms-parameter-location": "method" - }, - "TranslateParameters.profanityMarker": { - "name": "profanityMarker", - "in": "query", - "description": "Specifies how profanities should be marked in translations.\nPossible values are: Asterisk (default) or Tag. ", - "required": false, - "type": "string", - "default": "Asterisk", - "enum": [ - "Asterisk", - "Tag" - ], - "x-ms-enum": { - "name": "ProfanityMarker", - "modelAsString": false, - "values": [ - { - "name": "Asterisk", - "value": "Asterisk", - "description": "Profanity is marked with asterisk." - }, - { - "name": "Tag", - "value": "Tag", - "description": "Profanity is marked with the tags." - } - ] - }, - "x-ms-parameter-location": "method" - }, - "TranslateParameters.suggestedFrom": { - "name": "suggestedFrom", - "in": "query", - "description": "Specifies a fallback language if the language of the input text can't be identified. \nLanguage autodetection is applied when the from parameter is omitted. If detection fails, \nthe suggestedFrom language will be assumed.", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - }, - "TranslateParameters.textType": { - "name": "textType", - "in": "query", - "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", - "required": false, - "type": "string", - "default": "Plain", - "enum": [ - "Plain", - "Html" - ], - "x-ms-enum": { - "name": "TextType", - "modelAsString": true, - "values": [ - { - "name": "Plain", - "value": "Plain", - "description": "Plain text." - }, - { - "name": "Html", - "value": "Html", - "description": "HTML-encoded text." - } - ] - }, - "x-ms-parameter-location": "method" - }, - "TranslateParameters.to": { - "name": "to", - "in": "query", - "description": "Specifies the language of the output text. The target language must be one of the supported languages included \nin the translation scope. For example, use to=de to translate to German.\nIt's possible to translate to multiple languages simultaneously by repeating the parameter in the query string. \nFor example, use to=de&to=it to translate to German and Italian.", - "required": true, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "x-ms-parameter-location": "method" - }, - "TranslateParameters.toScript": { - "name": "toScript", - "in": "query", - "description": "Specifies the script of the translated text.", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - }, - "TransliterateParameters.fromScript": { - "name": "fromScript", - "in": "query", - "description": "Specifies the script used by the input text. Look up supported languages using the transliteration scope,\nto find input scripts available for the selected language.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "TransliterateParameters.language": { - "name": "language", - "in": "query", - "description": "Specifies the language of the text to convert from one script to another. \nPossible languages are listed in the transliteration scope obtained by querying the service \nfor its supported languages.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "TransliterateParameters.toScript": { - "name": "toScript", - "in": "query", - "description": "Specifies the output script. Look up supported languages using the transliteration scope, to find output \nscripts available for the selected combination of input language and input script.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - } - } -} From c4b531bf3f39a209c93563658b3b9b3525da5733 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Thu, 10 Apr 2025 14:39:08 -0700 Subject: [PATCH 018/119] Remove old files --- .../translation/Azure.AI.TextTranslation/routes.tsp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/routes.tsp b/specification/translation/Azure.AI.TextTranslation/routes.tsp index 11a18854e0da..12c2f4509c51 100644 --- a/specification/translation/Azure.AI.TextTranslation/routes.tsp +++ b/specification/translation/Azure.AI.TextTranslation/routes.tsp @@ -9,12 +9,7 @@ using TypeSpec.Http; namespace TextTranslation; @doc("Defines Text Translation custom Operation") -op CustomOperation< - TBody, - TParams, - TResponse, - TError = ErrorResponse ->( +op CustomOperation( ...TParams, #suppress "@azure-tools/typespec-azure-core/request-body-problem" "Existing spec" From 8c4d3ffc56b525c0ab5431cc24f4abb05aa3ecbc Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Thu, 10 Apr 2025 16:48:47 -0700 Subject: [PATCH 019/119] FIx versioning --- .../Azure.AI.TextTranslation/tspconfig.yaml | 2 +- .../GetSupportedLanguages_MaximumSet_Gen.json | 0 .../GetSupportedLanguages_MinimumSet_Gen.json | 0 .../examples/Translate_MaximumSet_Gen.json | 0 .../examples/Translate_MinimumSet_Gen.json | 0 .../Transliterate_MaximumSet_Gen.json | 0 .../Transliterate_MinimumSet_Gen.json | 0 .../openapi.json | 0 .../GetSupportedLanguages_MaximumSet_Gen.json | 80 ++ .../GetSupportedLanguages_MinimumSet_Gen.json | 12 + .../examples/Translate_MaximumSet_Gen.json | 63 + .../examples/Translate_MinimumSet_Gen.json | 29 + .../Transliterate_MaximumSet_Gen.json | 26 + .../Transliterate_MinimumSet_Gen.json | 25 + .../stable/3.0/openapi.json | 1210 +++++++++++++++++ 15 files changed, 1446 insertions(+), 1 deletion(-) rename specification/translation/data-plane/Azure.AI.TextTranslation/preview/{2025-05-01 => 2025-05-01-preview}/examples/GetSupportedLanguages_MaximumSet_Gen.json (100%) rename specification/translation/data-plane/Azure.AI.TextTranslation/preview/{2025-05-01 => 2025-05-01-preview}/examples/GetSupportedLanguages_MinimumSet_Gen.json (100%) rename specification/translation/data-plane/Azure.AI.TextTranslation/preview/{2025-05-01 => 2025-05-01-preview}/examples/Translate_MaximumSet_Gen.json (100%) rename specification/translation/data-plane/Azure.AI.TextTranslation/preview/{2025-05-01 => 2025-05-01-preview}/examples/Translate_MinimumSet_Gen.json (100%) rename specification/translation/data-plane/Azure.AI.TextTranslation/preview/{2025-05-01 => 2025-05-01-preview}/examples/Transliterate_MaximumSet_Gen.json (100%) rename specification/translation/data-plane/Azure.AI.TextTranslation/preview/{2025-05-01 => 2025-05-01-preview}/examples/Transliterate_MinimumSet_Gen.json (100%) rename specification/translation/data-plane/Azure.AI.TextTranslation/preview/{2025-05-01 => 2025-05-01-preview}/openapi.json (100%) create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/GetSupportedLanguages_MaximumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/GetSupportedLanguages_MinimumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Translate_MaximumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Translate_MinimumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Transliterate_MaximumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Transliterate_MinimumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json diff --git a/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml b/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml index d57012018acf..d3dee1570e26 100644 --- a/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml +++ b/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml @@ -15,7 +15,7 @@ options: azure-resource-provider-folder: "data-plane" emit-lro-options: "none" emitter-output-dir: "{project-root}/.." - output-file: "{azure-resource-provider-folder}/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json" + output-file: "{azure-resource-provider-folder}/Azure.AI.TextTranslation/{version-status}/{version}/openapi.json" "@azure-tools/typespec-csharp": package-dir: "Azure.AI.Translation.Text" clear-output-folder: true diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/GetSupportedLanguages_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MaximumSet_Gen.json similarity index 100% rename from specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/GetSupportedLanguages_MaximumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MaximumSet_Gen.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/GetSupportedLanguages_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MinimumSet_Gen.json similarity index 100% rename from specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/GetSupportedLanguages_MinimumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MinimumSet_Gen.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json similarity index 100% rename from specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Translate_MaximumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json similarity index 100% rename from specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Translate_MinimumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Transliterate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json similarity index 100% rename from specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Transliterate_MaximumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Transliterate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json similarity index 100% rename from specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/examples/Transliterate_MinimumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json similarity index 100% rename from specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01/openapi.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/GetSupportedLanguages_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/GetSupportedLanguages_MaximumSet_Gen.json new file mode 100644 index 000000000000..0fdb83142178 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/GetSupportedLanguages_MaximumSet_Gen.json @@ -0,0 +1,80 @@ +{ + "title": "Gets the set of languages currently supported by other operations of the Translator.", + "operationId": "GetSupportedLanguages", + "parameters": { + "X-ClientTraceId": "kayfnugjec", + "scope": "translation,transliteration,dictionary", + "Accept-Language": "en", + "If-None-Match": "fpnhruttllvc", + "api-version": "3.0" + }, + "responses": { + "200": { + "body": { + "translation": { + "en": { + "name": "English", + "nativeName": "English", + "dir": "ltr" + }, + "es": { + "name": "Spanish", + "nativeName": "Español", + "dir": "ltr" + } + }, + "transliteration": { + "ar": { + "name": "Arabic", + "nativeName": "العربية", + "scripts": [ + { + "code": "Arab", + "name": "Arabic", + "nativeName": "العربية", + "dir": "rtl", + "toScripts": [ + { + "code": "Latn", + "name": "Latin", + "nativeName": "اللاتينية", + "dir": "ltr" + } + ] + }, + { + "code": "Latn", + "name": "Latin", + "nativeName": "اللاتينية", + "dir": "ltr", + "toScripts": [ + { + "code": "Arab", + "name": "Arabic", + "nativeName": "العربية", + "dir": "rtl" + } + ] + } + ] + } + }, + "dictionary": { + "cs": { + "name": "Czech", + "nativeName": "Čeština", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + } + } + } + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/GetSupportedLanguages_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/GetSupportedLanguages_MinimumSet_Gen.json new file mode 100644 index 000000000000..5f8405e887d9 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/GetSupportedLanguages_MinimumSet_Gen.json @@ -0,0 +1,12 @@ +{ + "title": "Gets the set of languages currently supported by other operations of the Translator with minimum properties.", + "operationId": "GetSupportedLanguages", + "parameters": { + "api-version": "3.0" + }, + "responses": { + "200": { + "body": {} + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Translate_MaximumSet_Gen.json new file mode 100644 index 000000000000..06f74471d1df --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Translate_MaximumSet_Gen.json @@ -0,0 +1,63 @@ +{ + "title": "Translate Text", + "operationId": "Translate", + "parameters": { + "X-ClientTraceId": "ndbkaatzsnoetqkiehappoza", + "to": [ + "cs" + ], + "from": "en", + "textType": "Plain", + "category": "custom", + "profanityAction": "NoAction", + "profanityMarker": "Asterisk", + "includeAlignment": true, + "includeSentenceLength": true, + "suggestedFrom": "en", + "fromScript": "Latn", + "toScript": "Latn", + "allowFallback": true, + "api-version": "3.0", + "body": [ + { + "text": "This is a test." + } + ] + }, + "responses": { + "200": { + "body": [ + { + "detectedLanguage": { + "language": "en", + "score": 1.0 + }, + "translations": [ + { + "to": "cs", + "text": "Tohle je test.", + "transliteration": { + "text": "Tohle je test.", + "script": "Latn" + }, + "alignment": { + "proj": "okrxvzsagjgzrrv" + }, + "sentLen": { + "srcSentLen": [ + 30 + ], + "transSentLen": [ + 24 + ] + } + } + ], + "sourceText": { + "text": "This is a test" + } + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Translate_MinimumSet_Gen.json new file mode 100644 index 000000000000..b29982929425 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Translate_MinimumSet_Gen.json @@ -0,0 +1,29 @@ +{ + "title": "Translate Text with minimum properties", + "operationId": "Translate", + "parameters": { + "to": [ + "fmlxpuepn" + ], + "api-version": "3.0", + "body": [ + { + "text": "This is a test." + } + ] + }, + "responses": { + "200": { + "body": [ + { + "translations": [ + { + "text": "Tohle je test.", + "to": "cs" + } + ] + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Transliterate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Transliterate_MaximumSet_Gen.json new file mode 100644 index 000000000000..92f67b4a62d3 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Transliterate_MaximumSet_Gen.json @@ -0,0 +1,26 @@ +{ + "title": "Transliterate Text", + "operationId": "Transliterate", + "parameters": { + "X-ClientTraceId": "dzncrimwmvtwjnheh", + "language": "zh-Hans", + "fromScript": "Hans", + "toScript": "Latn", + "api-version": "3.0", + "body": [ + { + "text": "这是个测试。" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "text": "zhè shì gè cè shì。", + "script": "Latn" + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Transliterate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Transliterate_MinimumSet_Gen.json new file mode 100644 index 000000000000..24c5aee2ffb1 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Transliterate_MinimumSet_Gen.json @@ -0,0 +1,25 @@ +{ + "title": "Transliterate Text with minimum properties", + "operationId": "Transliterate", + "parameters": { + "language": "zh-Hans", + "fromScript": "Hans", + "toScript": "Latn", + "api-version": "3.0", + "body": [ + { + "text": "这是个测试。" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "text": "zhè shì gè cè shì。", + "script": "Latn" + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json new file mode 100644 index 000000000000..7e55886f254a --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json @@ -0,0 +1,1210 @@ +{ + "swagger": "2.0", + "info": { + "title": "Text Translation", + "version": "3.0", + "description": "Text translation is a cloud-based REST API feature of the Translator service that uses neural\nmachine translation technology to enable quick and accurate source-to-target text translation\nin real time across all supported languages.\n\nThe following methods are supported by the Text Translation feature:\n\nLanguages. Returns a list of languages supported by Translate, Transliterate, and Dictionary Lookup operations.\n\nTranslate. Renders single source-language text to multiple target-language texts with a single request.\n\nTransliterate. Converts characters or letters of a source language to the corresponding characters or letters of a target language.\n\nDetect. Returns the source code language code and a boolean variable denoting whether the detected language is supported for text translation and transliteration.", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "Endpoint", + "in": "path", + "description": "Supported Text Translation endpoints (protocol and hostname, for example:\n https://api.cognitive.microsofttranslator.com).", + "required": true, + "type": "string", + "format": "uri", + "x-ms-skip-url-encoding": true + } + ] + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": { + "/languages": { + "get": { + "operationId": "GetSupportedLanguages", + "summary": "Gets the set of languages currently supported by other operations of the Translator.", + "description": "Gets the set of languages currently supported by other operations of the Translator.", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "description": "A client-generated GUID to uniquely identify the request.", + "required": false, + "type": "string", + "x-ms-client-name": "clientTraceId" + }, + { + "$ref": "#/parameters/GetSupportedLanguagesParameters.scope" + }, + { + "$ref": "#/parameters/GetSupportedLanguagesParameters.acceptLanguage" + }, + { + "$ref": "#/parameters/GetSupportedLanguagesParameters.ifNoneMatch" + }, + { + "name": "api-version", + "in": "query", + "description": "Mandatory API version parameter", + "required": true, + "type": "string", + "x-ms-client-name": "apiVersion" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/GetSupportedLanguagesResult" + }, + "headers": { + "ETag": { + "type": "string", + "description": "Current value of the entity tag for the requested groups of supported languages. \nTo make subsequent requests more efficient, the client may send the `ETag` value in an \n`If-None-Match` header field." + }, + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + } + }, + "x-ms-examples": { + "Gets the set of languages currently supported by other operations of the Translator with minimum properties.": { + "$ref": "./examples/GetSupportedLanguages_MinimumSet_Gen.json" + }, + "Gets the set of languages currently supported by other operations of the Translator.": { + "$ref": "./examples/GetSupportedLanguages_MaximumSet_Gen.json" + } + } + } + }, + "/translate": { + "post": { + "operationId": "Translate", + "summary": "Translate Text", + "description": "Translate Text", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "description": "A client-generated GUID to uniquely identify the request.", + "required": false, + "type": "string", + "x-ms-client-name": "clientTraceId" + }, + { + "$ref": "#/parameters/TranslateParameters.to" + }, + { + "$ref": "#/parameters/TranslateParameters.from" + }, + { + "$ref": "#/parameters/TranslateParameters.textType" + }, + { + "$ref": "#/parameters/TranslateParameters.category" + }, + { + "$ref": "#/parameters/TranslateParameters.profanityAction" + }, + { + "$ref": "#/parameters/TranslateParameters.profanityMarker" + }, + { + "$ref": "#/parameters/TranslateParameters.includeAlignment" + }, + { + "$ref": "#/parameters/TranslateParameters.includeSentenceLength" + }, + { + "$ref": "#/parameters/TranslateParameters.suggestedFrom" + }, + { + "$ref": "#/parameters/TranslateParameters.fromScript" + }, + { + "$ref": "#/parameters/TranslateParameters.toScript" + }, + { + "$ref": "#/parameters/TranslateParameters.allowFallback" + }, + { + "name": "api-version", + "in": "query", + "description": "Mandatory API version parameter", + "required": true, + "type": "string", + "x-ms-client-name": "apiVersion" + }, + { + "name": "body", + "in": "body", + "description": "Defines the content of the request", + "required": true, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TranslateBodyDetails" + }, + "x-ms-identifiers": [] + } + } + ], + "responses": { + "200": { + "description": "Response for the translation API.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TranslatedTextItem" + }, + "x-ms-identifiers": [] + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + }, + "x-metered-usage": { + "type": "integer", + "format": "int32", + "description": "Specifies consumption (the number of characters for which the user will be charged) for the translation \njob request. For example, if the word \"Hello\" is translated from English (en) to French (fr), \nthis field will return the value '5'." + }, + "x-mt-system": { + "type": "string", + "description": "Specifies the system type that was used for translation for each 'to' language requested for translation. \nThe value is a comma-separated list of strings. Each string indicates a type:\n\n* Custom - Request includes a custom system and at least one custom system was used during translation.\n* Team - All other requests" + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + } + }, + "x-ms-examples": { + "Translate Text": { + "$ref": "./examples/Translate_MaximumSet_Gen.json" + }, + "Translate Text with minimum properties": { + "$ref": "./examples/Translate_MinimumSet_Gen.json" + } + } + } + }, + "/transliterate": { + "post": { + "operationId": "Transliterate", + "summary": "Transliterate Text", + "description": "Transliterate Text", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "description": "A client-generated GUID to uniquely identify the request.", + "required": false, + "type": "string", + "x-ms-client-name": "clientTraceId" + }, + { + "$ref": "#/parameters/TransliterateParameters.language" + }, + { + "$ref": "#/parameters/TransliterateParameters.fromScript" + }, + { + "$ref": "#/parameters/TransliterateParameters.toScript" + }, + { + "name": "api-version", + "in": "query", + "description": "Mandatory API version parameter", + "required": true, + "type": "string", + "x-ms-client-name": "apiVersion" + }, + { + "name": "body", + "in": "body", + "description": "Defines the content of the request", + "required": true, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [] + } + } + ], + "responses": { + "200": { + "description": "Response for the transliteration API.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TransliteratedText" + }, + "x-ms-identifiers": [] + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + } + }, + "x-ms-examples": { + "Transliterate Text": { + "$ref": "./examples/Transliterate_MaximumSet_Gen.json" + }, + "Transliterate Text with minimum properties": { + "$ref": "./examples/Transliterate_MinimumSet_Gen.json" + } + } + } + } + }, + "definitions": { + "DetectedLanguage": { + "type": "object", + "description": "An object describing the detected language.", + "properties": { + "language": { + "type": "string", + "description": "A string representing the code of the detected language." + }, + "score": { + "type": "number", + "format": "float", + "description": "A float value indicating the confidence in the result.\nThe score is between zero and one and a low score indicates a low confidence." + } + }, + "required": [ + "language", + "score" + ] + }, + "ErrorDetails": { + "type": "object", + "description": "Error details as returned by Translator Service.", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "description": "Number identifier of the error." + }, + "message": { + "type": "string", + "description": "Human readable error description." + } + }, + "required": [ + "code", + "message" + ] + }, + "ErrorResponse": { + "type": "object", + "description": "Representation of the Error Response from Translator Service.", + "properties": { + "error": { + "$ref": "#/definitions/ErrorDetails", + "description": "Error details." + } + }, + "required": [ + "error" + ] + }, + "GetSupportedLanguagesResult": { + "type": "object", + "description": "Response for the languages API.", + "properties": { + "translation": { + "type": "object", + "description": "Languages that support translate API.", + "additionalProperties": { + "$ref": "#/definitions/TranslationLanguage" + } + }, + "transliteration": { + "type": "object", + "description": "Languages that support transliteration API.", + "additionalProperties": { + "$ref": "#/definitions/TransliterationLanguage" + } + }, + "dictionary": { + "type": "object", + "description": "Languages that support dictionary API.", + "additionalProperties": { + "$ref": "#/definitions/SourceDictionaryLanguage" + } + } + } + }, + "InputTextItem": { + "type": "object", + "description": "Element containing the text for translation.", + "properties": { + "text": { + "type": "string", + "description": "Text to translate." + } + }, + "required": [ + "text" + ] + }, + "LanguageDirectionality": { + "type": "string", + "description": "Language Directionality", + "enum": [ + "ltr", + "rtl" + ], + "x-ms-enum": { + "name": "LanguageDirectionality", + "modelAsString": false, + "values": [ + { + "name": "LeftToRight", + "value": "ltr", + "description": "Language is written left to right." + }, + { + "name": "RightToLeft", + "value": "rtl", + "description": "Language is written right to left." + } + ] + } + }, + "LanguageScript": { + "type": "object", + "description": "Common properties of language script", + "properties": { + "code": { + "type": "string", + "description": "Code identifying the script." + }, + "name": { + "type": "string", + "description": "Display name of the script in the locale requested via Accept-Language header." + }, + "nativeName": { + "type": "string", + "description": "Display name of the language in the locale native for the language." + }, + "dir": { + "$ref": "#/definitions/LanguageDirectionality", + "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." + } + }, + "required": [ + "code", + "name", + "nativeName", + "dir" + ] + }, + "ProfanityAction": { + "type": "string", + "description": "Translator profanity actions", + "enum": [ + "NoAction", + "Marked", + "Deleted" + ], + "x-ms-enum": { + "name": "ProfanityAction", + "modelAsString": false, + "values": [ + { + "name": "NoAction", + "value": "NoAction", + "description": "No Action is taken on profanity" + }, + { + "name": "Marked", + "value": "Marked", + "description": "Profanity is marked." + }, + { + "name": "Deleted", + "value": "Deleted", + "description": "Profanity is deleted from the translated text." + } + ] + } + }, + "ProfanityMarker": { + "type": "string", + "description": "Translator profanity markers", + "enum": [ + "Asterisk", + "Tag" + ], + "x-ms-enum": { + "name": "ProfanityMarker", + "modelAsString": false, + "values": [ + { + "name": "Asterisk", + "value": "Asterisk", + "description": "Profanity is marked with asterisk." + }, + { + "name": "Tag", + "value": "Tag", + "description": "Profanity is marked with the tags." + } + ] + } + }, + "ReferenceSentencePair": { + "type": "object", + "description": "Reference sentence pair.", + "properties": { + "referenceTextPairsSource": { + "type": "string", + "description": "Source reference sentence." + }, + "referenceTextPairsTarget": { + "type": "string", + "description": "Target reference sentence." + } + }, + "required": [ + "referenceTextPairsSource", + "referenceTextPairsTarget" + ] + }, + "SourceDictionaryLanguage": { + "type": "object", + "description": "Properties ot the source dictionary language", + "properties": { + "name": { + "type": "string", + "description": "Display name of the language in the locale requested via Accept-Language header." + }, + "nativeName": { + "type": "string", + "description": "Display name of the language in the locale native for this language." + }, + "dir": { + "$ref": "#/definitions/LanguageDirectionality", + "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." + }, + "translations": { + "type": "array", + "description": "List of languages with alterative translations and examples for the query expressed in the source language.", + "items": { + "$ref": "#/definitions/TargetDictionaryLanguage" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "name", + "nativeName", + "dir", + "translations" + ] + }, + "SourceText": { + "type": "object", + "description": "Input text in the default script of the source language. ", + "properties": { + "text": { + "type": "string", + "description": "Input text in the default script of the source language." + } + }, + "required": [ + "text" + ] + }, + "TargetDictionaryLanguage": { + "type": "object", + "description": "Properties of the target dictionary language", + "properties": { + "name": { + "type": "string", + "description": "Display name of the language in the locale requested via Accept-Language header." + }, + "nativeName": { + "type": "string", + "description": "Display name of the language in the locale native for this language." + }, + "dir": { + "$ref": "#/definitions/LanguageDirectionality", + "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." + }, + "code": { + "type": "string", + "description": "Language code identifying the target language." + } + }, + "required": [ + "name", + "nativeName", + "dir", + "code" + ] + }, + "TextType": { + "type": "string", + "description": "Translation text type", + "enum": [ + "Plain", + "Html" + ], + "x-ms-enum": { + "name": "TextType", + "modelAsString": true, + "values": [ + { + "name": "Plain", + "value": "Plain", + "description": "Plain text." + }, + { + "name": "Html", + "value": "Html", + "description": "HTML-encoded text." + } + ] + } + }, + "TranslateBodyDetails": { + "type": "object", + "description": "Request body parameters for the translate API.", + "properties": { + "text": { + "type": "string", + "description": "Specifies the text string to be translated in the translate API." + }, + "script": { + "type": "string", + "description": "Specifies the script of the input text." + }, + "language": { + "type": "string", + "description": "Specifies the language of the input text. Find which languages are available to translate by \nlooking up supported languages using the translation scope. If the language parameter isn't \nspecified, automatic language detection is applied to determine the source language.\n\nYou must use the language parameter rather than autodetection when using the dynamic dictionary feature. \nNote: the dynamic dictionary feature is case-sensitive." + }, + "textType": { + "type": "string", + "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", + "default": "Plain", + "enum": [ + "Plain", + "Html" + ], + "x-ms-enum": { + "name": "TextType", + "modelAsString": true, + "values": [ + { + "name": "Plain", + "value": "Plain", + "description": "Plain text." + }, + { + "name": "Html", + "value": "Html", + "description": "HTML-encoded text." + } + ] + } + }, + "targets": { + "$ref": "#/definitions/TranslateTarget", + "description": "Translation target parameters." + } + }, + "required": [ + "text", + "targets" + ] + }, + "TranslateBodyParameters": { + "type": "object", + "description": "Request body parameters for the translate API.", + "properties": { + "body": { + "$ref": "#/definitions/TranslateBodyDetails", + "description": "Details of the translate request" + } + }, + "required": [ + "body" + ] + }, + "TranslateTarget": { + "type": "object", + "description": "Translate targets parameters", + "properties": { + "language": { + "type": "array", + "description": "Specifies the language of the output text. The target language must be one of the supported languages included \nin the translation scope. It's possible to translate to multiple languages simultaneously by including \nmultiple string values in the targetsLanguage array.", + "items": { + "type": "string" + } + }, + "script": { + "type": "string", + "description": "Specifies the script of the translated text." + }, + "profanityAction": { + "type": "string", + "description": "Specifies how profanities should be treated in translations.\nPossible values are: NoAction (default), Marked or Deleted.", + "default": "NoAction", + "enum": [ + "NoAction", + "Marked", + "Deleted" + ], + "x-ms-enum": { + "name": "ProfanityAction", + "modelAsString": false, + "values": [ + { + "name": "NoAction", + "value": "NoAction", + "description": "No Action is taken on profanity" + }, + { + "name": "Marked", + "value": "Marked", + "description": "Profanity is marked." + }, + { + "name": "Deleted", + "value": "Deleted", + "description": "Profanity is deleted from the translated text." + } + ] + } + }, + "profanityMarker": { + "type": "string", + "description": "Specifies how profanities should be marked in translations.\nPossible values are: Asterisk (default) or Tag. ", + "default": "Asterisk", + "enum": [ + "Asterisk", + "Tag" + ], + "x-ms-enum": { + "name": "ProfanityMarker", + "modelAsString": false, + "values": [ + { + "name": "Asterisk", + "value": "Asterisk", + "description": "Profanity is marked with asterisk." + }, + { + "name": "Tag", + "value": "Tag", + "description": "Profanity is marked with the tags." + } + ] + } + }, + "deploymentNameModel": { + "type": "string", + "description": "Default is ‘general’, which uses NMT system.\n‘abc-inc-gpt-4o’, and ‘abc-inc-gpt-4o-mini’ are examples of deployment names which use GPT-4o uses or \nGPT-4o-mini model. ‘gpt-4o’ uses GPT-4o model. \n\n‘’ uses the custom NMT model tuned by customer.\n‘best’ system determines which is the best model to use for the request. This intelligence could be introduced\nin future. Customer should have deployed it in their resource.\n", + "default": "general" + }, + "allowFallback": { + "type": "boolean", + "description": "In the case where a custom system is being used, specifies that the service is allowed to fall back to a\ngeneral system when a custom system doesn't exist. \nIn the case where a Large Language Model is being used, specifies that the service is allowed to fall\nback to a Small Language Model if an error occurs.\nPossible values are: true (default) or false.\n\nallowFallback=false specifies that the translation should only use systems trained for the category specified \nby the request. If a translation for language X to language Y requires chaining through a pivot language E, \nthen all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. \nIf no system is found with the specific category, the request will return a 400 status code. allowFallback=true \nspecifies that the service is allowed to fall back to a general system when a custom system doesn't exist.", + "default": true + }, + "grade": { + "type": "string", + "description": "Defines complexity of LLM prompts to provide high accuracy translation.", + "default": "basic" + }, + "tone": { + "type": "string", + "description": "Desired tone of target translation. Default is 'informal'", + "default": "informal" + }, + "gender": { + "type": "string", + "description": "Desired gender of target translation.", + "default": "neutral" + }, + "adaptiveDatasetIds": { + "type": "array", + "description": "Reference dataset ID having sentence pair to generate adaptive customized translation.", + "items": { + "type": "string" + } + }, + "referenceTextPairs": { + "type": "array", + "description": "Reference sentence pairs to generate adaptive results.", + "maxItems": 5, + "items": { + "$ref": "#/definitions/ReferenceSentencePair" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "language" + ] + }, + "TranslatedTextItem": { + "type": "object", + "description": "Element containing the translated text", + "properties": { + "detectedLanguage": { + "$ref": "#/definitions/DetectedLanguage", + "description": "The detectedLanguage property is only present in the result object when language auto-detection is requested." + }, + "translations": { + "type": "array", + "description": "An array of translation results. The size of the array matches the number of target \nlanguages specified through the to query parameter.", + "items": { + "$ref": "#/definitions/TranslationText" + }, + "x-ms-identifiers": [] + }, + "sourceText": { + "$ref": "#/definitions/SourceText", + "description": "Input text in the default script of the source language. sourceText property is present only when \nthe input is expressed in a script that's not the usual script for the language. For example, \nif the input were Arabic written in Latin script, then sourceText.text would be the same Arabic text \nconverted into Arab script." + } + }, + "required": [ + "translations" + ] + }, + "TranslationLanguage": { + "type": "object", + "description": "The value of the translation property is a dictionary of (key, value) pairs. Each key is a BCP 47 language tag.\nA key identifies a language for which text can be translated to or translated from.", + "properties": { + "name": { + "type": "string", + "description": "Display name of the language in the locale requested via Accept-Language header." + }, + "nativeName": { + "type": "string", + "description": "Display name of the language in the locale native for this language." + }, + "dir": { + "$ref": "#/definitions/LanguageDirectionality", + "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." + } + }, + "required": [ + "name", + "nativeName", + "dir" + ] + }, + "TranslationResult": { + "type": "object", + "description": "Response for the translation API.", + "properties": { + "result": { + "type": "array", + "description": "Array of the translated text elements.", + "items": { + "$ref": "#/definitions/TranslatedTextItem" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "result" + ] + }, + "TranslationText": { + "type": "object", + "description": "Translation result", + "properties": { + "to": { + "type": "string", + "description": "A string representing the language code of the target language." + }, + "text": { + "type": "string", + "description": "A string giving the translated text." + }, + "transliteration": { + "$ref": "#/definitions/TransliteratedText", + "description": "An object giving the translated text in the script specified by the toScript parameter." + } + }, + "required": [ + "to", + "text" + ] + }, + "TransliterableScript": { + "type": "object", + "description": "Script definition with list of script into which given script can be translitered.", + "properties": { + "toScripts": { + "type": "array", + "description": "List of scripts available to convert text to.", + "items": { + "$ref": "#/definitions/LanguageScript" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "toScripts" + ], + "allOf": [ + { + "$ref": "#/definitions/LanguageScript" + } + ] + }, + "TransliterateResult": { + "type": "object", + "description": "Response for the transliteration API.", + "properties": { + "result": { + "type": "array", + "description": "Array of transliterated texts", + "items": { + "$ref": "#/definitions/TransliteratedText" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "result" + ] + }, + "TransliteratedText": { + "type": "object", + "description": "Transliterated text element.", + "properties": { + "text": { + "type": "string", + "description": "A string which is the result of converting the input string to the output script." + }, + "script": { + "type": "string", + "description": "A string specifying the script used in the output." + } + }, + "required": [ + "text", + "script" + ] + }, + "TransliterationLanguage": { + "type": "object", + "description": "The value of the transliteration property is a dictionary of (key, value) pairs. \nEach key is a BCP 47 language tag. A key identifies a language for which text can be converted from one script \nto another script.", + "properties": { + "name": { + "type": "string", + "description": "Display name of the language in the locale requested via Accept-Language header." + }, + "nativeName": { + "type": "string", + "description": "Display name of the language in the locale native for this language." + }, + "scripts": { + "type": "array", + "description": "List of scripts to convert from.", + "items": { + "$ref": "#/definitions/TransliterableScript" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "name", + "nativeName", + "scripts" + ] + } + }, + "parameters": { + "GetSupportedLanguagesParameters.acceptLanguage": { + "name": "Accept-Language", + "in": "header", + "description": "The language to use for user interface strings. Some of the fields in the response are names of languages or \nnames of regions. Use this parameter to define the language in which these names are returned. \nThe language is specified by providing a well-formed BCP 47 language tag. For instance, use the value `fr` \nto request names in French or use the value `zh-Hant` to request names in Chinese Traditional.\nNames are provided in the English language when a target language is not specified or when localization \nis not available.", + "required": false, + "type": "string", + "default": "en", + "x-ms-parameter-location": "method", + "x-ms-client-name": "acceptLanguage" + }, + "GetSupportedLanguagesParameters.ifNoneMatch": { + "name": "If-None-Match", + "in": "header", + "description": "Passing the value of the ETag response header in an If-None-Match field will allow the service to optimize the response. \nIf the resource has not been modified, the service will return status code 304 and an empty response body.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-client-name": "ifNoneMatch" + }, + "GetSupportedLanguagesParameters.scope": { + "name": "scope", + "in": "query", + "description": "A comma-separated list of names defining the group of languages to return.\nAllowed group names are: `translation`, `transliteration` and `dictionary`.\nIf no scope is given, then all groups are returned, which is equivalent to passing \n`scope=translation,transliteration,dictionary`. To decide which set of supported languages \nis appropriate for your scenario, see the description of the [response object](#response-body).", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.allowFallback": { + "name": "allowFallback", + "in": "query", + "description": "Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. \nPossible values are: true (default) or false.\n\nallowFallback=false specifies that the translation should only use systems trained for the category specified \nby the request. If a translation for language X to language Y requires chaining through a pivot language E, \nthen all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. \nIf no system is found with the specific category, the request will return a 400 status code. allowFallback=true \nspecifies that the service is allowed to fall back to a general system when a custom system doesn't exist.", + "required": false, + "type": "boolean", + "default": true, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.category": { + "name": "category", + "in": "query", + "description": "A string specifying the category (domain) of the translation. This parameter is used to get translations \nfrom a customized system built with Custom Translator. Add the Category ID from your Custom Translator \nproject details to this parameter to use your deployed customized system. Default value is: general.", + "required": false, + "type": "string", + "default": "general", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.from": { + "name": "from", + "in": "query", + "description": "Specifies the language of the input text. Find which languages are available to translate from by \nlooking up supported languages using the translation scope. If the from parameter isn't specified, \nautomatic language detection is applied to determine the source language.\n\nYou must use the from parameter rather than autodetection when using the dynamic dictionary feature. \nNote: the dynamic dictionary feature is case-sensitive.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.fromScript": { + "name": "fromScript", + "in": "query", + "description": "Specifies the script of the input text.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.includeAlignment": { + "name": "includeAlignment", + "in": "query", + "description": "Specifies whether to include alignment projection from source text to translated text.\nPossible values are: true or false (default).", + "required": false, + "type": "boolean", + "default": false, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.includeSentenceLength": { + "name": "includeSentenceLength", + "in": "query", + "description": "Specifies whether to include sentence boundaries for the input text and the translated text.\nPossible values are: true or false (default).", + "required": false, + "type": "boolean", + "default": false, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.profanityAction": { + "name": "profanityAction", + "in": "query", + "description": "Specifies how profanities should be treated in translations.\nPossible values are: NoAction (default), Marked or Deleted.", + "required": false, + "type": "string", + "default": "NoAction", + "enum": [ + "NoAction", + "Marked", + "Deleted" + ], + "x-ms-enum": { + "name": "ProfanityAction", + "modelAsString": false, + "values": [ + { + "name": "NoAction", + "value": "NoAction", + "description": "No Action is taken on profanity" + }, + { + "name": "Marked", + "value": "Marked", + "description": "Profanity is marked." + }, + { + "name": "Deleted", + "value": "Deleted", + "description": "Profanity is deleted from the translated text." + } + ] + }, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.profanityMarker": { + "name": "profanityMarker", + "in": "query", + "description": "Specifies how profanities should be marked in translations.\nPossible values are: Asterisk (default) or Tag. ", + "required": false, + "type": "string", + "default": "Asterisk", + "enum": [ + "Asterisk", + "Tag" + ], + "x-ms-enum": { + "name": "ProfanityMarker", + "modelAsString": false, + "values": [ + { + "name": "Asterisk", + "value": "Asterisk", + "description": "Profanity is marked with asterisk." + }, + { + "name": "Tag", + "value": "Tag", + "description": "Profanity is marked with the tags." + } + ] + }, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.suggestedFrom": { + "name": "suggestedFrom", + "in": "query", + "description": "Specifies a fallback language if the language of the input text can't be identified. \nLanguage autodetection is applied when the from parameter is omitted. If detection fails, \nthe suggestedFrom language will be assumed.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.textType": { + "name": "textType", + "in": "query", + "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", + "required": false, + "type": "string", + "default": "Plain", + "enum": [ + "Plain", + "Html" + ], + "x-ms-enum": { + "name": "TextType", + "modelAsString": true, + "values": [ + { + "name": "Plain", + "value": "Plain", + "description": "Plain text." + }, + { + "name": "Html", + "value": "Html", + "description": "HTML-encoded text." + } + ] + }, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.to": { + "name": "to", + "in": "query", + "description": "Specifies the language of the output text. The target language must be one of the supported languages included \nin the translation scope. For example, use to=de to translate to German.\nIt's possible to translate to multiple languages simultaneously by repeating the parameter in the query string. \nFor example, use to=de&to=it to translate to German and Italian.", + "required": true, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.toScript": { + "name": "toScript", + "in": "query", + "description": "Specifies the script of the translated text.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "TransliterateParameters.fromScript": { + "name": "fromScript", + "in": "query", + "description": "Specifies the script used by the input text. Look up supported languages using the transliteration scope,\nto find input scripts available for the selected language.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "TransliterateParameters.language": { + "name": "language", + "in": "query", + "description": "Specifies the language of the text to convert from one script to another. \nPossible languages are listed in the transliteration scope obtained by querying the service \nfor its supported languages.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "TransliterateParameters.toScript": { + "name": "toScript", + "in": "query", + "description": "Specifies the output script. Look up supported languages using the transliteration scope, to find output \nscripts available for the selected combination of input language and input script.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + } + } +} From 20e3a7a6095a3a8681cea4ae7491e9194acdaf8f Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Thu, 10 Apr 2025 19:06:42 -0700 Subject: [PATCH 020/119] Fix examples in preview --- ...FindSentenceBoundaries_MaximumSet_Gen.json | 28 ------ ...FindSentenceBoundaries_MinimumSet_Gen.json | 29 ------- .../GetSupportedLanguages_MaximumSet_Gen.json | 2 +- .../GetSupportedLanguages_MinimumSet_Gen.json | 2 +- ...ookupDictionaryEntries_MaximumSet_Gen.json | 87 ------------------- ...ookupDictionaryEntries_MinimumSet_Gen.json | 86 ------------------ ...okupDictionaryExamples_MaximumSet_Gen.json | 44 ---------- ...okupDictionaryExamples_MinimumSet_Gen.json | 43 --------- .../Transliterate_MaximumSet_Gen.json | 2 +- .../Transliterate_MinimumSet_Gen.json | 2 +- 10 files changed, 4 insertions(+), 321 deletions(-) delete mode 100644 specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/FindSentenceBoundaries_MaximumSet_Gen.json delete mode 100644 specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/FindSentenceBoundaries_MinimumSet_Gen.json delete mode 100644 specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryEntries_MaximumSet_Gen.json delete mode 100644 specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryEntries_MinimumSet_Gen.json delete mode 100644 specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryExamples_MaximumSet_Gen.json delete mode 100644 specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryExamples_MinimumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/FindSentenceBoundaries_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/FindSentenceBoundaries_MaximumSet_Gen.json deleted file mode 100644 index 1847c3f5e3d3..000000000000 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/FindSentenceBoundaries_MaximumSet_Gen.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "title": "Find Sentence Boundaries", - "operationId": "FindSentenceBoundaries", - "parameters": { - "X-ClientTraceId": "svun", - "language": "en", - "script": "Latn", - "api-version": "3.0", - "body": [ - { - "text": "How are you? I am fine. What did you do today?" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "sentLen": [ - 13, - 11, - 22 - ] - } - ] - } - } -} diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/FindSentenceBoundaries_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/FindSentenceBoundaries_MinimumSet_Gen.json deleted file mode 100644 index 4175072f8566..000000000000 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/FindSentenceBoundaries_MinimumSet_Gen.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "title": "Find Sentence Boundaries with minimum properties", - "operationId": "FindSentenceBoundaries", - "parameters": { - "api-version": "3.0", - "body": [ - { - "text": "How are you? I am fine. What did you do today?" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "detectedLanguage": { - "language": "en", - "score": 1.0 - }, - "sentLen": [ - 13, - 11, - 22 - ] - } - ] - } - } -} diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MaximumSet_Gen.json index 0fdb83142178..a766b8f0f5c4 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MaximumSet_Gen.json @@ -6,7 +6,7 @@ "scope": "translation,transliteration,dictionary", "Accept-Language": "en", "If-None-Match": "fpnhruttllvc", - "api-version": "3.0" + "api-version": "2025-05-01-preview" }, "responses": { "200": { diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MinimumSet_Gen.json index 5f8405e887d9..896d99d2697d 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MinimumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MinimumSet_Gen.json @@ -2,7 +2,7 @@ "title": "Gets the set of languages currently supported by other operations of the Translator with minimum properties.", "operationId": "GetSupportedLanguages", "parameters": { - "api-version": "3.0" + "api-version": "2025-05-01-preview" }, "responses": { "200": { diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryEntries_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryEntries_MaximumSet_Gen.json deleted file mode 100644 index 636eb73b04f6..000000000000 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryEntries_MaximumSet_Gen.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "title": "Lookup Dictionary Entries", - "operationId": "LookupDictionaryEntries", - "parameters": { - "X-ClientTraceId": "yqst", - "from": "en", - "to": "es", - "api-version": "3.0", - "body": [ - { - "text": "fly" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "normalizedSource": "fly", - "displaySource": "fly", - "translations": [ - { - "normalizedTarget": "volar", - "displayTarget": "volar", - "posTag": "VERB", - "confidence": 0.4081, - "prefixWord": "", - "backTranslations": [ - { - "normalizedText": "fly", - "displayText": "fly", - "numExamples": 15, - "frequencyCount": 4637 - }, - { - "normalizedText": "flying", - "displayText": "flying", - "numExamples": 15, - "frequencyCount": 1365 - }, - { - "normalizedText": "blow", - "displayText": "blow", - "numExamples": 15, - "frequencyCount": 503 - }, - { - "normalizedText": "flight", - "displayText": "flight", - "numExamples": 15, - "frequencyCount": 135 - } - ] - }, - { - "normalizedTarget": "mosca", - "displayTarget": "mosca", - "posTag": "NOUN", - "confidence": 0.2668, - "prefixWord": "", - "backTranslations": [ - { - "normalizedText": "fly", - "displayText": "fly", - "numExamples": 15, - "frequencyCount": 1697 - }, - { - "normalizedText": "flyweight", - "displayText": "flyweight", - "numExamples": 0, - "frequencyCount": 48 - }, - { - "normalizedText": "flies", - "displayText": "flies", - "numExamples": 9, - "frequencyCount": 34 - } - ] - } - ] - } - ] - } - } -} diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryEntries_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryEntries_MinimumSet_Gen.json deleted file mode 100644 index dfc24a03bdea..000000000000 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryEntries_MinimumSet_Gen.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "title": "Lookup Dictionary Entries with minimum properties", - "operationId": "LookupDictionaryEntries", - "parameters": { - "from": "en", - "to": "es", - "api-version": "3.0", - "body": [ - { - "text": "fly" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "normalizedSource": "fly", - "displaySource": "fly", - "translations": [ - { - "normalizedTarget": "volar", - "displayTarget": "volar", - "posTag": "VERB", - "confidence": 0.4081, - "prefixWord": "", - "backTranslations": [ - { - "normalizedText": "fly", - "displayText": "fly", - "numExamples": 15, - "frequencyCount": 4637 - }, - { - "normalizedText": "flying", - "displayText": "flying", - "numExamples": 15, - "frequencyCount": 1365 - }, - { - "normalizedText": "blow", - "displayText": "blow", - "numExamples": 15, - "frequencyCount": 503 - }, - { - "normalizedText": "flight", - "displayText": "flight", - "numExamples": 15, - "frequencyCount": 135 - } - ] - }, - { - "normalizedTarget": "mosca", - "displayTarget": "mosca", - "posTag": "NOUN", - "confidence": 0.2668, - "prefixWord": "", - "backTranslations": [ - { - "normalizedText": "fly", - "displayText": "fly", - "numExamples": 15, - "frequencyCount": 1697 - }, - { - "normalizedText": "flyweight", - "displayText": "flyweight", - "numExamples": 0, - "frequencyCount": 48 - }, - { - "normalizedText": "flies", - "displayText": "flies", - "numExamples": 9, - "frequencyCount": 34 - } - ] - } - ] - } - ] - } - } -} diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryExamples_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryExamples_MaximumSet_Gen.json deleted file mode 100644 index 00c751e3e39c..000000000000 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryExamples_MaximumSet_Gen.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "title": "Lookup Dictionary Examples", - "operationId": "LookupDictionaryExamples", - "parameters": { - "X-ClientTraceId": "vykwwekvcncclrmsyjhbok", - "from": "en", - "to": "es", - "api-version": "3.0", - "body": [ - { - "text": "fly", - "translation": "volar" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "normalizedSource": "fly", - "normalizedTarget": "volar", - "examples": [ - { - "sourcePrefix": "They need machines to ", - "sourceTerm": "fly", - "sourceSuffix": ".", - "targetPrefix": "Necesitan máquinas para ", - "targetTerm": "volar", - "targetSuffix": "." - }, - { - "sourcePrefix": "That should really ", - "sourceTerm": "fly", - "sourceSuffix": ".", - "targetPrefix": "Eso realmente debe ", - "targetTerm": "volar", - "targetSuffix": "." - } - ] - } - ] - } - } -} diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryExamples_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryExamples_MinimumSet_Gen.json deleted file mode 100644 index 7f2b08865c25..000000000000 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/LookupDictionaryExamples_MinimumSet_Gen.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "title": "Lookup Dictionary Examples with minimum properties", - "operationId": "LookupDictionaryExamples", - "parameters": { - "from": "en", - "to": "es", - "api-version": "3.0", - "body": [ - { - "text": "fly", - "translation": "volar" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "normalizedSource": "fly", - "normalizedTarget": "volar", - "examples": [ - { - "sourcePrefix": "They need machines to ", - "sourceTerm": "fly", - "sourceSuffix": ".", - "targetPrefix": "Necesitan máquinas para ", - "targetTerm": "volar", - "targetSuffix": "." - }, - { - "sourcePrefix": "That should really ", - "sourceTerm": "fly", - "sourceSuffix": ".", - "targetPrefix": "Eso realmente debe ", - "targetTerm": "volar", - "targetSuffix": "." - } - ] - } - ] - } - } -} diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Transliterate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Transliterate_MaximumSet_Gen.json index 92f67b4a62d3..2c0351db37bc 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Transliterate_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Transliterate_MaximumSet_Gen.json @@ -6,7 +6,7 @@ "language": "zh-Hans", "fromScript": "Hans", "toScript": "Latn", - "api-version": "3.0", + "api-version": "2025-05-01-preview", "body": [ { "text": "这是个测试。" diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Transliterate_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Transliterate_MinimumSet_Gen.json index 24c5aee2ffb1..3ae984cdc33c 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Transliterate_MinimumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Transliterate_MinimumSet_Gen.json @@ -5,7 +5,7 @@ "language": "zh-Hans", "fromScript": "Hans", "toScript": "Latn", - "api-version": "3.0", + "api-version": "2025-05-01-preview", "body": [ { "text": "这是个测试。" From 9a370c7d793195f568208f1c28ac57a2fe9d3234 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 11 Apr 2025 10:55:41 -0700 Subject: [PATCH 021/119] Fix examples in preview --- .../examples/GetSupportedLanguages_MaximumSet_Gen.json | 2 +- .../examples/GetSupportedLanguages_MinimumSet_Gen.json | 2 +- .../examples/Transliterate_MaximumSet_Gen.json | 2 +- .../examples/Transliterate_MinimumSet_Gen.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MaximumSet_Gen.json index 0fdb83142178..a766b8f0f5c4 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MaximumSet_Gen.json @@ -6,7 +6,7 @@ "scope": "translation,transliteration,dictionary", "Accept-Language": "en", "If-None-Match": "fpnhruttllvc", - "api-version": "3.0" + "api-version": "2025-05-01-preview" }, "responses": { "200": { diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MinimumSet_Gen.json index 5f8405e887d9..896d99d2697d 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MinimumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MinimumSet_Gen.json @@ -2,7 +2,7 @@ "title": "Gets the set of languages currently supported by other operations of the Translator with minimum properties.", "operationId": "GetSupportedLanguages", "parameters": { - "api-version": "3.0" + "api-version": "2025-05-01-preview" }, "responses": { "200": { diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json index 92f67b4a62d3..2c0351db37bc 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json @@ -6,7 +6,7 @@ "language": "zh-Hans", "fromScript": "Hans", "toScript": "Latn", - "api-version": "3.0", + "api-version": "2025-05-01-preview", "body": [ { "text": "这是个测试。" diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json index 24c5aee2ffb1..3ae984cdc33c 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json @@ -5,7 +5,7 @@ "language": "zh-Hans", "fromScript": "Hans", "toScript": "Latn", - "api-version": "3.0", + "api-version": "2025-05-01-preview", "body": [ { "text": "这是个测试。" From e8a1d7ecce1db8a75e23ebd4b474fdcc10b04340 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 11 Apr 2025 11:41:49 -0700 Subject: [PATCH 022/119] Fix examples in preview --- .../Translate_MaximumSet_Gen.json | 11 ---- .../models-translate.tsp | 43 +++++++++++++++ .../examples/Translate_MaximumSet_Gen.json | 11 ---- .../stable/3.0/openapi.json | 54 ++++++++++++++++--- 4 files changed, 91 insertions(+), 28 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json index 9453cd03b29b..98a98ab9f39e 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json @@ -50,17 +50,6 @@ "transliteration": { "text": "Tohle je test.", "script": "Latn" - }, - "alignment": { - "proj": "okrxvzsagjgzrrv" - }, - "sentLen": { - "srcSentLen": [ - 30 - ], - "transSentLen": [ - 24 - ] } } ], diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index b8767b3a0e79..173a2110c4e4 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -241,6 +241,7 @@ model TranslateBodyDetails { """) textType?: TextType = "Plain"; + @added(APIVersion.v2025_05_01_preview) @doc(""" Translation target parameters. """) @@ -365,6 +366,48 @@ model TranslationText { An object giving the translated text in the script specified by the toScript parameter. """) transliteration?: TransliteratedText; + + @removed(APIVersion.v2025_05_01_preview) + @doc(""" + Alignment information. + """) + alignment?: TranslatedTextAlignment; + + @removed(APIVersion.v2025_05_01_preview) + @doc(""" + Sentence boundaries in the input and output texts. + """) + sentLen?: SentenceBoundaries; +} + +@removed(APIVersion.v2025_05_01_preview) +@doc("Alignment information object.") +model TranslatedTextAlignment { + @doc(""" + Maps input text to translated text. The alignment information is only provided when the request + parameter includeAlignment is true. Alignment is returned as a string value of the following + format: [[SourceTextStartIndex]:[SourceTextEndIndex]–[TgtTextStartIndex]:[TgtTextEndIndex]]. + The colon separates start and end index, the dash separates the languages, and space separates the words. + One word may align with zero, one, or multiple words in the other language, and the aligned words may + be non-contiguous. When no alignment information is available, the alignment element will be empty. + """) + proj: string; +} + +@removed(APIVersion.v2025_05_01_preview) +@doc("An object returning sentence boundaries in the input and output texts.") +model SentenceBoundaries { + @doc(""" + An integer array representing the lengths of the sentences in the input text. + The length of the array is the number of sentences, and the values are the length of each sentence. + """) + srcSentLen: int32[]; + + @doc(""" + An integer array representing the lengths of the sentences in the translated text. + The length of the array is the number of sentences, and the values are the length of each sentence. + """) + transSentLen: int32[]; } @doc("Input text in the default script of the source language. ") diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json index 9453cd03b29b..98a98ab9f39e 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json @@ -50,17 +50,6 @@ "transliteration": { "text": "Tohle je test.", "script": "Latn" - }, - "alignment": { - "proj": "okrxvzsagjgzrrv" - }, - "sentLen": { - "srcSentLen": [ - 30 - ], - "transSentLen": [ - 24 - ] } } ], diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json index 7e55886f254a..be95e2c1ff1a 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json @@ -531,6 +531,32 @@ "referenceTextPairsTarget" ] }, + "SentenceBoundaries": { + "type": "object", + "description": "An object returning sentence boundaries in the input and output texts.", + "properties": { + "srcSentLen": { + "type": "array", + "description": "An integer array representing the lengths of the sentences in the input text. \nThe length of the array is the number of sentences, and the values are the length of each sentence.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "transSentLen": { + "type": "array", + "description": "An integer array representing the lengths of the sentences in the translated text. \nThe length of the array is the number of sentences, and the values are the length of each sentence.", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + "required": [ + "srcSentLen", + "transSentLen" + ] + }, "SourceDictionaryLanguage": { "type": "object", "description": "Properties ot the source dictionary language", @@ -668,15 +694,10 @@ } ] } - }, - "targets": { - "$ref": "#/definitions/TranslateTarget", - "description": "Translation target parameters." } }, "required": [ - "text", - "targets" + "text" ] }, "TranslateBodyParameters": { @@ -809,6 +830,19 @@ "language" ] }, + "TranslatedTextAlignment": { + "type": "object", + "description": "Alignment information object.", + "properties": { + "proj": { + "type": "string", + "description": "Maps input text to translated text. The alignment information is only provided when the request \nparameter includeAlignment is true. Alignment is returned as a string value of the following \nformat: [[SourceTextStartIndex]:[SourceTextEndIndex]–[TgtTextStartIndex]:[TgtTextEndIndex]]. \nThe colon separates start and end index, the dash separates the languages, and space separates the words. \nOne word may align with zero, one, or multiple words in the other language, and the aligned words may \nbe non-contiguous. When no alignment information is available, the alignment element will be empty." + } + }, + "required": [ + "proj" + ] + }, "TranslatedTextItem": { "type": "object", "description": "Element containing the translated text", @@ -889,6 +923,14 @@ "transliteration": { "$ref": "#/definitions/TransliteratedText", "description": "An object giving the translated text in the script specified by the toScript parameter." + }, + "alignment": { + "$ref": "#/definitions/TranslatedTextAlignment", + "description": "Alignment information." + }, + "sentLen": { + "$ref": "#/definitions/SentenceBoundaries", + "description": "Sentence boundaries in the input and output texts." } }, "required": [ From 98a53689501c4bedd3c9dcd50541019add542f67 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 11 Apr 2025 14:06:48 -0700 Subject: [PATCH 023/119] Fix examples in preview --- .../translation/data-plane/Azure.AI.TextTranslation/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md index 6c5b6011cad1..a68c2941053c 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md @@ -18,7 +18,7 @@ openapi-type: data-plane These settings apply only when `--tag=release_3_0` is specified on the command line. ``` yaml $(tag) == 'release_3_0' -input-file: stable/v3.0/openapi.json +input-file: stable/3.0/openapi.json ``` ## Multi-API/Profile support for AutoRest v3 generators @@ -33,7 +33,7 @@ require: $(this-folder)/../../../../profiles/readme.md # all the input files across all versions input-file: - - $(this-folder)/stable/v3.0/openapi.json + - $(this-folder)/stable/3.0/openapi.json ``` If there are files that should not be in the `all-api-versions` set, From 429b89c940c5ec166abdbeb7ffceef830c6a60e8 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 11 Apr 2025 14:28:50 -0700 Subject: [PATCH 024/119] Fix examples in preview --- .../data-plane/Azure.AI.TextTranslation/readme.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md index a68c2941053c..f6a4aeca29da 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md @@ -4,10 +4,10 @@ Configuration for generating Translation Text SDK. -The current release is `release_3_0`. +The current release is `package-2025-05-01-preview`. ``` yaml -tag: release_3_0 +tag: package-2025-05-01-preview add-credentials: true openapi-type: data-plane ``` @@ -21,6 +21,15 @@ These settings apply only when `--tag=release_3_0` is specified on the command l input-file: stable/3.0/openapi.json ``` +### Release 2025-05-01-preview +These settings apply only when `--tag=package-2025-05-01-preview` is specified on the command line. + +``` yaml $(tag) == 'package-2025-05-01-preview' +version: package-2025-05-01-preview +input-file: + - preview/2025-05-01-preview/openapi.json +``` + ## Multi-API/Profile support for AutoRest v3 generators AutoRest V3 generators require the use of `--tag=all-api-versions` to select api files. From e06c1299760246062ecffce42f5e35c4d80e2a76 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 11 Apr 2025 14:31:53 -0700 Subject: [PATCH 025/119] Fix examples in preview --- .../translation/data-plane/Azure.AI.TextTranslation/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md index f6a4aeca29da..66a3dd352bc3 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md @@ -43,6 +43,7 @@ require: $(this-folder)/../../../../profiles/readme.md # all the input files across all versions input-file: - $(this-folder)/stable/3.0/openapi.json + - $(this-folder)/preview/2025-05-01-preview/openapi.json ``` If there are files that should not be in the `all-api-versions` set, From 114af2dc013164292d8f5eaeb6d13b9a5785bea2 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 11 Apr 2025 14:54:30 -0700 Subject: [PATCH 026/119] Fix examples --- ...FindSentenceBoundaries_MaximumSet_Gen.json | 28 ------ ...FindSentenceBoundaries_MinimumSet_Gen.json | 29 ------- .../GetSupportedLanguages_MaximumSet_Gen.json | 80 ----------------- .../GetSupportedLanguages_MinimumSet_Gen.json | 12 --- ...ookupDictionaryEntries_MaximumSet_Gen.json | 87 ------------------- ...ookupDictionaryEntries_MinimumSet_Gen.json | 86 ------------------ ...okupDictionaryExamples_MaximumSet_Gen.json | 44 ---------- ...okupDictionaryExamples_MinimumSet_Gen.json | 43 --------- .../examples/Translate_MaximumSet_Gen.json | 63 -------------- .../examples/Translate_MinimumSet_Gen.json | 29 ------- .../Transliterate_MaximumSet_Gen.json | 26 ------ .../Transliterate_MinimumSet_Gen.json | 25 ------ 12 files changed, 552 deletions(-) delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MaximumSet_Gen.json delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MaximumSet_Gen.json delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MinimumSet_Gen.json delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MaximumSet_Gen.json delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MaximumSet_Gen.json delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MaximumSet_Gen.json delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MinimumSet_Gen.json delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MaximumSet_Gen.json delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MinimumSet_Gen.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MaximumSet_Gen.json deleted file mode 100644 index 1847c3f5e3d3..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MaximumSet_Gen.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "title": "Find Sentence Boundaries", - "operationId": "FindSentenceBoundaries", - "parameters": { - "X-ClientTraceId": "svun", - "language": "en", - "script": "Latn", - "api-version": "3.0", - "body": [ - { - "text": "How are you? I am fine. What did you do today?" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "sentLen": [ - 13, - 11, - 22 - ] - } - ] - } - } -} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json deleted file mode 100644 index 4175072f8566..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "title": "Find Sentence Boundaries with minimum properties", - "operationId": "FindSentenceBoundaries", - "parameters": { - "api-version": "3.0", - "body": [ - { - "text": "How are you? I am fine. What did you do today?" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "detectedLanguage": { - "language": "en", - "score": 1.0 - }, - "sentLen": [ - 13, - 11, - 22 - ] - } - ] - } - } -} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MaximumSet_Gen.json deleted file mode 100644 index 0fdb83142178..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MaximumSet_Gen.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "title": "Gets the set of languages currently supported by other operations of the Translator.", - "operationId": "GetSupportedLanguages", - "parameters": { - "X-ClientTraceId": "kayfnugjec", - "scope": "translation,transliteration,dictionary", - "Accept-Language": "en", - "If-None-Match": "fpnhruttllvc", - "api-version": "3.0" - }, - "responses": { - "200": { - "body": { - "translation": { - "en": { - "name": "English", - "nativeName": "English", - "dir": "ltr" - }, - "es": { - "name": "Spanish", - "nativeName": "Español", - "dir": "ltr" - } - }, - "transliteration": { - "ar": { - "name": "Arabic", - "nativeName": "العربية", - "scripts": [ - { - "code": "Arab", - "name": "Arabic", - "nativeName": "العربية", - "dir": "rtl", - "toScripts": [ - { - "code": "Latn", - "name": "Latin", - "nativeName": "اللاتينية", - "dir": "ltr" - } - ] - }, - { - "code": "Latn", - "name": "Latin", - "nativeName": "اللاتينية", - "dir": "ltr", - "toScripts": [ - { - "code": "Arab", - "name": "Arabic", - "nativeName": "العربية", - "dir": "rtl" - } - ] - } - ] - } - }, - "dictionary": { - "cs": { - "name": "Czech", - "nativeName": "Čeština", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - } - } - } - } - } -} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MinimumSet_Gen.json deleted file mode 100644 index 5f8405e887d9..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MinimumSet_Gen.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "title": "Gets the set of languages currently supported by other operations of the Translator with minimum properties.", - "operationId": "GetSupportedLanguages", - "parameters": { - "api-version": "3.0" - }, - "responses": { - "200": { - "body": {} - } - } -} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MaximumSet_Gen.json deleted file mode 100644 index 636eb73b04f6..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MaximumSet_Gen.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "title": "Lookup Dictionary Entries", - "operationId": "LookupDictionaryEntries", - "parameters": { - "X-ClientTraceId": "yqst", - "from": "en", - "to": "es", - "api-version": "3.0", - "body": [ - { - "text": "fly" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "normalizedSource": "fly", - "displaySource": "fly", - "translations": [ - { - "normalizedTarget": "volar", - "displayTarget": "volar", - "posTag": "VERB", - "confidence": 0.4081, - "prefixWord": "", - "backTranslations": [ - { - "normalizedText": "fly", - "displayText": "fly", - "numExamples": 15, - "frequencyCount": 4637 - }, - { - "normalizedText": "flying", - "displayText": "flying", - "numExamples": 15, - "frequencyCount": 1365 - }, - { - "normalizedText": "blow", - "displayText": "blow", - "numExamples": 15, - "frequencyCount": 503 - }, - { - "normalizedText": "flight", - "displayText": "flight", - "numExamples": 15, - "frequencyCount": 135 - } - ] - }, - { - "normalizedTarget": "mosca", - "displayTarget": "mosca", - "posTag": "NOUN", - "confidence": 0.2668, - "prefixWord": "", - "backTranslations": [ - { - "normalizedText": "fly", - "displayText": "fly", - "numExamples": 15, - "frequencyCount": 1697 - }, - { - "normalizedText": "flyweight", - "displayText": "flyweight", - "numExamples": 0, - "frequencyCount": 48 - }, - { - "normalizedText": "flies", - "displayText": "flies", - "numExamples": 9, - "frequencyCount": 34 - } - ] - } - ] - } - ] - } - } -} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json deleted file mode 100644 index dfc24a03bdea..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "title": "Lookup Dictionary Entries with minimum properties", - "operationId": "LookupDictionaryEntries", - "parameters": { - "from": "en", - "to": "es", - "api-version": "3.0", - "body": [ - { - "text": "fly" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "normalizedSource": "fly", - "displaySource": "fly", - "translations": [ - { - "normalizedTarget": "volar", - "displayTarget": "volar", - "posTag": "VERB", - "confidence": 0.4081, - "prefixWord": "", - "backTranslations": [ - { - "normalizedText": "fly", - "displayText": "fly", - "numExamples": 15, - "frequencyCount": 4637 - }, - { - "normalizedText": "flying", - "displayText": "flying", - "numExamples": 15, - "frequencyCount": 1365 - }, - { - "normalizedText": "blow", - "displayText": "blow", - "numExamples": 15, - "frequencyCount": 503 - }, - { - "normalizedText": "flight", - "displayText": "flight", - "numExamples": 15, - "frequencyCount": 135 - } - ] - }, - { - "normalizedTarget": "mosca", - "displayTarget": "mosca", - "posTag": "NOUN", - "confidence": 0.2668, - "prefixWord": "", - "backTranslations": [ - { - "normalizedText": "fly", - "displayText": "fly", - "numExamples": 15, - "frequencyCount": 1697 - }, - { - "normalizedText": "flyweight", - "displayText": "flyweight", - "numExamples": 0, - "frequencyCount": 48 - }, - { - "normalizedText": "flies", - "displayText": "flies", - "numExamples": 9, - "frequencyCount": 34 - } - ] - } - ] - } - ] - } - } -} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MaximumSet_Gen.json deleted file mode 100644 index 00c751e3e39c..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MaximumSet_Gen.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "title": "Lookup Dictionary Examples", - "operationId": "LookupDictionaryExamples", - "parameters": { - "X-ClientTraceId": "vykwwekvcncclrmsyjhbok", - "from": "en", - "to": "es", - "api-version": "3.0", - "body": [ - { - "text": "fly", - "translation": "volar" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "normalizedSource": "fly", - "normalizedTarget": "volar", - "examples": [ - { - "sourcePrefix": "They need machines to ", - "sourceTerm": "fly", - "sourceSuffix": ".", - "targetPrefix": "Necesitan máquinas para ", - "targetTerm": "volar", - "targetSuffix": "." - }, - { - "sourcePrefix": "That should really ", - "sourceTerm": "fly", - "sourceSuffix": ".", - "targetPrefix": "Eso realmente debe ", - "targetTerm": "volar", - "targetSuffix": "." - } - ] - } - ] - } - } -} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json deleted file mode 100644 index 7f2b08865c25..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "title": "Lookup Dictionary Examples with minimum properties", - "operationId": "LookupDictionaryExamples", - "parameters": { - "from": "en", - "to": "es", - "api-version": "3.0", - "body": [ - { - "text": "fly", - "translation": "volar" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "normalizedSource": "fly", - "normalizedTarget": "volar", - "examples": [ - { - "sourcePrefix": "They need machines to ", - "sourceTerm": "fly", - "sourceSuffix": ".", - "targetPrefix": "Necesitan máquinas para ", - "targetTerm": "volar", - "targetSuffix": "." - }, - { - "sourcePrefix": "That should really ", - "sourceTerm": "fly", - "sourceSuffix": ".", - "targetPrefix": "Eso realmente debe ", - "targetTerm": "volar", - "targetSuffix": "." - } - ] - } - ] - } - } -} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MaximumSet_Gen.json deleted file mode 100644 index 06f74471d1df..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MaximumSet_Gen.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "title": "Translate Text", - "operationId": "Translate", - "parameters": { - "X-ClientTraceId": "ndbkaatzsnoetqkiehappoza", - "to": [ - "cs" - ], - "from": "en", - "textType": "Plain", - "category": "custom", - "profanityAction": "NoAction", - "profanityMarker": "Asterisk", - "includeAlignment": true, - "includeSentenceLength": true, - "suggestedFrom": "en", - "fromScript": "Latn", - "toScript": "Latn", - "allowFallback": true, - "api-version": "3.0", - "body": [ - { - "text": "This is a test." - } - ] - }, - "responses": { - "200": { - "body": [ - { - "detectedLanguage": { - "language": "en", - "score": 1.0 - }, - "translations": [ - { - "to": "cs", - "text": "Tohle je test.", - "transliteration": { - "text": "Tohle je test.", - "script": "Latn" - }, - "alignment": { - "proj": "okrxvzsagjgzrrv" - }, - "sentLen": { - "srcSentLen": [ - 30 - ], - "transSentLen": [ - 24 - ] - } - } - ], - "sourceText": { - "text": "This is a test" - } - } - ] - } - } -} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MinimumSet_Gen.json deleted file mode 100644 index b29982929425..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MinimumSet_Gen.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "title": "Translate Text with minimum properties", - "operationId": "Translate", - "parameters": { - "to": [ - "fmlxpuepn" - ], - "api-version": "3.0", - "body": [ - { - "text": "This is a test." - } - ] - }, - "responses": { - "200": { - "body": [ - { - "translations": [ - { - "text": "Tohle je test.", - "to": "cs" - } - ] - } - ] - } - } -} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MaximumSet_Gen.json deleted file mode 100644 index 92f67b4a62d3..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MaximumSet_Gen.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "title": "Transliterate Text", - "operationId": "Transliterate", - "parameters": { - "X-ClientTraceId": "dzncrimwmvtwjnheh", - "language": "zh-Hans", - "fromScript": "Hans", - "toScript": "Latn", - "api-version": "3.0", - "body": [ - { - "text": "这是个测试。" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "text": "zhè shì gè cè shì。", - "script": "Latn" - } - ] - } - } -} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MinimumSet_Gen.json deleted file mode 100644 index 24c5aee2ffb1..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MinimumSet_Gen.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "title": "Transliterate Text with minimum properties", - "operationId": "Transliterate", - "parameters": { - "language": "zh-Hans", - "fromScript": "Hans", - "toScript": "Latn", - "api-version": "3.0", - "body": [ - { - "text": "这是个测试。" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "text": "zhè shì gè cè shì。", - "script": "Latn" - } - ] - } - } -} From d6e1af1649826ff3772a342cf8988b7c4c4a13e5 Mon Sep 17 00:00:00 2001 From: Eugenia Date: Tue, 22 Apr 2025 16:29:30 -0700 Subject: [PATCH 027/119] Removing defaults for tone and gender fields as per API design spec --- .../Azure.AI.TextTranslation/models-translate.tsp | 6 +++--- .../preview/2025-05-01-preview/openapi.json | 6 ++---- .../Azure.AI.TextTranslation/stable/3.0/openapi.json | 6 ++---- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index 173a2110c4e4..94ae51626928 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -192,14 +192,14 @@ model TranslateTarget { grade?: string = "basic"; @doc(""" - Desired tone of target translation. Default is 'informal' + Desired tone of target translation. """) - tone?: string = "informal"; + tone?: string; @doc(""" Desired gender of target translation. """) - gender?: string = "neutral"; + gender?: string; @doc(""" Reference dataset ID having sentence pair to generate adaptive customized translation. diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json index 0918a8f7d63d..a435ac0db9b4 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json @@ -748,13 +748,11 @@ }, "tone": { "type": "string", - "description": "Desired tone of target translation. Default is 'informal'", - "default": "informal" + "description": "Desired tone of target translation." }, "gender": { "type": "string", - "description": "Desired gender of target translation.", - "default": "neutral" + "description": "Desired gender of target translation." }, "adaptiveDatasetIds": { "type": "array", diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json index be95e2c1ff1a..d7c6a77bbe01 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json @@ -801,13 +801,11 @@ }, "tone": { "type": "string", - "description": "Desired tone of target translation. Default is 'informal'", - "default": "informal" + "description": "Desired tone of target translation." }, "gender": { "type": "string", - "description": "Desired gender of target translation.", - "default": "neutral" + "description": "Desired gender of target translation." }, "adaptiveDatasetIds": { "type": "array", From e3bc44104dcb223e06b25b7c90a8699c1cdf5b0d Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Wed, 23 Apr 2025 12:13:21 -0700 Subject: [PATCH 028/119] Update targets to an array value. Rename adaptiveDatasetIds to adaptiveDatasetId and make it a string rather than an array of strings. --- .../Translate_MaximumSet_Gen.json | 44 +++++++++---------- .../Translate_MinimumSet_Gen.json | 12 ++--- .../models-translate.tsp | 4 +- 3 files changed, 31 insertions(+), 29 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json index 98a98ab9f39e..1f0f56b92ecc 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json @@ -10,28 +10,28 @@ "script": "Latn", "language": "en", "textType": "Plain", - "targets": { - "language": [ - "cs" - ], - "script": "Latn", - "profanityAction": "NoAction", - "profanityMarker": "Asterisk", - "deploymentNameModel": "general", - "allowFallback": true, - "grade": "basic", - "tone": "formal", - "gender": "neutral", - "adaptiveDatasetIds": [ - "21000" - ], - "referenceTextPairs": [ - { - "referenceTextPairsSource": "Please test this out.", - "referenceTextPairsTarget": "Vyzkoušejte si to." - } - ] - } + "targets": [ + { + "language": [ + "cs" + ], + "script": "Latn", + "profanityAction": "NoAction", + "profanityMarker": "Asterisk", + "deploymentNameModel": "general", + "allowFallback": true, + "grade": "basic", + "tone": "formal", + "gender": "neutral", + "adaptiveDatasetId": "21000", + "referenceTextPairs": [ + { + "referenceTextPairsSource": "Please test this out.", + "referenceTextPairsTarget": "Vyzkoušejte si to." + } + ] + } + ] } ] }, diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json index c8671436af34..d22bf9d8e56a 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json @@ -6,11 +6,13 @@ "body": [ { "text": "This is a test.", - "targets": { - "language": [ - "cs" - ] - } + "targets": [ + { + "language": [ + "cs" + ] + } + ] } ] }, diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index 94ae51626928..625bd6227a3d 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -204,7 +204,7 @@ model TranslateTarget { @doc(""" Reference dataset ID having sentence pair to generate adaptive customized translation. """) - adaptiveDatasetIds?: string[]; + adaptiveDatasetId?: string; @doc(""" Reference sentence pairs to generate adaptive results. @@ -245,7 +245,7 @@ model TranslateBodyDetails { @doc(""" Translation target parameters. """) - targets: TranslateTarget; + targets: TranslateTarget[]; } @doc("Reference sentence pair.") From 338c0b9805390ac1d25bc3e108c64b92b650ed06 Mon Sep 17 00:00:00 2001 From: Eugenia Date: Wed, 23 Apr 2025 22:57:47 -0700 Subject: [PATCH 029/119] Adding missing go config in tspconfig.yaml --- .../translation/Azure.AI.TextTranslation/tspconfig.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml b/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml index d3dee1570e26..a3ad30ff31cf 100644 --- a/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml +++ b/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml @@ -43,3 +43,11 @@ options: name: "@azure-rest/ai-translation-text" description: "Microsoft Translation Text" flavor: azure + "@azure-tools/typespec-go": + module: "github.com/Azure/azure-sdk-for-go/{service-dir}/{package-dir}" + service-dir: "sdk/translation" + package-dir: "azure-ai-translation-text" + generate-samples: true + generate-fakes: true + head-as-boolean: true + inject-spans: true From b82e086a4edaff6867426722b4147f864ce37fe2 Mon Sep 17 00:00:00 2001 From: Eugenia Date: Wed, 23 Apr 2025 22:58:39 -0700 Subject: [PATCH 030/119] Recompiling typespec after changes --- .../examples/Translate_MaximumSet_Gen.json | 44 +++++++++---------- .../examples/Translate_MinimumSet_Gen.json | 12 ++--- .../preview/2025-05-01-preview/openapi.json | 17 +++---- .../stable/3.0/openapi.json | 9 ++-- 4 files changed, 41 insertions(+), 41 deletions(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json index 98a98ab9f39e..1f0f56b92ecc 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json @@ -10,28 +10,28 @@ "script": "Latn", "language": "en", "textType": "Plain", - "targets": { - "language": [ - "cs" - ], - "script": "Latn", - "profanityAction": "NoAction", - "profanityMarker": "Asterisk", - "deploymentNameModel": "general", - "allowFallback": true, - "grade": "basic", - "tone": "formal", - "gender": "neutral", - "adaptiveDatasetIds": [ - "21000" - ], - "referenceTextPairs": [ - { - "referenceTextPairsSource": "Please test this out.", - "referenceTextPairsTarget": "Vyzkoušejte si to." - } - ] - } + "targets": [ + { + "language": [ + "cs" + ], + "script": "Latn", + "profanityAction": "NoAction", + "profanityMarker": "Asterisk", + "deploymentNameModel": "general", + "allowFallback": true, + "grade": "basic", + "tone": "formal", + "gender": "neutral", + "adaptiveDatasetId": "21000", + "referenceTextPairs": [ + { + "referenceTextPairsSource": "Please test this out.", + "referenceTextPairsTarget": "Vyzkoušejte si to." + } + ] + } + ] } ] }, diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json index c8671436af34..d22bf9d8e56a 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json @@ -6,11 +6,13 @@ "body": [ { "text": "This is a test.", - "targets": { - "language": [ - "cs" - ] - } + "targets": [ + { + "language": [ + "cs" + ] + } + ] } ] }, diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json index a435ac0db9b4..023b60a694fe 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json @@ -634,8 +634,12 @@ } }, "targets": { - "$ref": "#/definitions/TranslateTarget", - "description": "Translation target parameters." + "type": "array", + "description": "Translation target parameters.", + "items": { + "$ref": "#/definitions/TranslateTarget" + }, + "x-ms-identifiers": [] } }, "required": [ @@ -754,12 +758,9 @@ "type": "string", "description": "Desired gender of target translation." }, - "adaptiveDatasetIds": { - "type": "array", - "description": "Reference dataset ID having sentence pair to generate adaptive customized translation.", - "items": { - "type": "string" - } + "adaptiveDatasetId": { + "type": "string", + "description": "Reference dataset ID having sentence pair to generate adaptive customized translation." }, "referenceTextPairs": { "type": "array", diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json index d7c6a77bbe01..b9dbd031f7e9 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json @@ -807,12 +807,9 @@ "type": "string", "description": "Desired gender of target translation." }, - "adaptiveDatasetIds": { - "type": "array", - "description": "Reference dataset ID having sentence pair to generate adaptive customized translation.", - "items": { - "type": "string" - } + "adaptiveDatasetId": { + "type": "string", + "description": "Reference dataset ID having sentence pair to generate adaptive customized translation." }, "referenceTextPairs": { "type": "array", From 41fde035382d4bc74add7d093a90a4615f30ca0c Mon Sep 17 00:00:00 2001 From: Eugenia Date: Wed, 23 Apr 2025 23:06:43 -0700 Subject: [PATCH 031/119] Fixing tspconfig for Document Translator as well (TSValidation CI is checking entire /translation folder) --- .../Azure.AI.DocumentTranslation/tspconfig.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/specification/translation/Azure.AI.DocumentTranslation/tspconfig.yaml b/specification/translation/Azure.AI.DocumentTranslation/tspconfig.yaml index 496f295dcb4f..b9b51a04fdc5 100644 --- a/specification/translation/Azure.AI.DocumentTranslation/tspconfig.yaml +++ b/specification/translation/Azure.AI.DocumentTranslation/tspconfig.yaml @@ -48,3 +48,11 @@ options: description: "Microsoft Translation Document" flavor: azure generate-sample-project: false + "@azure-tools/typespec-go": + module: "github.com/Azure/azure-sdk-for-go/{service-dir}/{package-dir}" + service-dir: "sdk/translation" + package-dir: "azure-ai-translation-document" + generate-samples: true + generate-fakes: true + head-as-boolean: true + inject-spans: true From 393cfd7a90232c07c6bba5fb5e970cb57eb804c6 Mon Sep 17 00:00:00 2001 From: Eugenia Date: Wed, 23 Apr 2025 23:16:31 -0700 Subject: [PATCH 032/119] Updating more misconfigs in Document Translator tspconfig --- .../translation/Azure.AI.DocumentTranslation/tspconfig.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/translation/Azure.AI.DocumentTranslation/tspconfig.yaml b/specification/translation/Azure.AI.DocumentTranslation/tspconfig.yaml index b9b51a04fdc5..440b79e1d05b 100644 --- a/specification/translation/Azure.AI.DocumentTranslation/tspconfig.yaml +++ b/specification/translation/Azure.AI.DocumentTranslation/tspconfig.yaml @@ -28,8 +28,8 @@ options: package-mode: dataplane package-version: "1.1.0b1" generate-sample-project: false - generate-test: false - generate-sample: false + generate-test: true + generate-sample: true "@azure-tools/typespec-java": package-dir: "azure-ai-translation-document" namespace: com.azure.ai.translation.document From 3a909f6650763e2b81eac3613cfc2e69ab11f097 Mon Sep 17 00:00:00 2001 From: Eugenia Date: Wed, 23 Apr 2025 23:41:16 -0700 Subject: [PATCH 033/119] More updates to DT tspconfig --- .../translation/Azure.AI.DocumentTranslation/tspconfig.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/translation/Azure.AI.DocumentTranslation/tspconfig.yaml b/specification/translation/Azure.AI.DocumentTranslation/tspconfig.yaml index 440b79e1d05b..0121650f8f87 100644 --- a/specification/translation/Azure.AI.DocumentTranslation/tspconfig.yaml +++ b/specification/translation/Azure.AI.DocumentTranslation/tspconfig.yaml @@ -25,6 +25,7 @@ options: flavor: azure package-dir: "azure-ai-translation-document" namespace: "azure.ai.translation.document" + package-name: ai-translation-document package-mode: dataplane package-version: "1.1.0b1" generate-sample-project: false From 9b8f46af1960f04317db26e8d58d8769fe8b68c2 Mon Sep 17 00:00:00 2001 From: Eugenia Date: Wed, 23 Apr 2025 23:43:30 -0700 Subject: [PATCH 034/119] More updates to DT tspconfig --- .../translation/Azure.AI.DocumentTranslation/tspconfig.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/translation/Azure.AI.DocumentTranslation/tspconfig.yaml b/specification/translation/Azure.AI.DocumentTranslation/tspconfig.yaml index 0121650f8f87..9d5be78f5195 100644 --- a/specification/translation/Azure.AI.DocumentTranslation/tspconfig.yaml +++ b/specification/translation/Azure.AI.DocumentTranslation/tspconfig.yaml @@ -17,7 +17,7 @@ options: "@azure-tools/typespec-csharp": flavor: azure package-dir: "Azure.AI.Translation.Document" - namespace: Azure.AI.Translation.Document + namespace: "{package-dir}" clear-output-folder: true model-namespace: false generate-sample-project: false @@ -25,7 +25,7 @@ options: flavor: azure package-dir: "azure-ai-translation-document" namespace: "azure.ai.translation.document" - package-name: ai-translation-document + package-name: "{package-dir}" package-mode: dataplane package-version: "1.1.0b1" generate-sample-project: false From b166acd74187f3b46902509cdd3289791dec579f Mon Sep 17 00:00:00 2001 From: Eugenia Date: Wed, 23 Apr 2025 23:48:48 -0700 Subject: [PATCH 035/119] More updates to Text tspconfig --- .../translation/Azure.AI.TextTranslation/tspconfig.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml b/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml index a3ad30ff31cf..b1c65447d0ed 100644 --- a/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml +++ b/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml @@ -20,11 +20,12 @@ options: package-dir: "Azure.AI.Translation.Text" clear-output-folder: true model-namespace: false - namespace: Azure.AI.Translation.Text + namespace: "{package-dir}" flavor: azure "@azure-tools/typespec-python": namespace: "azure.ai.translation.text" package-dir: "azure-ai-translation-text" + package-name: "{package-dir}" flavor: azure generate-test: true generate-sample: true From 9f4ca6ce90a1612a831d8f0497325b6bcc061334 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Thu, 24 Apr 2025 18:23:16 -0700 Subject: [PATCH 036/119] Add back in compliant v3 API --- .../Azure.AI.TextTranslation/client.tsp | 117 ++++ .../models-breaksentence.tsp | 50 ++ .../models-dictionary.tsp | 234 ++++++++ .../Azure.AI.TextTranslation/routes.tsp | 42 ++ .../preview/2025-05-01-preview/openapi.json | 305 ++++++++++ ...FindSentenceBoundaries_MaximumSet_Gen.json | 28 + ...FindSentenceBoundaries_MinimumSet_Gen.json | 29 + ...ookupDictionaryEntries_MaximumSet_Gen.json | 87 +++ ...ookupDictionaryEntries_MinimumSet_Gen.json | 86 +++ ...okupDictionaryExamples_MaximumSet_Gen.json | 44 ++ ...okupDictionaryExamples_MinimumSet_Gen.json | 43 ++ .../stable/3.0/openapi.json | 549 ++++++++++++++++++ 12 files changed, 1614 insertions(+) create mode 100644 specification/translation/Azure.AI.TextTranslation/models-breaksentence.tsp create mode 100644 specification/translation/Azure.AI.TextTranslation/models-dictionary.tsp create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/FindSentenceBoundaries_MaximumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryEntries_MaximumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryExamples_MaximumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/client.tsp b/specification/translation/Azure.AI.TextTranslation/client.tsp index e2ccbbbe50b2..9b5e64cb3cd3 100644 --- a/specification/translation/Azure.AI.TextTranslation/client.tsp +++ b/specification/translation/Azure.AI.TextTranslation/client.tsp @@ -1,4 +1,6 @@ import "./main.tsp"; +import "./models-breaksentence.tsp"; +import "./models-dictionary.tsp"; import "./models-languages.tsp"; import "./models-translate.tsp"; import "./models-transliterate.tsp"; @@ -6,6 +8,76 @@ import "@azure-tools/typespec-client-generator-core"; using Azure.ClientGenerator.Core; +@@clientName(TextTranslation.BreakSentenceItem.sentLen, + "SentencesLengths", + "dotnet" +); +@@clientName(TextTranslation.BreakSentenceItem.sentLen, + "SentencesLengths", + "java" +); + +@@clientName(TextTranslation.BackTranslation.numExamples, + "ExamplesCount", + "dotnet" +); +@@clientName(TextTranslation.BackTranslation.numExamples, + "ExamplesCount", + "java" +); + +@@clientName(TextTranslation.DictionaryLookupParameters.from, + "SourceLanguage", + "dotnet" +); +@@clientName(TextTranslation.DictionaryLookupParameters.from, + "SourceLanguage", + "java" +); +@@clientName(TextTranslation.DictionaryLookupParameters.from, + "from_language", + "python" +); + +@@clientName(TextTranslation.DictionaryLookupParameters.to, + "TargetLanguage", + "dotnet" +); +@@clientName(TextTranslation.DictionaryLookupParameters.to, + "TargetLanguage", + "java" +); +@@clientName(TextTranslation.DictionaryLookupParameters.to, + "to_language", + "python" +); + +@@clientName(TextTranslation.DictionaryExamplesParameters.from, + "SourceLanguage", + "dotnet" +); +@@clientName(TextTranslation.DictionaryExamplesParameters.from, + "SourceLanguage", + "java" +); +@@clientName(TextTranslation.DictionaryExamplesParameters.from, + "from_language", + "python" +); + +@@clientName(TextTranslation.DictionaryExamplesParameters.to, + "TargetLanguage", + "dotnet" +); +@@clientName(TextTranslation.DictionaryExamplesParameters.to, + "TargetLanguage", + "java" +); +@@clientName(TextTranslation.DictionaryExamplesParameters.to, + "to_language", + "python" +); + @@clientName(TextTranslation.TranslationLanguage.dir, "Directionality", "dotnet" @@ -33,9 +105,36 @@ using Azure.ClientGenerator.Core; @@clientName(TextTranslation.LanguageScript.dir, "Directionality", "dotnet"); @@clientName(TextTranslation.LanguageScript.dir, "Directionality", "java"); +@@clientName(TextTranslation.TranslationText.sentLen, + "SentenceBoundaries", + "dotnet" +); +@@clientName(TextTranslation.TranslationText.sentLen, + "SentenceBoundaries", + "java" +); + @@clientName(TextTranslation.TranslationText.to, "TargetLanguage", "dotnet"); @@clientName(TextTranslation.TranslationText.to, "TargetLanguage", "java"); +@@clientName(TextTranslation.SentenceBoundaries.srcSentLen, + "SourceSentencesLengths", + "dotnet" +); +@@clientName(TextTranslation.SentenceBoundaries.srcSentLen, + "SourceSentencesLengths", + "java" +); + +@@clientName(TextTranslation.SentenceBoundaries.transSentLen, + "TranslatedSentencesLengths", + "dotnet" +); +@@clientName(TextTranslation.SentenceBoundaries.transSentLen, + "TranslatedSentencesLengths", + "java" +); + @@clientName(TextTranslation.DetectedLanguage.score, "Confidence", "dotnet"); @@clientName(TextTranslation.DetectedLanguage.score, "Confidence", "java"); @@ -77,6 +176,24 @@ using Azure.ClientGenerator.Core; "java" ); +@@clientName(TextTranslation.TranslateParameters.suggestedFrom, + "SuggestedSourceLanguage", + "dotnet" +); +@@clientName(TextTranslation.TranslateParameters.suggestedFrom, + "SuggestedSourceLanguage", + "java" +); + +@@clientName(TextTranslation.TranslatedTextAlignment.proj, + "Projections", + "dotnet" +); +@@clientName(TextTranslation.TranslatedTextAlignment.proj, + "Projections", + "java" +); + @@clientName(TextTranslation.TransliterateParameters.fromScript, "SourceLanguageScript", "dotnet" diff --git a/specification/translation/Azure.AI.TextTranslation/models-breaksentence.tsp b/specification/translation/Azure.AI.TextTranslation/models-breaksentence.tsp new file mode 100644 index 000000000000..06798cb40010 --- /dev/null +++ b/specification/translation/Azure.AI.TextTranslation/models-breaksentence.tsp @@ -0,0 +1,50 @@ +import "@typespec/rest"; +import "@azure-tools/typespec-azure-core"; +import "./models-shared.tsp"; +import "./models-translate.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using Azure.Core; + +namespace TextTranslation; + +@doc("Request parameters for the break sentence API.") +model BreakSentenceParameters { + ...CommonParameters; + + @query + @doc(""" + Language tag identifying the language of the input text. + If a code isn't specified, automatic language detection will be applied. + """) + language?: string; + + @query + @doc(""" + Script tag identifying the script used by the input text. + If a script isn't specified, the default script of the language will be assumed. + """) + script?: string; +} + +@doc("Response for the Break SEntence API.") +model BreakSentenceResult { + ...CommonResultHeaders; + + @bodyRoot + @doc("Array of the break sentence elements.") + result: BreakSentenceItem[]; +} + +@doc("Item containing break sentence result.") +model BreakSentenceItem { + @doc("The detectedLanguage property is only present in the result object when language auto-detection is requested.") + detectedLanguage?: DetectedLanguage; + + @doc(""" + An integer array representing the lengths of the sentences in the input text. + The length of the array is the number of sentences, and the values are the length of each sentence. + """) + sentLen: int32[]; +} diff --git a/specification/translation/Azure.AI.TextTranslation/models-dictionary.tsp b/specification/translation/Azure.AI.TextTranslation/models-dictionary.tsp new file mode 100644 index 000000000000..57f11e35e4de --- /dev/null +++ b/specification/translation/Azure.AI.TextTranslation/models-dictionary.tsp @@ -0,0 +1,234 @@ +import "@typespec/rest"; +import "@azure-tools/typespec-azure-core"; +import "./models-shared.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using Azure.Core; + +namespace TextTranslation; + +@doc("Request parameters for the dictionary lookup API.") +model DictionaryLookupParameters { + ...CommonParameters; + + @query + @doc(""" + Specifies the language of the input text. + The source language must be one of the supported languages included in the dictionary scope. + """) + from: string; + + @query + @doc(""" + Specifies the language of the output text. + The target language must be one of the supported languages included in the dictionary scope. + """) + to: string; +} + +@doc("Request parameters for the dictionary examples API.") +model DictionaryExamplesParameters { + ...CommonParameters; + + @query + @doc(""" + Specifies the language of the input text. + The source language must be one of the supported languages included in the dictionary scope. + """) + from: string; + + @query + @doc(""" + Specifies the language of the output text. + The target language must be one of the supported languages included in the dictionary scope. + """) + to: string; +} + +@doc("Response for the dictionary lookup API.") +model DictionaryLookupResult { + ...CommonResultHeaders; + + @bodyRoot + @doc("Array of the dictionary lookup elements.") + result: DictionaryLookupItem[]; +} + +@doc("Response for the dictionary examples API.") +model DictionaryExamplesResult { + ...CommonResultHeaders; + + @bodyRoot + @doc("Array of the dictionary examples elements.") + result: DictionaryExampleItem[]; +} + +@doc("Element containing the text with translation.") +model DictionaryExampleTextItem extends InputTextItem { + @doc(""" + A string specifying the translated text previously returned by the Dictionary lookup operation. + This should be the value from the normalizedTarget field in the translations list of the Dictionary + lookup response. The service will return examples for the specific source-target word-pair. + """) + translation: string; +} + +@doc("Dictionary Lookup Element") +model DictionaryLookupItem { + @doc(""" + A string giving the normalized form of the source term. + For example, if the request is "JOHN", the normalized form will be "john". + The content of this field becomes the input to lookup examples. + """) + normalizedSource: string; + + @doc(""" + A string giving the source term in a form best suited for end-user display. + For example, if the input is "JOHN", the display form will reflect the usual + spelling of the name: "John". + """) + displaySource: string; + + @doc(""" + A list of translations for the source term. + """) + translations: DictionaryTranslation[]; +} + +@doc("Translation source term.") +model DictionaryTranslation { + @doc(""" + A string giving the normalized form of this term in the target language. + This value should be used as input to lookup examples. + """) + normalizedTarget: string; + + @doc(""" + A string giving the term in the target language and in a form best suited + for end-user display. Generally, this will only differ from the normalizedTarget + in terms of capitalization. For example, a proper noun like "Juan" will have + normalizedTarget = "juan" and displayTarget = "Juan". + """) + displayTarget: string; + + @doc(""" + A string associating this term with a part-of-speech tag. + """) + posTag: string; + + @doc(""" + A value between 0.0 and 1.0 which represents the "confidence" + (or perhaps more accurately, "probability in the training data") of that translation pair. + The sum of confidence scores for one source word may or may not sum to 1.0. + """) + confidence: float32; + + @doc(""" + A string giving the word to display as a prefix of the translation. Currently, + this is the gendered determiner of nouns, in languages that have gendered determiners. + For example, the prefix of the Spanish word "mosca" is "la", since "mosca" is a feminine noun in Spanish. + This is only dependent on the translation, and not on the source. + If there is no prefix, it will be the empty string. + """) + prefixWord: string; + + @doc(""" + A list of "back translations" of the target. For example, source words that the target can translate to. + The list is guaranteed to contain the source word that was requested (e.g., if the source word being + looked up is "fly", then it is guaranteed that "fly" will be in the backTranslations list). + However, it is not guaranteed to be in the first position, and often will not be. + """) + backTranslations: BackTranslation[]; +} + +@doc("Back Translation") +model BackTranslation { + @doc(""" + A string giving the normalized form of the source term that is a back-translation of the target. + This value should be used as input to lookup examples. + """) + normalizedText: string; + + @doc(""" + A string giving the source term that is a back-translation of the target in a form best + suited for end-user display. + """) + displayText: string; + + @doc(""" + An integer representing the number of examples that are available for this translation pair. + Actual examples must be retrieved with a separate call to lookup examples. The number is mostly + intended to facilitate display in a UX. For example, a user interface may add a hyperlink + to the back-translation if the number of examples is greater than zero and show the back-translation + as plain text if there are no examples. Note that the actual number of examples returned + by a call to lookup examples may be less than numExamples, because additional filtering may be + applied on the fly to remove "bad" examples. + """) + numExamples: int32; + + @doc(""" + An integer representing the frequency of this translation pair in the data. The main purpose of this + field is to provide a user interface with a means to sort back-translations so the most frequent terms are first. + """) + frequencyCount: int32; +} + +@doc("Dictionary Example element") +model DictionaryExampleItem { + @doc(""" + A string giving the normalized form of the source term. Generally, this should be identical + to the value of the Text field at the matching list index in the body of the request. + """) + normalizedSource: string; + + @doc(""" + A string giving the normalized form of the target term. Generally, this should be identical + to the value of the Translation field at the matching list index in the body of the request. + """) + normalizedTarget: string; + + @doc(""" + A list of examples for the (source term, target term) pair. + """) + examples: DictionaryExample[]; +} + +@doc("Dictionary Example") +model DictionaryExample { + @doc(""" + The string to concatenate before the value of sourceTerm to form a complete example. + Do not add a space character, since it is already there when it should be. + This value may be an empty string. + """) + sourcePrefix: string; + + @doc(""" + A string equal to the actual term looked up. The string is added with sourcePrefix + and sourceSuffix to form the complete example. Its value is separated so it can be + marked in a user interface, e.g., by bolding it. + """) + sourceTerm: string; + + @doc(""" + The string to concatenate after the value of sourceTerm to form a complete example. + Do not add a space character, since it is already there when it should be. + This value may be an empty string. + """) + sourceSuffix: string; + + @doc(""" + A string similar to sourcePrefix but for the target. + """) + targetPrefix: string; + + @doc(""" + A string similar to sourceTerm but for the target. + """) + targetTerm: string; + + @doc(""" + A string similar to sourceSuffix but for the target. + """) + targetSuffix: string; +} diff --git a/specification/translation/Azure.AI.TextTranslation/routes.tsp b/specification/translation/Azure.AI.TextTranslation/routes.tsp index 12c2f4509c51..0f050cde79dc 100644 --- a/specification/translation/Azure.AI.TextTranslation/routes.tsp +++ b/specification/translation/Azure.AI.TextTranslation/routes.tsp @@ -3,8 +3,11 @@ import "@azure-tools/typespec-azure-core"; import "./models-languages.tsp"; import "./models-translate.tsp"; import "./models-transliterate.tsp"; +import "./models-breaksentence.tsp"; +import "./models-dictionary.tsp"; using TypeSpec.Http; +using TypeSpec.Versioning; namespace TextTranslation; @@ -65,3 +68,42 @@ op transliterate is CustomOperation< TransliterateResult, ErrorResponse >; + +#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." +@removed(APIVersion.v2025_05_01_preview) +@post +@route("breaksentence") +@summary("Find Sentence Boundaries") +@doc("Find Sentence Boundaries") +op findSentenceBoundaries is CustomOperation< + InputTextItem[], + BreakSentenceParameters, + BreakSentenceResult, + ErrorResponse +>; + +#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." +@removed(APIVersion.v2025_05_01_preview) +@post +@route("dictionary/lookup") +@summary("Lookup Dictionary Entries") +@doc("Lookup Dictionary Entries") +op lookupDictionaryEntries is CustomOperation< + InputTextItem[], + DictionaryLookupParameters, + DictionaryLookupResult, + ErrorResponse +>; + +#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." +@removed(APIVersion.v2025_05_01_preview) +@post +@route("dictionary/examples") +@summary("Lookup Dictionary Examples") +@doc("Lookup Dictionary Examples") +op lookupDictionaryExamples is CustomOperation< + DictionaryExampleTextItem[], + DictionaryExamplesParameters, + DictionaryExamplesResult, + ErrorResponse +>; \ No newline at end of file diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json index 023b60a694fe..dea3fd7961d5 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json @@ -280,6 +280,88 @@ } }, "definitions": { + "BackTranslation": { + "type": "object", + "description": "Back Translation", + "properties": { + "normalizedText": { + "type": "string", + "description": "A string giving the normalized form of the source term that is a back-translation of the target.\nThis value should be used as input to lookup examples." + }, + "displayText": { + "type": "string", + "description": "A string giving the source term that is a back-translation of the target in a form best\nsuited for end-user display." + }, + "numExamples": { + "type": "integer", + "format": "int32", + "description": "An integer representing the number of examples that are available for this translation pair.\nActual examples must be retrieved with a separate call to lookup examples. The number is mostly\nintended to facilitate display in a UX. For example, a user interface may add a hyperlink\nto the back-translation if the number of examples is greater than zero and show the back-translation\nas plain text if there are no examples. Note that the actual number of examples returned\nby a call to lookup examples may be less than numExamples, because additional filtering may be\napplied on the fly to remove \"bad\" examples." + }, + "frequencyCount": { + "type": "integer", + "format": "int32", + "description": "An integer representing the frequency of this translation pair in the data. The main purpose of this\nfield is to provide a user interface with a means to sort back-translations so the most frequent terms are first." + } + }, + "required": [ + "normalizedText", + "displayText", + "numExamples", + "frequencyCount" + ] + }, + "BreakSentenceItem": { + "type": "object", + "description": "Item containing break sentence result.", + "properties": { + "detectedLanguage": { + "$ref": "#/definitions/DetectedLanguage", + "description": "The detectedLanguage property is only present in the result object when language auto-detection is requested." + }, + "sentLen": { + "type": "array", + "description": "An integer array representing the lengths of the sentences in the input text.\nThe length of the array is the number of sentences, and the values are the length of each sentence.", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + "required": [ + "sentLen" + ] + }, + "BreakSentenceParameters": { + "type": "object", + "description": "Request parameters for the break sentence API.", + "properties": { + "language": { + "type": "string", + "description": "Language tag identifying the language of the input text. \nIf a code isn't specified, automatic language detection will be applied." + }, + "script": { + "type": "string", + "description": "Script tag identifying the script used by the input text. \nIf a script isn't specified, the default script of the language will be assumed." + } + } + }, + "BreakSentenceResult": { + "type": "object", + "description": "Response for the Break SEntence API.", + "properties": { + "result": { + "type": "array", + "description": "Array of the break sentence elements.", + "items": { + "$ref": "#/definitions/BreakSentenceItem" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "result" + ] + }, "DetectedLanguage": { "type": "object", "description": "An object describing the detected language.", @@ -299,6 +381,229 @@ "score" ] }, + "DictionaryExample": { + "type": "object", + "description": "Dictionary Example", + "properties": { + "sourcePrefix": { + "type": "string", + "description": "The string to concatenate before the value of sourceTerm to form a complete example.\nDo not add a space character, since it is already there when it should be.\nThis value may be an empty string." + }, + "sourceTerm": { + "type": "string", + "description": "A string equal to the actual term looked up. The string is added with sourcePrefix\nand sourceSuffix to form the complete example. Its value is separated so it can be\nmarked in a user interface, e.g., by bolding it." + }, + "sourceSuffix": { + "type": "string", + "description": "The string to concatenate after the value of sourceTerm to form a complete example.\nDo not add a space character, since it is already there when it should be.\nThis value may be an empty string." + }, + "targetPrefix": { + "type": "string", + "description": "A string similar to sourcePrefix but for the target." + }, + "targetTerm": { + "type": "string", + "description": "A string similar to sourceTerm but for the target." + }, + "targetSuffix": { + "type": "string", + "description": "A string similar to sourceSuffix but for the target." + } + }, + "required": [ + "sourcePrefix", + "sourceTerm", + "sourceSuffix", + "targetPrefix", + "targetTerm", + "targetSuffix" + ] + }, + "DictionaryExampleItem": { + "type": "object", + "description": "Dictionary Example element", + "properties": { + "normalizedSource": { + "type": "string", + "description": "A string giving the normalized form of the source term. Generally, this should be identical\nto the value of the Text field at the matching list index in the body of the request." + }, + "normalizedTarget": { + "type": "string", + "description": "A string giving the normalized form of the target term. Generally, this should be identical\nto the value of the Translation field at the matching list index in the body of the request." + }, + "examples": { + "type": "array", + "description": "A list of examples for the (source term, target term) pair.", + "items": { + "$ref": "#/definitions/DictionaryExample" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "normalizedSource", + "normalizedTarget", + "examples" + ] + }, + "DictionaryExampleTextItem": { + "type": "object", + "description": "Element containing the text with translation.", + "properties": { + "translation": { + "type": "string", + "description": "A string specifying the translated text previously returned by the Dictionary lookup operation. \nThis should be the value from the normalizedTarget field in the translations list of the Dictionary \nlookup response. The service will return examples for the specific source-target word-pair." + } + }, + "required": [ + "translation" + ], + "allOf": [ + { + "$ref": "#/definitions/InputTextItem" + } + ] + }, + "DictionaryExamplesParameters": { + "type": "object", + "description": "Request parameters for the dictionary examples API.", + "properties": { + "from": { + "type": "string", + "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope." + }, + "to": { + "type": "string", + "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope." + } + }, + "required": [ + "from", + "to" + ] + }, + "DictionaryExamplesResult": { + "type": "object", + "description": "Response for the dictionary examples API.", + "properties": { + "result": { + "type": "array", + "description": "Array of the dictionary examples elements.", + "items": { + "$ref": "#/definitions/DictionaryExampleItem" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "result" + ] + }, + "DictionaryLookupItem": { + "type": "object", + "description": "Dictionary Lookup Element", + "properties": { + "normalizedSource": { + "type": "string", + "description": "A string giving the normalized form of the source term.\nFor example, if the request is \"JOHN\", the normalized form will be \"john\".\nThe content of this field becomes the input to lookup examples." + }, + "displaySource": { + "type": "string", + "description": "A string giving the source term in a form best suited for end-user display.\nFor example, if the input is \"JOHN\", the display form will reflect the usual\nspelling of the name: \"John\"." + }, + "translations": { + "type": "array", + "description": "A list of translations for the source term.", + "items": { + "$ref": "#/definitions/DictionaryTranslation" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "normalizedSource", + "displaySource", + "translations" + ] + }, + "DictionaryLookupParameters": { + "type": "object", + "description": "Request parameters for the dictionary lookup API.", + "properties": { + "from": { + "type": "string", + "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope." + }, + "to": { + "type": "string", + "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope." + } + }, + "required": [ + "from", + "to" + ] + }, + "DictionaryLookupResult": { + "type": "object", + "description": "Response for the dictionary lookup API.", + "properties": { + "result": { + "type": "array", + "description": "Array of the dictionary lookup elements.", + "items": { + "$ref": "#/definitions/DictionaryLookupItem" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "result" + ] + }, + "DictionaryTranslation": { + "type": "object", + "description": "Translation source term.", + "properties": { + "normalizedTarget": { + "type": "string", + "description": "A string giving the normalized form of this term in the target language.\nThis value should be used as input to lookup examples." + }, + "displayTarget": { + "type": "string", + "description": "A string giving the term in the target language and in a form best suited\nfor end-user display. Generally, this will only differ from the normalizedTarget\nin terms of capitalization. For example, a proper noun like \"Juan\" will have\nnormalizedTarget = \"juan\" and displayTarget = \"Juan\"." + }, + "posTag": { + "type": "string", + "description": "A string associating this term with a part-of-speech tag." + }, + "confidence": { + "type": "number", + "format": "float", + "description": "A value between 0.0 and 1.0 which represents the \"confidence\" \n(or perhaps more accurately, \"probability in the training data\") of that translation pair. \nThe sum of confidence scores for one source word may or may not sum to 1.0." + }, + "prefixWord": { + "type": "string", + "description": "A string giving the word to display as a prefix of the translation. Currently,\nthis is the gendered determiner of nouns, in languages that have gendered determiners.\nFor example, the prefix of the Spanish word \"mosca\" is \"la\", since \"mosca\" is a feminine noun in Spanish. \nThis is only dependent on the translation, and not on the source. \nIf there is no prefix, it will be the empty string." + }, + "backTranslations": { + "type": "array", + "description": "A list of \"back translations\" of the target. For example, source words that the target can translate to.\nThe list is guaranteed to contain the source word that was requested (e.g., if the source word being\nlooked up is \"fly\", then it is guaranteed that \"fly\" will be in the backTranslations list).\nHowever, it is not guaranteed to be in the first position, and often will not be.", + "items": { + "$ref": "#/definitions/BackTranslation" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "normalizedTarget", + "displayTarget", + "posTag", + "confidence", + "prefixWord", + "backTranslations" + ] + }, "ErrorDetails": { "type": "object", "description": "Error details as returned by Translator Service.", diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/FindSentenceBoundaries_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/FindSentenceBoundaries_MaximumSet_Gen.json new file mode 100644 index 000000000000..1847c3f5e3d3 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/FindSentenceBoundaries_MaximumSet_Gen.json @@ -0,0 +1,28 @@ +{ + "title": "Find Sentence Boundaries", + "operationId": "FindSentenceBoundaries", + "parameters": { + "X-ClientTraceId": "svun", + "language": "en", + "script": "Latn", + "api-version": "3.0", + "body": [ + { + "text": "How are you? I am fine. What did you do today?" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "sentLen": [ + 13, + 11, + 22 + ] + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json new file mode 100644 index 000000000000..4175072f8566 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json @@ -0,0 +1,29 @@ +{ + "title": "Find Sentence Boundaries with minimum properties", + "operationId": "FindSentenceBoundaries", + "parameters": { + "api-version": "3.0", + "body": [ + { + "text": "How are you? I am fine. What did you do today?" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "detectedLanguage": { + "language": "en", + "score": 1.0 + }, + "sentLen": [ + 13, + 11, + 22 + ] + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryEntries_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryEntries_MaximumSet_Gen.json new file mode 100644 index 000000000000..636eb73b04f6 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryEntries_MaximumSet_Gen.json @@ -0,0 +1,87 @@ +{ + "title": "Lookup Dictionary Entries", + "operationId": "LookupDictionaryEntries", + "parameters": { + "X-ClientTraceId": "yqst", + "from": "en", + "to": "es", + "api-version": "3.0", + "body": [ + { + "text": "fly" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "normalizedSource": "fly", + "displaySource": "fly", + "translations": [ + { + "normalizedTarget": "volar", + "displayTarget": "volar", + "posTag": "VERB", + "confidence": 0.4081, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 4637 + }, + { + "normalizedText": "flying", + "displayText": "flying", + "numExamples": 15, + "frequencyCount": 1365 + }, + { + "normalizedText": "blow", + "displayText": "blow", + "numExamples": 15, + "frequencyCount": 503 + }, + { + "normalizedText": "flight", + "displayText": "flight", + "numExamples": 15, + "frequencyCount": 135 + } + ] + }, + { + "normalizedTarget": "mosca", + "displayTarget": "mosca", + "posTag": "NOUN", + "confidence": 0.2668, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 1697 + }, + { + "normalizedText": "flyweight", + "displayText": "flyweight", + "numExamples": 0, + "frequencyCount": 48 + }, + { + "normalizedText": "flies", + "displayText": "flies", + "numExamples": 9, + "frequencyCount": 34 + } + ] + } + ] + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json new file mode 100644 index 000000000000..dfc24a03bdea --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json @@ -0,0 +1,86 @@ +{ + "title": "Lookup Dictionary Entries with minimum properties", + "operationId": "LookupDictionaryEntries", + "parameters": { + "from": "en", + "to": "es", + "api-version": "3.0", + "body": [ + { + "text": "fly" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "normalizedSource": "fly", + "displaySource": "fly", + "translations": [ + { + "normalizedTarget": "volar", + "displayTarget": "volar", + "posTag": "VERB", + "confidence": 0.4081, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 4637 + }, + { + "normalizedText": "flying", + "displayText": "flying", + "numExamples": 15, + "frequencyCount": 1365 + }, + { + "normalizedText": "blow", + "displayText": "blow", + "numExamples": 15, + "frequencyCount": 503 + }, + { + "normalizedText": "flight", + "displayText": "flight", + "numExamples": 15, + "frequencyCount": 135 + } + ] + }, + { + "normalizedTarget": "mosca", + "displayTarget": "mosca", + "posTag": "NOUN", + "confidence": 0.2668, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 1697 + }, + { + "normalizedText": "flyweight", + "displayText": "flyweight", + "numExamples": 0, + "frequencyCount": 48 + }, + { + "normalizedText": "flies", + "displayText": "flies", + "numExamples": 9, + "frequencyCount": 34 + } + ] + } + ] + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryExamples_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryExamples_MaximumSet_Gen.json new file mode 100644 index 000000000000..00c751e3e39c --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryExamples_MaximumSet_Gen.json @@ -0,0 +1,44 @@ +{ + "title": "Lookup Dictionary Examples", + "operationId": "LookupDictionaryExamples", + "parameters": { + "X-ClientTraceId": "vykwwekvcncclrmsyjhbok", + "from": "en", + "to": "es", + "api-version": "3.0", + "body": [ + { + "text": "fly", + "translation": "volar" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "normalizedSource": "fly", + "normalizedTarget": "volar", + "examples": [ + { + "sourcePrefix": "They need machines to ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Necesitan máquinas para ", + "targetTerm": "volar", + "targetSuffix": "." + }, + { + "sourcePrefix": "That should really ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Eso realmente debe ", + "targetTerm": "volar", + "targetSuffix": "." + } + ] + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json new file mode 100644 index 000000000000..7f2b08865c25 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json @@ -0,0 +1,43 @@ +{ + "title": "Lookup Dictionary Examples with minimum properties", + "operationId": "LookupDictionaryExamples", + "parameters": { + "from": "en", + "to": "es", + "api-version": "3.0", + "body": [ + { + "text": "fly", + "translation": "volar" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "normalizedSource": "fly", + "normalizedTarget": "volar", + "examples": [ + { + "sourcePrefix": "They need machines to ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Necesitan máquinas para ", + "targetTerm": "volar", + "targetSuffix": "." + }, + { + "sourcePrefix": "That should really ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Eso realmente debe ", + "targetTerm": "volar", + "targetSuffix": "." + } + ] + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json index b9dbd031f7e9..8e3aa9b40e9a 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json @@ -36,6 +36,252 @@ ], "tags": [], "paths": { + "/breaksentence": { + "post": { + "operationId": "FindSentenceBoundaries", + "summary": "Find Sentence Boundaries", + "description": "Find Sentence Boundaries", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "description": "A client-generated GUID to uniquely identify the request.", + "required": false, + "type": "string", + "x-ms-client-name": "clientTraceId" + }, + { + "$ref": "#/parameters/BreakSentenceParameters.language" + }, + { + "$ref": "#/parameters/BreakSentenceParameters.script" + }, + { + "name": "api-version", + "in": "query", + "description": "Mandatory API version parameter", + "required": true, + "type": "string", + "x-ms-client-name": "apiVersion" + }, + { + "name": "body", + "in": "body", + "description": "Defines the content of the request", + "required": true, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [] + } + } + ], + "responses": { + "200": { + "description": "Response for the Break SEntence API.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/BreakSentenceItem" + }, + "x-ms-identifiers": [] + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + } + }, + "x-ms-examples": { + "Find Sentence Boundaries": { + "$ref": "./examples/FindSentenceBoundaries_MaximumSet_Gen.json" + }, + "Find Sentence Boundaries with minimum properties": { + "$ref": "./examples/FindSentenceBoundaries_MinimumSet_Gen.json" + } + } + } + }, + "/dictionary/examples": { + "post": { + "operationId": "LookupDictionaryExamples", + "summary": "Lookup Dictionary Examples", + "description": "Lookup Dictionary Examples", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "description": "A client-generated GUID to uniquely identify the request.", + "required": false, + "type": "string", + "x-ms-client-name": "clientTraceId" + }, + { + "$ref": "#/parameters/DictionaryExamplesParameters.from" + }, + { + "$ref": "#/parameters/DictionaryExamplesParameters.to" + }, + { + "name": "api-version", + "in": "query", + "description": "Mandatory API version parameter", + "required": true, + "type": "string", + "x-ms-client-name": "apiVersion" + }, + { + "name": "body", + "in": "body", + "description": "Defines the content of the request", + "required": true, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryExampleTextItem" + }, + "x-ms-identifiers": [] + } + } + ], + "responses": { + "200": { + "description": "Response for the dictionary examples API.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryExampleItem" + }, + "x-ms-identifiers": [] + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + } + }, + "x-ms-examples": { + "Lookup Dictionary Examples": { + "$ref": "./examples/LookupDictionaryExamples_MaximumSet_Gen.json" + }, + "Lookup Dictionary Examples with minimum properties": { + "$ref": "./examples/LookupDictionaryExamples_MinimumSet_Gen.json" + } + } + } + }, + "/dictionary/lookup": { + "post": { + "operationId": "LookupDictionaryEntries", + "summary": "Lookup Dictionary Entries", + "description": "Lookup Dictionary Entries", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "description": "A client-generated GUID to uniquely identify the request.", + "required": false, + "type": "string", + "x-ms-client-name": "clientTraceId" + }, + { + "$ref": "#/parameters/DictionaryLookupParameters.from" + }, + { + "$ref": "#/parameters/DictionaryLookupParameters.to" + }, + { + "name": "api-version", + "in": "query", + "description": "Mandatory API version parameter", + "required": true, + "type": "string", + "x-ms-client-name": "apiVersion" + }, + { + "name": "body", + "in": "body", + "description": "Defines the content of the request", + "required": true, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [] + } + } + ], + "responses": { + "200": { + "description": "Response for the dictionary lookup API.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryLookupItem" + }, + "x-ms-identifiers": [] + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + } + }, + "x-ms-examples": { + "Lookup Dictionary Entries": { + "$ref": "./examples/LookupDictionaryEntries_MaximumSet_Gen.json" + }, + "Lookup Dictionary Entries with minimum properties": { + "$ref": "./examples/LookupDictionaryEntries_MinimumSet_Gen.json" + } + } + } + }, "/languages": { "get": { "operationId": "GetSupportedLanguages", @@ -316,6 +562,74 @@ } }, "definitions": { + "BackTranslation": { + "type": "object", + "description": "Back Translation", + "properties": { + "normalizedText": { + "type": "string", + "description": "A string giving the normalized form of the source term that is a back-translation of the target.\nThis value should be used as input to lookup examples." + }, + "displayText": { + "type": "string", + "description": "A string giving the source term that is a back-translation of the target in a form best\nsuited for end-user display." + }, + "numExamples": { + "type": "integer", + "format": "int32", + "description": "An integer representing the number of examples that are available for this translation pair.\nActual examples must be retrieved with a separate call to lookup examples. The number is mostly\nintended to facilitate display in a UX. For example, a user interface may add a hyperlink\nto the back-translation if the number of examples is greater than zero and show the back-translation\nas plain text if there are no examples. Note that the actual number of examples returned\nby a call to lookup examples may be less than numExamples, because additional filtering may be\napplied on the fly to remove \"bad\" examples." + }, + "frequencyCount": { + "type": "integer", + "format": "int32", + "description": "An integer representing the frequency of this translation pair in the data. The main purpose of this\nfield is to provide a user interface with a means to sort back-translations so the most frequent terms are first." + } + }, + "required": [ + "normalizedText", + "displayText", + "numExamples", + "frequencyCount" + ] + }, + "BreakSentenceItem": { + "type": "object", + "description": "Item containing break sentence result.", + "properties": { + "detectedLanguage": { + "$ref": "#/definitions/DetectedLanguage", + "description": "The detectedLanguage property is only present in the result object when language auto-detection is requested." + }, + "sentLen": { + "type": "array", + "description": "An integer array representing the lengths of the sentences in the input text.\nThe length of the array is the number of sentences, and the values are the length of each sentence.", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + "required": [ + "sentLen" + ] + }, + "BreakSentenceResult": { + "type": "object", + "description": "Response for the Break SEntence API.", + "properties": { + "result": { + "type": "array", + "description": "Array of the break sentence elements.", + "items": { + "$ref": "#/definitions/BreakSentenceItem" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "result" + ] + }, "DetectedLanguage": { "type": "object", "description": "An object describing the detected language.", @@ -335,6 +649,193 @@ "score" ] }, + "DictionaryExample": { + "type": "object", + "description": "Dictionary Example", + "properties": { + "sourcePrefix": { + "type": "string", + "description": "The string to concatenate before the value of sourceTerm to form a complete example.\nDo not add a space character, since it is already there when it should be.\nThis value may be an empty string." + }, + "sourceTerm": { + "type": "string", + "description": "A string equal to the actual term looked up. The string is added with sourcePrefix\nand sourceSuffix to form the complete example. Its value is separated so it can be\nmarked in a user interface, e.g., by bolding it." + }, + "sourceSuffix": { + "type": "string", + "description": "The string to concatenate after the value of sourceTerm to form a complete example.\nDo not add a space character, since it is already there when it should be.\nThis value may be an empty string." + }, + "targetPrefix": { + "type": "string", + "description": "A string similar to sourcePrefix but for the target." + }, + "targetTerm": { + "type": "string", + "description": "A string similar to sourceTerm but for the target." + }, + "targetSuffix": { + "type": "string", + "description": "A string similar to sourceSuffix but for the target." + } + }, + "required": [ + "sourcePrefix", + "sourceTerm", + "sourceSuffix", + "targetPrefix", + "targetTerm", + "targetSuffix" + ] + }, + "DictionaryExampleItem": { + "type": "object", + "description": "Dictionary Example element", + "properties": { + "normalizedSource": { + "type": "string", + "description": "A string giving the normalized form of the source term. Generally, this should be identical\nto the value of the Text field at the matching list index in the body of the request." + }, + "normalizedTarget": { + "type": "string", + "description": "A string giving the normalized form of the target term. Generally, this should be identical\nto the value of the Translation field at the matching list index in the body of the request." + }, + "examples": { + "type": "array", + "description": "A list of examples for the (source term, target term) pair.", + "items": { + "$ref": "#/definitions/DictionaryExample" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "normalizedSource", + "normalizedTarget", + "examples" + ] + }, + "DictionaryExampleTextItem": { + "type": "object", + "description": "Element containing the text with translation.", + "properties": { + "translation": { + "type": "string", + "description": "A string specifying the translated text previously returned by the Dictionary lookup operation. \nThis should be the value from the normalizedTarget field in the translations list of the Dictionary \nlookup response. The service will return examples for the specific source-target word-pair." + } + }, + "required": [ + "translation" + ], + "allOf": [ + { + "$ref": "#/definitions/InputTextItem" + } + ] + }, + "DictionaryExamplesResult": { + "type": "object", + "description": "Response for the dictionary examples API.", + "properties": { + "result": { + "type": "array", + "description": "Array of the dictionary examples elements.", + "items": { + "$ref": "#/definitions/DictionaryExampleItem" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "result" + ] + }, + "DictionaryLookupItem": { + "type": "object", + "description": "Dictionary Lookup Element", + "properties": { + "normalizedSource": { + "type": "string", + "description": "A string giving the normalized form of the source term.\nFor example, if the request is \"JOHN\", the normalized form will be \"john\".\nThe content of this field becomes the input to lookup examples." + }, + "displaySource": { + "type": "string", + "description": "A string giving the source term in a form best suited for end-user display.\nFor example, if the input is \"JOHN\", the display form will reflect the usual\nspelling of the name: \"John\"." + }, + "translations": { + "type": "array", + "description": "A list of translations for the source term.", + "items": { + "$ref": "#/definitions/DictionaryTranslation" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "normalizedSource", + "displaySource", + "translations" + ] + }, + "DictionaryLookupResult": { + "type": "object", + "description": "Response for the dictionary lookup API.", + "properties": { + "result": { + "type": "array", + "description": "Array of the dictionary lookup elements.", + "items": { + "$ref": "#/definitions/DictionaryLookupItem" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "result" + ] + }, + "DictionaryTranslation": { + "type": "object", + "description": "Translation source term.", + "properties": { + "normalizedTarget": { + "type": "string", + "description": "A string giving the normalized form of this term in the target language.\nThis value should be used as input to lookup examples." + }, + "displayTarget": { + "type": "string", + "description": "A string giving the term in the target language and in a form best suited\nfor end-user display. Generally, this will only differ from the normalizedTarget\nin terms of capitalization. For example, a proper noun like \"Juan\" will have\nnormalizedTarget = \"juan\" and displayTarget = \"Juan\"." + }, + "posTag": { + "type": "string", + "description": "A string associating this term with a part-of-speech tag." + }, + "confidence": { + "type": "number", + "format": "float", + "description": "A value between 0.0 and 1.0 which represents the \"confidence\" \n(or perhaps more accurately, \"probability in the training data\") of that translation pair. \nThe sum of confidence scores for one source word may or may not sum to 1.0." + }, + "prefixWord": { + "type": "string", + "description": "A string giving the word to display as a prefix of the translation. Currently,\nthis is the gendered determiner of nouns, in languages that have gendered determiners.\nFor example, the prefix of the Spanish word \"mosca\" is \"la\", since \"mosca\" is a feminine noun in Spanish. \nThis is only dependent on the translation, and not on the source. \nIf there is no prefix, it will be the empty string." + }, + "backTranslations": { + "type": "array", + "description": "A list of \"back translations\" of the target. For example, source words that the target can translate to.\nThe list is guaranteed to contain the source word that was requested (e.g., if the source word being\nlooked up is \"fly\", then it is guaranteed that \"fly\" will be in the backTranslations list).\nHowever, it is not guaranteed to be in the first position, and often will not be.", + "items": { + "$ref": "#/definitions/BackTranslation" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "normalizedTarget", + "displayTarget", + "posTag", + "confidence", + "prefixWord", + "backTranslations" + ] + }, "ErrorDetails": { "type": "object", "description": "Error details as returned by Translator Service.", @@ -1019,6 +1520,54 @@ } }, "parameters": { + "BreakSentenceParameters.language": { + "name": "language", + "in": "query", + "description": "Language tag identifying the language of the input text. \nIf a code isn't specified, automatic language detection will be applied.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "BreakSentenceParameters.script": { + "name": "script", + "in": "query", + "description": "Script tag identifying the script used by the input text. \nIf a script isn't specified, the default script of the language will be assumed.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "DictionaryExamplesParameters.from": { + "name": "from", + "in": "query", + "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "DictionaryExamplesParameters.to": { + "name": "to", + "in": "query", + "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "DictionaryLookupParameters.from": { + "name": "from", + "in": "query", + "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "DictionaryLookupParameters.to": { + "name": "to", + "in": "query", + "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, "GetSupportedLanguagesParameters.acceptLanguage": { "name": "Accept-Language", "in": "header", From fa80c05d5dba6cf027a2dd8a0ce3e4c08385c783 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Thu, 24 Apr 2025 18:49:58 -0700 Subject: [PATCH 037/119] Add back in compliant v3 API --- .../models-dictionary.tsp | 7 + .../preview/2025-05-01-preview/openapi.json | 169 ------------------ 2 files changed, 7 insertions(+), 169 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-dictionary.tsp b/specification/translation/Azure.AI.TextTranslation/models-dictionary.tsp index 57f11e35e4de..035d51b148ed 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-dictionary.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-dictionary.tsp @@ -4,6 +4,7 @@ import "./models-shared.tsp"; using TypeSpec.Http; using TypeSpec.Rest; +using TypeSpec.Versioning; using Azure.Core; namespace TextTranslation; @@ -46,6 +47,7 @@ model DictionaryExamplesParameters { to: string; } +@removed(APIVersion.v2025_05_01_preview) @doc("Response for the dictionary lookup API.") model DictionaryLookupResult { ...CommonResultHeaders; @@ -55,6 +57,7 @@ model DictionaryLookupResult { result: DictionaryLookupItem[]; } +@removed(APIVersion.v2025_05_01_preview) @doc("Response for the dictionary examples API.") model DictionaryExamplesResult { ...CommonResultHeaders; @@ -74,6 +77,7 @@ model DictionaryExampleTextItem extends InputTextItem { translation: string; } +@removed(APIVersion.v2025_05_01_preview) @doc("Dictionary Lookup Element") model DictionaryLookupItem { @doc(""" @@ -96,6 +100,7 @@ model DictionaryLookupItem { translations: DictionaryTranslation[]; } +@removed(APIVersion.v2025_05_01_preview) @doc("Translation source term.") model DictionaryTranslation { @doc(""" @@ -174,6 +179,7 @@ model BackTranslation { frequencyCount: int32; } +@removed(APIVersion.v2025_05_01_preview) @doc("Dictionary Example element") model DictionaryExampleItem { @doc(""" @@ -194,6 +200,7 @@ model DictionaryExampleItem { examples: DictionaryExample[]; } +@removed(APIVersion.v2025_05_01_preview) @doc("Dictionary Example") model DictionaryExample { @doc(""" diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json index dea3fd7961d5..3016c70f94bd 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json @@ -381,71 +381,6 @@ "score" ] }, - "DictionaryExample": { - "type": "object", - "description": "Dictionary Example", - "properties": { - "sourcePrefix": { - "type": "string", - "description": "The string to concatenate before the value of sourceTerm to form a complete example.\nDo not add a space character, since it is already there when it should be.\nThis value may be an empty string." - }, - "sourceTerm": { - "type": "string", - "description": "A string equal to the actual term looked up. The string is added with sourcePrefix\nand sourceSuffix to form the complete example. Its value is separated so it can be\nmarked in a user interface, e.g., by bolding it." - }, - "sourceSuffix": { - "type": "string", - "description": "The string to concatenate after the value of sourceTerm to form a complete example.\nDo not add a space character, since it is already there when it should be.\nThis value may be an empty string." - }, - "targetPrefix": { - "type": "string", - "description": "A string similar to sourcePrefix but for the target." - }, - "targetTerm": { - "type": "string", - "description": "A string similar to sourceTerm but for the target." - }, - "targetSuffix": { - "type": "string", - "description": "A string similar to sourceSuffix but for the target." - } - }, - "required": [ - "sourcePrefix", - "sourceTerm", - "sourceSuffix", - "targetPrefix", - "targetTerm", - "targetSuffix" - ] - }, - "DictionaryExampleItem": { - "type": "object", - "description": "Dictionary Example element", - "properties": { - "normalizedSource": { - "type": "string", - "description": "A string giving the normalized form of the source term. Generally, this should be identical\nto the value of the Text field at the matching list index in the body of the request." - }, - "normalizedTarget": { - "type": "string", - "description": "A string giving the normalized form of the target term. Generally, this should be identical\nto the value of the Translation field at the matching list index in the body of the request." - }, - "examples": { - "type": "array", - "description": "A list of examples for the (source term, target term) pair.", - "items": { - "$ref": "#/definitions/DictionaryExample" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "normalizedSource", - "normalizedTarget", - "examples" - ] - }, "DictionaryExampleTextItem": { "type": "object", "description": "Element containing the text with translation.", @@ -482,50 +417,6 @@ "to" ] }, - "DictionaryExamplesResult": { - "type": "object", - "description": "Response for the dictionary examples API.", - "properties": { - "result": { - "type": "array", - "description": "Array of the dictionary examples elements.", - "items": { - "$ref": "#/definitions/DictionaryExampleItem" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "result" - ] - }, - "DictionaryLookupItem": { - "type": "object", - "description": "Dictionary Lookup Element", - "properties": { - "normalizedSource": { - "type": "string", - "description": "A string giving the normalized form of the source term.\nFor example, if the request is \"JOHN\", the normalized form will be \"john\".\nThe content of this field becomes the input to lookup examples." - }, - "displaySource": { - "type": "string", - "description": "A string giving the source term in a form best suited for end-user display.\nFor example, if the input is \"JOHN\", the display form will reflect the usual\nspelling of the name: \"John\"." - }, - "translations": { - "type": "array", - "description": "A list of translations for the source term.", - "items": { - "$ref": "#/definitions/DictionaryTranslation" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "normalizedSource", - "displaySource", - "translations" - ] - }, "DictionaryLookupParameters": { "type": "object", "description": "Request parameters for the dictionary lookup API.", @@ -544,66 +435,6 @@ "to" ] }, - "DictionaryLookupResult": { - "type": "object", - "description": "Response for the dictionary lookup API.", - "properties": { - "result": { - "type": "array", - "description": "Array of the dictionary lookup elements.", - "items": { - "$ref": "#/definitions/DictionaryLookupItem" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "result" - ] - }, - "DictionaryTranslation": { - "type": "object", - "description": "Translation source term.", - "properties": { - "normalizedTarget": { - "type": "string", - "description": "A string giving the normalized form of this term in the target language.\nThis value should be used as input to lookup examples." - }, - "displayTarget": { - "type": "string", - "description": "A string giving the term in the target language and in a form best suited\nfor end-user display. Generally, this will only differ from the normalizedTarget\nin terms of capitalization. For example, a proper noun like \"Juan\" will have\nnormalizedTarget = \"juan\" and displayTarget = \"Juan\"." - }, - "posTag": { - "type": "string", - "description": "A string associating this term with a part-of-speech tag." - }, - "confidence": { - "type": "number", - "format": "float", - "description": "A value between 0.0 and 1.0 which represents the \"confidence\" \n(or perhaps more accurately, \"probability in the training data\") of that translation pair. \nThe sum of confidence scores for one source word may or may not sum to 1.0." - }, - "prefixWord": { - "type": "string", - "description": "A string giving the word to display as a prefix of the translation. Currently,\nthis is the gendered determiner of nouns, in languages that have gendered determiners.\nFor example, the prefix of the Spanish word \"mosca\" is \"la\", since \"mosca\" is a feminine noun in Spanish. \nThis is only dependent on the translation, and not on the source. \nIf there is no prefix, it will be the empty string." - }, - "backTranslations": { - "type": "array", - "description": "A list of \"back translations\" of the target. For example, source words that the target can translate to.\nThe list is guaranteed to contain the source word that was requested (e.g., if the source word being\nlooked up is \"fly\", then it is guaranteed that \"fly\" will be in the backTranslations list).\nHowever, it is not guaranteed to be in the first position, and often will not be.", - "items": { - "$ref": "#/definitions/BackTranslation" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "normalizedTarget", - "displayTarget", - "posTag", - "confidence", - "prefixWord", - "backTranslations" - ] - }, "ErrorDetails": { "type": "object", "description": "Error details as returned by Translator Service.", From a9be2abc04dec10fe25e728b40ca8c0350592df7 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 28 Apr 2025 21:47:25 -0700 Subject: [PATCH 038/119] Reduce parameters in 2025-05-1 version" --- .../models-breaksentence.tsp | 4 + .../models-dictionary.tsp | 4 + .../Azure.AI.TextTranslation/routes.tsp | 2 +- .../preview/2025-05-01-preview/openapi.json | 136 ------------------ 4 files changed, 9 insertions(+), 137 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-breaksentence.tsp b/specification/translation/Azure.AI.TextTranslation/models-breaksentence.tsp index 06798cb40010..e2b04fe5d140 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-breaksentence.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-breaksentence.tsp @@ -5,11 +5,13 @@ import "./models-translate.tsp"; using TypeSpec.Http; using TypeSpec.Rest; +using TypeSpec.Versioning; using Azure.Core; namespace TextTranslation; @doc("Request parameters for the break sentence API.") +@removed(APIVersion.v2025_05_01_preview) model BreakSentenceParameters { ...CommonParameters; @@ -29,6 +31,7 @@ model BreakSentenceParameters { } @doc("Response for the Break SEntence API.") +@removed(APIVersion.v2025_05_01_preview) model BreakSentenceResult { ...CommonResultHeaders; @@ -38,6 +41,7 @@ model BreakSentenceResult { } @doc("Item containing break sentence result.") +@removed(APIVersion.v2025_05_01_preview) model BreakSentenceItem { @doc("The detectedLanguage property is only present in the result object when language auto-detection is requested.") detectedLanguage?: DetectedLanguage; diff --git a/specification/translation/Azure.AI.TextTranslation/models-dictionary.tsp b/specification/translation/Azure.AI.TextTranslation/models-dictionary.tsp index 035d51b148ed..2cb25268da8b 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-dictionary.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-dictionary.tsp @@ -9,6 +9,7 @@ using Azure.Core; namespace TextTranslation; +@removed(APIVersion.v2025_05_01_preview) @doc("Request parameters for the dictionary lookup API.") model DictionaryLookupParameters { ...CommonParameters; @@ -28,6 +29,7 @@ model DictionaryLookupParameters { to: string; } +@removed(APIVersion.v2025_05_01_preview) @doc("Request parameters for the dictionary examples API.") model DictionaryExamplesParameters { ...CommonParameters; @@ -68,6 +70,7 @@ model DictionaryExamplesResult { } @doc("Element containing the text with translation.") +@removed(APIVersion.v2025_05_01_preview) model DictionaryExampleTextItem extends InputTextItem { @doc(""" A string specifying the translated text previously returned by the Dictionary lookup operation. @@ -147,6 +150,7 @@ model DictionaryTranslation { backTranslations: BackTranslation[]; } +@removed(APIVersion.v2025_05_01_preview) @doc("Back Translation") model BackTranslation { @doc(""" diff --git a/specification/translation/Azure.AI.TextTranslation/routes.tsp b/specification/translation/Azure.AI.TextTranslation/routes.tsp index 0f050cde79dc..28941b018299 100644 --- a/specification/translation/Azure.AI.TextTranslation/routes.tsp +++ b/specification/translation/Azure.AI.TextTranslation/routes.tsp @@ -96,11 +96,11 @@ op lookupDictionaryEntries is CustomOperation< >; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." -@removed(APIVersion.v2025_05_01_preview) @post @route("dictionary/examples") @summary("Lookup Dictionary Examples") @doc("Lookup Dictionary Examples") +@removed(APIVersion.v2025_05_01_preview) op lookupDictionaryExamples is CustomOperation< DictionaryExampleTextItem[], DictionaryExamplesParameters, diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json index 3016c70f94bd..023b60a694fe 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json @@ -280,88 +280,6 @@ } }, "definitions": { - "BackTranslation": { - "type": "object", - "description": "Back Translation", - "properties": { - "normalizedText": { - "type": "string", - "description": "A string giving the normalized form of the source term that is a back-translation of the target.\nThis value should be used as input to lookup examples." - }, - "displayText": { - "type": "string", - "description": "A string giving the source term that is a back-translation of the target in a form best\nsuited for end-user display." - }, - "numExamples": { - "type": "integer", - "format": "int32", - "description": "An integer representing the number of examples that are available for this translation pair.\nActual examples must be retrieved with a separate call to lookup examples. The number is mostly\nintended to facilitate display in a UX. For example, a user interface may add a hyperlink\nto the back-translation if the number of examples is greater than zero and show the back-translation\nas plain text if there are no examples. Note that the actual number of examples returned\nby a call to lookup examples may be less than numExamples, because additional filtering may be\napplied on the fly to remove \"bad\" examples." - }, - "frequencyCount": { - "type": "integer", - "format": "int32", - "description": "An integer representing the frequency of this translation pair in the data. The main purpose of this\nfield is to provide a user interface with a means to sort back-translations so the most frequent terms are first." - } - }, - "required": [ - "normalizedText", - "displayText", - "numExamples", - "frequencyCount" - ] - }, - "BreakSentenceItem": { - "type": "object", - "description": "Item containing break sentence result.", - "properties": { - "detectedLanguage": { - "$ref": "#/definitions/DetectedLanguage", - "description": "The detectedLanguage property is only present in the result object when language auto-detection is requested." - }, - "sentLen": { - "type": "array", - "description": "An integer array representing the lengths of the sentences in the input text.\nThe length of the array is the number of sentences, and the values are the length of each sentence.", - "items": { - "type": "integer", - "format": "int32" - } - } - }, - "required": [ - "sentLen" - ] - }, - "BreakSentenceParameters": { - "type": "object", - "description": "Request parameters for the break sentence API.", - "properties": { - "language": { - "type": "string", - "description": "Language tag identifying the language of the input text. \nIf a code isn't specified, automatic language detection will be applied." - }, - "script": { - "type": "string", - "description": "Script tag identifying the script used by the input text. \nIf a script isn't specified, the default script of the language will be assumed." - } - } - }, - "BreakSentenceResult": { - "type": "object", - "description": "Response for the Break SEntence API.", - "properties": { - "result": { - "type": "array", - "description": "Array of the break sentence elements.", - "items": { - "$ref": "#/definitions/BreakSentenceItem" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "result" - ] - }, "DetectedLanguage": { "type": "object", "description": "An object describing the detected language.", @@ -381,60 +299,6 @@ "score" ] }, - "DictionaryExampleTextItem": { - "type": "object", - "description": "Element containing the text with translation.", - "properties": { - "translation": { - "type": "string", - "description": "A string specifying the translated text previously returned by the Dictionary lookup operation. \nThis should be the value from the normalizedTarget field in the translations list of the Dictionary \nlookup response. The service will return examples for the specific source-target word-pair." - } - }, - "required": [ - "translation" - ], - "allOf": [ - { - "$ref": "#/definitions/InputTextItem" - } - ] - }, - "DictionaryExamplesParameters": { - "type": "object", - "description": "Request parameters for the dictionary examples API.", - "properties": { - "from": { - "type": "string", - "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope." - }, - "to": { - "type": "string", - "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope." - } - }, - "required": [ - "from", - "to" - ] - }, - "DictionaryLookupParameters": { - "type": "object", - "description": "Request parameters for the dictionary lookup API.", - "properties": { - "from": { - "type": "string", - "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope." - }, - "to": { - "type": "string", - "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope." - } - }, - "required": [ - "from", - "to" - ] - }, "ErrorDetails": { "type": "object", "description": "Error details as returned by Translator Service.", From 00cb4a602eda75cb6fd10c68170667554cdc5170 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Wed, 30 Apr 2025 00:42:52 -0700 Subject: [PATCH 039/119] Fix whitespace issue --- specification/translation/Azure.AI.TextTranslation/routes.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/translation/Azure.AI.TextTranslation/routes.tsp b/specification/translation/Azure.AI.TextTranslation/routes.tsp index 28941b018299..e353aff52925 100644 --- a/specification/translation/Azure.AI.TextTranslation/routes.tsp +++ b/specification/translation/Azure.AI.TextTranslation/routes.tsp @@ -106,4 +106,4 @@ op lookupDictionaryExamples is CustomOperation< DictionaryExamplesParameters, DictionaryExamplesResult, ErrorResponse ->; \ No newline at end of file +>; From e30985334fd6179bedab69c60864778c2dd27eb7 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Wed, 30 Apr 2025 14:59:02 -0700 Subject: [PATCH 040/119] Revert stable version number to v3.0 --- .../examples/3.0/FindSentenceBoundaries_MaximumSet_Gen.json | 2 +- .../examples/3.0/FindSentenceBoundaries_MinimumSet_Gen.json | 2 +- .../examples/3.0/GetSupportedLanguages_MaximumSet_Gen.json | 2 +- .../examples/3.0/GetSupportedLanguages_MinimumSet_Gen.json | 2 +- .../examples/3.0/LookupDictionaryEntries_MaximumSet_Gen.json | 2 +- .../examples/3.0/LookupDictionaryEntries_MinimumSet_Gen.json | 2 +- .../examples/3.0/LookupDictionaryExamples_MaximumSet_Gen.json | 2 +- .../examples/3.0/LookupDictionaryExamples_MinimumSet_Gen.json | 2 +- .../examples/3.0/Translate_MaximumSet_Gen.json | 2 +- .../examples/3.0/Translate_MinimumSet_Gen.json | 2 +- .../examples/3.0/Transliterate_MaximumSet_Gen.json | 2 +- .../examples/3.0/Transliterate_MinimumSet_Gen.json | 2 +- specification/translation/Azure.AI.TextTranslation/main.tsp | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/FindSentenceBoundaries_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/FindSentenceBoundaries_MaximumSet_Gen.json index 1847c3f5e3d3..ce515a0ed2e8 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/3.0/FindSentenceBoundaries_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/3.0/FindSentenceBoundaries_MaximumSet_Gen.json @@ -5,7 +5,7 @@ "X-ClientTraceId": "svun", "language": "en", "script": "Latn", - "api-version": "3.0", + "api-version": "v3.0", "body": [ { "text": "How are you? I am fine. What did you do today?" diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/FindSentenceBoundaries_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/FindSentenceBoundaries_MinimumSet_Gen.json index 4175072f8566..eb1c638be3cd 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/3.0/FindSentenceBoundaries_MinimumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/3.0/FindSentenceBoundaries_MinimumSet_Gen.json @@ -2,7 +2,7 @@ "title": "Find Sentence Boundaries with minimum properties", "operationId": "FindSentenceBoundaries", "parameters": { - "api-version": "3.0", + "api-version": "v3.0", "body": [ { "text": "How are you? I am fine. What did you do today?" diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/GetSupportedLanguages_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/GetSupportedLanguages_MaximumSet_Gen.json index 0fdb83142178..ca7cc03dc422 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/3.0/GetSupportedLanguages_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/3.0/GetSupportedLanguages_MaximumSet_Gen.json @@ -6,7 +6,7 @@ "scope": "translation,transliteration,dictionary", "Accept-Language": "en", "If-None-Match": "fpnhruttllvc", - "api-version": "3.0" + "api-version": "v3.0" }, "responses": { "200": { diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/GetSupportedLanguages_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/GetSupportedLanguages_MinimumSet_Gen.json index 5f8405e887d9..598524bee498 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/3.0/GetSupportedLanguages_MinimumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/3.0/GetSupportedLanguages_MinimumSet_Gen.json @@ -2,7 +2,7 @@ "title": "Gets the set of languages currently supported by other operations of the Translator with minimum properties.", "operationId": "GetSupportedLanguages", "parameters": { - "api-version": "3.0" + "api-version": "v3.0" }, "responses": { "200": { diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryEntries_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryEntries_MaximumSet_Gen.json index 636eb73b04f6..2357a8bf1802 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryEntries_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryEntries_MaximumSet_Gen.json @@ -5,7 +5,7 @@ "X-ClientTraceId": "yqst", "from": "en", "to": "es", - "api-version": "3.0", + "api-version": "v3.0", "body": [ { "text": "fly" diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryEntries_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryEntries_MinimumSet_Gen.json index dfc24a03bdea..289e6bc6030e 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryEntries_MinimumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryEntries_MinimumSet_Gen.json @@ -4,7 +4,7 @@ "parameters": { "from": "en", "to": "es", - "api-version": "3.0", + "api-version": "v3.0", "body": [ { "text": "fly" diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryExamples_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryExamples_MaximumSet_Gen.json index 00c751e3e39c..377465a51238 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryExamples_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryExamples_MaximumSet_Gen.json @@ -5,7 +5,7 @@ "X-ClientTraceId": "vykwwekvcncclrmsyjhbok", "from": "en", "to": "es", - "api-version": "3.0", + "api-version": "v3.0", "body": [ { "text": "fly", diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryExamples_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryExamples_MinimumSet_Gen.json index 7f2b08865c25..7095f37f0c6e 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryExamples_MinimumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryExamples_MinimumSet_Gen.json @@ -4,7 +4,7 @@ "parameters": { "from": "en", "to": "es", - "api-version": "3.0", + "api-version": "v3.0", "body": [ { "text": "fly", diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/Translate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/Translate_MaximumSet_Gen.json index 06f74471d1df..59c4d43f0f8c 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/3.0/Translate_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/3.0/Translate_MaximumSet_Gen.json @@ -17,7 +17,7 @@ "fromScript": "Latn", "toScript": "Latn", "allowFallback": true, - "api-version": "3.0", + "api-version": "v3.0", "body": [ { "text": "This is a test." diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/Translate_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/Translate_MinimumSet_Gen.json index b29982929425..0d8533cdb0e3 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/3.0/Translate_MinimumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/3.0/Translate_MinimumSet_Gen.json @@ -5,7 +5,7 @@ "to": [ "fmlxpuepn" ], - "api-version": "3.0", + "api-version": "v3.0", "body": [ { "text": "This is a test." diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/Transliterate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/Transliterate_MaximumSet_Gen.json index 92f67b4a62d3..4508865be80e 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/3.0/Transliterate_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/3.0/Transliterate_MaximumSet_Gen.json @@ -6,7 +6,7 @@ "language": "zh-Hans", "fromScript": "Hans", "toScript": "Latn", - "api-version": "3.0", + "api-version": "v3.0", "body": [ { "text": "这是个测试。" diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/Transliterate_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/Transliterate_MinimumSet_Gen.json index 24c5aee2ffb1..03cf8b0f6630 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/3.0/Transliterate_MinimumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/3.0/Transliterate_MinimumSet_Gen.json @@ -5,7 +5,7 @@ "language": "zh-Hans", "fromScript": "Hans", "toScript": "Latn", - "api-version": "3.0", + "api-version": "v3.0", "body": [ { "text": "这是个测试。" diff --git a/specification/translation/Azure.AI.TextTranslation/main.tsp b/specification/translation/Azure.AI.TextTranslation/main.tsp index 6781c417d002..4ef6b176604d 100644 --- a/specification/translation/Azure.AI.TextTranslation/main.tsp +++ b/specification/translation/Azure.AI.TextTranslation/main.tsp @@ -40,7 +40,7 @@ namespace TextTranslation; @doc("Text Translation supported versions") enum APIVersion { @doc("Version 3.0") - v3_0: "3.0", + v3_0: "v3.0", @doc("Version 2025-05-01") v2025_05_01_preview: "2025-05-01-preview", From fa5877f623e89ca1a06d7ba7b8646f8bc68ba709 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Wed, 30 Apr 2025 18:38:59 -0700 Subject: [PATCH 041/119] Reverting version 3.0 to v3.0 --- .../{3.0 => v3.0}/FindSentenceBoundaries_MaximumSet_Gen.json | 0 .../{3.0 => v3.0}/FindSentenceBoundaries_MinimumSet_Gen.json | 0 .../{3.0 => v3.0}/GetSupportedLanguages_MaximumSet_Gen.json | 0 .../{3.0 => v3.0}/GetSupportedLanguages_MinimumSet_Gen.json | 0 .../{3.0 => v3.0}/LookupDictionaryEntries_MaximumSet_Gen.json | 0 .../{3.0 => v3.0}/LookupDictionaryEntries_MinimumSet_Gen.json | 0 .../{3.0 => v3.0}/LookupDictionaryExamples_MaximumSet_Gen.json | 0 .../{3.0 => v3.0}/LookupDictionaryExamples_MinimumSet_Gen.json | 0 .../examples/{3.0 => v3.0}/Translate_MaximumSet_Gen.json | 0 .../examples/{3.0 => v3.0}/Translate_MinimumSet_Gen.json | 0 .../examples/{3.0 => v3.0}/Transliterate_MaximumSet_Gen.json | 0 .../examples/{3.0 => v3.0}/Transliterate_MinimumSet_Gen.json | 0 .../examples/FindSentenceBoundaries_MaximumSet_Gen.json | 2 +- .../examples/FindSentenceBoundaries_MinimumSet_Gen.json | 2 +- .../examples/GetSupportedLanguages_MaximumSet_Gen.json | 2 +- .../examples/GetSupportedLanguages_MinimumSet_Gen.json | 2 +- .../examples/LookupDictionaryEntries_MaximumSet_Gen.json | 2 +- .../examples/LookupDictionaryEntries_MinimumSet_Gen.json | 2 +- .../examples/LookupDictionaryExamples_MaximumSet_Gen.json | 2 +- .../examples/LookupDictionaryExamples_MinimumSet_Gen.json | 2 +- .../stable/{3.0 => v3.0}/examples/Translate_MaximumSet_Gen.json | 2 +- .../stable/{3.0 => v3.0}/examples/Translate_MinimumSet_Gen.json | 2 +- .../{3.0 => v3.0}/examples/Transliterate_MaximumSet_Gen.json | 2 +- .../{3.0 => v3.0}/examples/Transliterate_MinimumSet_Gen.json | 2 +- .../Azure.AI.TextTranslation/stable/{3.0 => v3.0}/openapi.json | 2 +- 25 files changed, 13 insertions(+), 13 deletions(-) rename specification/translation/Azure.AI.TextTranslation/examples/{3.0 => v3.0}/FindSentenceBoundaries_MaximumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{3.0 => v3.0}/FindSentenceBoundaries_MinimumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{3.0 => v3.0}/GetSupportedLanguages_MaximumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{3.0 => v3.0}/GetSupportedLanguages_MinimumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{3.0 => v3.0}/LookupDictionaryEntries_MaximumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{3.0 => v3.0}/LookupDictionaryEntries_MinimumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{3.0 => v3.0}/LookupDictionaryExamples_MaximumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{3.0 => v3.0}/LookupDictionaryExamples_MinimumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{3.0 => v3.0}/Translate_MaximumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{3.0 => v3.0}/Translate_MinimumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{3.0 => v3.0}/Transliterate_MaximumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{3.0 => v3.0}/Transliterate_MinimumSet_Gen.json (100%) rename specification/translation/data-plane/Azure.AI.TextTranslation/stable/{3.0 => v3.0}/examples/FindSentenceBoundaries_MaximumSet_Gen.json (94%) rename specification/translation/data-plane/Azure.AI.TextTranslation/stable/{3.0 => v3.0}/examples/FindSentenceBoundaries_MinimumSet_Gen.json (94%) rename specification/translation/data-plane/Azure.AI.TextTranslation/stable/{3.0 => v3.0}/examples/GetSupportedLanguages_MaximumSet_Gen.json (98%) rename specification/translation/data-plane/Azure.AI.TextTranslation/stable/{3.0 => v3.0}/examples/GetSupportedLanguages_MinimumSet_Gen.json (90%) rename specification/translation/data-plane/Azure.AI.TextTranslation/stable/{3.0 => v3.0}/examples/LookupDictionaryEntries_MaximumSet_Gen.json (98%) rename specification/translation/data-plane/Azure.AI.TextTranslation/stable/{3.0 => v3.0}/examples/LookupDictionaryEntries_MinimumSet_Gen.json (98%) rename specification/translation/data-plane/Azure.AI.TextTranslation/stable/{3.0 => v3.0}/examples/LookupDictionaryExamples_MaximumSet_Gen.json (97%) rename specification/translation/data-plane/Azure.AI.TextTranslation/stable/{3.0 => v3.0}/examples/LookupDictionaryExamples_MinimumSet_Gen.json (97%) rename specification/translation/data-plane/Azure.AI.TextTranslation/stable/{3.0 => v3.0}/examples/Translate_MaximumSet_Gen.json (98%) rename specification/translation/data-plane/Azure.AI.TextTranslation/stable/{3.0 => v3.0}/examples/Translate_MinimumSet_Gen.json (94%) rename specification/translation/data-plane/Azure.AI.TextTranslation/stable/{3.0 => v3.0}/examples/Transliterate_MaximumSet_Gen.json (94%) rename specification/translation/data-plane/Azure.AI.TextTranslation/stable/{3.0 => v3.0}/examples/Transliterate_MinimumSet_Gen.json (94%) rename specification/translation/data-plane/Azure.AI.TextTranslation/stable/{3.0 => v3.0}/openapi.json (99%) diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/FindSentenceBoundaries_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/FindSentenceBoundaries_MaximumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/3.0/FindSentenceBoundaries_MaximumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/v3.0/FindSentenceBoundaries_MaximumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/FindSentenceBoundaries_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/FindSentenceBoundaries_MinimumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/3.0/FindSentenceBoundaries_MinimumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/v3.0/FindSentenceBoundaries_MinimumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/GetSupportedLanguages_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/GetSupportedLanguages_MaximumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/3.0/GetSupportedLanguages_MaximumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/v3.0/GetSupportedLanguages_MaximumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/GetSupportedLanguages_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/GetSupportedLanguages_MinimumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/3.0/GetSupportedLanguages_MinimumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/v3.0/GetSupportedLanguages_MinimumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryEntries_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryEntries_MaximumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryEntries_MaximumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryEntries_MaximumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryEntries_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryEntries_MinimumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryEntries_MinimumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryEntries_MinimumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryExamples_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryExamples_MaximumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryExamples_MaximumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryExamples_MaximumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryExamples_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryExamples_MinimumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryExamples_MinimumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryExamples_MinimumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/Translate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Translate_MaximumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/3.0/Translate_MaximumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/v3.0/Translate_MaximumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/Translate_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Translate_MinimumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/3.0/Translate_MinimumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/v3.0/Translate_MinimumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/Transliterate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Transliterate_MaximumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/3.0/Transliterate_MaximumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/v3.0/Transliterate_MaximumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/3.0/Transliterate_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Transliterate_MinimumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/3.0/Transliterate_MinimumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/v3.0/Transliterate_MinimumSet_Gen.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/FindSentenceBoundaries_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MaximumSet_Gen.json similarity index 94% rename from specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/FindSentenceBoundaries_MaximumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MaximumSet_Gen.json index 1847c3f5e3d3..ce515a0ed2e8 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/FindSentenceBoundaries_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MaximumSet_Gen.json @@ -5,7 +5,7 @@ "X-ClientTraceId": "svun", "language": "en", "script": "Latn", - "api-version": "3.0", + "api-version": "v3.0", "body": [ { "text": "How are you? I am fine. What did you do today?" diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json similarity index 94% rename from specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json index 4175072f8566..eb1c638be3cd 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json @@ -2,7 +2,7 @@ "title": "Find Sentence Boundaries with minimum properties", "operationId": "FindSentenceBoundaries", "parameters": { - "api-version": "3.0", + "api-version": "v3.0", "body": [ { "text": "How are you? I am fine. What did you do today?" diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/GetSupportedLanguages_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MaximumSet_Gen.json similarity index 98% rename from specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/GetSupportedLanguages_MaximumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MaximumSet_Gen.json index 0fdb83142178..ca7cc03dc422 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/GetSupportedLanguages_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MaximumSet_Gen.json @@ -6,7 +6,7 @@ "scope": "translation,transliteration,dictionary", "Accept-Language": "en", "If-None-Match": "fpnhruttllvc", - "api-version": "3.0" + "api-version": "v3.0" }, "responses": { "200": { diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/GetSupportedLanguages_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MinimumSet_Gen.json similarity index 90% rename from specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/GetSupportedLanguages_MinimumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MinimumSet_Gen.json index 5f8405e887d9..598524bee498 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/GetSupportedLanguages_MinimumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MinimumSet_Gen.json @@ -2,7 +2,7 @@ "title": "Gets the set of languages currently supported by other operations of the Translator with minimum properties.", "operationId": "GetSupportedLanguages", "parameters": { - "api-version": "3.0" + "api-version": "v3.0" }, "responses": { "200": { diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryEntries_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MaximumSet_Gen.json similarity index 98% rename from specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryEntries_MaximumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MaximumSet_Gen.json index 636eb73b04f6..2357a8bf1802 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryEntries_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MaximumSet_Gen.json @@ -5,7 +5,7 @@ "X-ClientTraceId": "yqst", "from": "en", "to": "es", - "api-version": "3.0", + "api-version": "v3.0", "body": [ { "text": "fly" diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json similarity index 98% rename from specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json index dfc24a03bdea..289e6bc6030e 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json @@ -4,7 +4,7 @@ "parameters": { "from": "en", "to": "es", - "api-version": "3.0", + "api-version": "v3.0", "body": [ { "text": "fly" diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryExamples_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MaximumSet_Gen.json similarity index 97% rename from specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryExamples_MaximumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MaximumSet_Gen.json index 00c751e3e39c..377465a51238 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryExamples_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MaximumSet_Gen.json @@ -5,7 +5,7 @@ "X-ClientTraceId": "vykwwekvcncclrmsyjhbok", "from": "en", "to": "es", - "api-version": "3.0", + "api-version": "v3.0", "body": [ { "text": "fly", diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json similarity index 97% rename from specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json index 7f2b08865c25..7095f37f0c6e 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json @@ -4,7 +4,7 @@ "parameters": { "from": "en", "to": "es", - "api-version": "3.0", + "api-version": "v3.0", "body": [ { "text": "fly", diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MaximumSet_Gen.json similarity index 98% rename from specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Translate_MaximumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MaximumSet_Gen.json index 06f74471d1df..59c4d43f0f8c 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Translate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MaximumSet_Gen.json @@ -17,7 +17,7 @@ "fromScript": "Latn", "toScript": "Latn", "allowFallback": true, - "api-version": "3.0", + "api-version": "v3.0", "body": [ { "text": "This is a test." diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MinimumSet_Gen.json similarity index 94% rename from specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Translate_MinimumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MinimumSet_Gen.json index b29982929425..0d8533cdb0e3 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Translate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MinimumSet_Gen.json @@ -5,7 +5,7 @@ "to": [ "fmlxpuepn" ], - "api-version": "3.0", + "api-version": "v3.0", "body": [ { "text": "This is a test." diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Transliterate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MaximumSet_Gen.json similarity index 94% rename from specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Transliterate_MaximumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MaximumSet_Gen.json index 92f67b4a62d3..4508865be80e 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Transliterate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MaximumSet_Gen.json @@ -6,7 +6,7 @@ "language": "zh-Hans", "fromScript": "Hans", "toScript": "Latn", - "api-version": "3.0", + "api-version": "v3.0", "body": [ { "text": "这是个测试。" diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Transliterate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MinimumSet_Gen.json similarity index 94% rename from specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Transliterate_MinimumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MinimumSet_Gen.json index 24c5aee2ffb1..03cf8b0f6630 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/examples/Transliterate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MinimumSet_Gen.json @@ -5,7 +5,7 @@ "language": "zh-Hans", "fromScript": "Hans", "toScript": "Latn", - "api-version": "3.0", + "api-version": "v3.0", "body": [ { "text": "这是个测试。" diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json similarity index 99% rename from specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json index 8e3aa9b40e9a..e66833f6e092 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/3.0/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "title": "Text Translation", - "version": "3.0", + "version": "v3.0", "description": "Text translation is a cloud-based REST API feature of the Translator service that uses neural\nmachine translation technology to enable quick and accurate source-to-target text translation\nin real time across all supported languages.\n\nThe following methods are supported by the Text Translation feature:\n\nLanguages. Returns a list of languages supported by Translate, Transliterate, and Dictionary Lookup operations.\n\nTranslate. Renders single source-language text to multiple target-language texts with a single request.\n\nTransliterate. Converts characters or letters of a source language to the corresponding characters or letters of a target language.\n\nDetect. Returns the source code language code and a boolean variable denoting whether the detected language is supported for text translation and transliteration.", "x-typespec-generated": [ { From e11b7e249b93ef6d60b810112b7c706f41dec428 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Wed, 30 Apr 2025 18:44:06 -0700 Subject: [PATCH 042/119] Reverting version 3.0 to v3.0 --- .../translation/data-plane/Azure.AI.TextTranslation/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md index 66a3dd352bc3..7eb6d98f9a2e 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md @@ -18,7 +18,7 @@ openapi-type: data-plane These settings apply only when `--tag=release_3_0` is specified on the command line. ``` yaml $(tag) == 'release_3_0' -input-file: stable/3.0/openapi.json +input-file: stable/v3.0/openapi.json ``` ### Release 2025-05-01-preview From 7f3aed61ff725a5f0a4838eba90dcf54f6e139a6 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Wed, 30 Apr 2025 18:48:41 -0700 Subject: [PATCH 043/119] Reverting version 3.0 to v3.0 --- .../translation/data-plane/Azure.AI.TextTranslation/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md index 7eb6d98f9a2e..db95cca902a8 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md @@ -42,7 +42,7 @@ require: $(this-folder)/../../../../profiles/readme.md # all the input files across all versions input-file: - - $(this-folder)/stable/3.0/openapi.json + - $(this-folder)/stable/v3.0/openapi.json - $(this-folder)/preview/2025-05-01-preview/openapi.json ``` From 5db7f7968f8a651b659a65b10e0d9e30a6d447b7 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 2 May 2025 15:54:04 -0700 Subject: [PATCH 044/119] Add GO SDK instructions --- .../Azure.AI.TextTranslation/readme.md | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md index db95cca902a8..cc6b303e865c 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md @@ -1,6 +1,6 @@ # Cognitive Services Translation Text SDK -> see https://aka.ms/autorest +> see for details on autorest Configuration for generating Translation Text SDK. @@ -12,9 +12,10 @@ add-credentials: true openapi-type: data-plane ``` -# Releases +## Releases ### Release 3.0 + These settings apply only when `--tag=release_3_0` is specified on the command line. ``` yaml $(tag) == 'release_3_0' @@ -22,6 +23,7 @@ input-file: stable/v3.0/openapi.json ``` ### Release 2025-05-01-preview + These settings apply only when `--tag=package-2025-05-01-preview` is specified on the command line. ``` yaml $(tag) == 'package-2025-05-01-preview' @@ -30,7 +32,7 @@ input-file: - preview/2025-05-01-preview/openapi.json ``` -## Multi-API/Profile support for AutoRest v3 generators +## Multi-API/Profile support for AutoRest v3 generators AutoRest V3 generators require the use of `--tag=all-api-versions` to select api files. @@ -46,10 +48,21 @@ input-file: - $(this-folder)/preview/2025-05-01-preview/openapi.json ``` -If there are files that should not be in the `all-api-versions` set, +If there are files that should not be in the `all-api-versions` set, uncomment the `exclude-file` section below and add the file paths. ``` yaml $(tag) == 'all-api-versions' #exclude-file: # - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json ``` + +## Swagger to SDK + +This section describes what SDK should be generated by the automatic system. +This is not used by Autorest itself. + +``` yaml $(swagger-to-sdk) +swagger-to-sdk: + - repo: azure-sdk-for-go + - repo: azure-sdk-for-net +``` From 6c1aed6498bcb1a1d103f5ab41e13912b5bf9e99 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 2 May 2025 16:24:01 -0700 Subject: [PATCH 045/119] Add GO SDK instructions --- .../data-plane/Azure.AI.TextTranslation/readme.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md index cc6b303e865c..70e0baf3a33d 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md @@ -2,7 +2,14 @@ > see for details on autorest -Configuration for generating Translation Text SDK. +This is the AutoRest configuration file for Translation Text SDK. + +> `autorest` + +To see additional help and options, run: + +> `autorest --help` +--- The current release is `package-2025-05-01-preview`. From 75b593caeb647941ac5592ce71c1f152c57003a7 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 2 May 2025 16:43:15 -0700 Subject: [PATCH 046/119] Add GO SDK instructions --- .../translation/data-plane/Azure.AI.TextTranslation/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md index 70e0baf3a33d..80591c179abf 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md @@ -1,6 +1,6 @@ # Cognitive Services Translation Text SDK -> see for details on autorest +> see https://aka.ms/autorest This is the AutoRest configuration file for Translation Text SDK. From 9871d8458437c0effdfbb74de0fb3d853b177d25 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 2 May 2025 16:57:04 -0700 Subject: [PATCH 047/119] Add GO SDK instructions --- .../data-plane/Azure.AI.TextTranslation/readme.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md index 80591c179abf..4d54540a1cc5 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md @@ -1,16 +1,5 @@ # Cognitive Services Translation Text SDK -> see https://aka.ms/autorest - -This is the AutoRest configuration file for Translation Text SDK. - -> `autorest` - -To see additional help and options, run: - -> `autorest --help` ---- - The current release is `package-2025-05-01-preview`. ``` yaml From fd081bb79b923b3b7931fb447e4d842db2b041e6 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 2 May 2025 17:17:24 -0700 Subject: [PATCH 048/119] Remove readme/openapi instructions --- .../data-plane/Azure.AI.TextTranslation/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md index 4d54540a1cc5..c83157f866e9 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md @@ -58,7 +58,7 @@ This section describes what SDK should be generated by the automatic system. This is not used by Autorest itself. ``` yaml $(swagger-to-sdk) -swagger-to-sdk: - - repo: azure-sdk-for-go - - repo: azure-sdk-for-net +#swagger-to-sdk: +# - repo: azure-sdk-for-go +# - repo: azure-sdk-for-net ``` From 69186867ba9091e5fb42966e397006d8dea5a764 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Sun, 4 May 2025 23:41:01 -0700 Subject: [PATCH 049/119] TUrn off autorest again --- .../Azure.AI.TextTranslation/tspconfig.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml b/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml index 1cc7a2693cec..de0ad3b46239 100644 --- a/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml +++ b/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml @@ -3,19 +3,19 @@ parameters: default: "sdk/translation" "dependencies": default: "" -emit: - - "@azure-tools/typespec-autorest" +#emit: +# - "@azure-tools/typespec-autorest" linter: extends: - "@azure-tools/typespec-azure-rulesets/data-plane" disable: "@azure-tools/typespec-azure-core/composition-over-inheritance": "New rule" options: - "@azure-tools/typespec-autorest": - azure-resource-provider-folder: "data-plane" - emit-lro-options: "none" - emitter-output-dir: "{project-root}/.." - output-file: "{azure-resource-provider-folder}/Azure.AI.TextTranslation/{version-status}/{version}/openapi.json" +# "@azure-tools/typespec-autorest": +# azure-resource-provider-folder: "data-plane" +# emit-lro-options: "none" +# emitter-output-dir: "{project-root}/.." +# output-file: "{azure-resource-provider-folder}/Azure.AI.TextTranslation/{version-status}/{version}/openapi.json" "@azure-tools/typespec-csharp": package-dir: "Azure.AI.Translation.Text" clear-output-folder: true From 3ac28337a4063f2de2e871b09e4aa0712cd0ff0f Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Sun, 4 May 2025 23:53:07 -0700 Subject: [PATCH 050/119] TUrn off autorest again --- .../data-plane/Azure.AI.TextTranslation/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md index c83157f866e9..4d54540a1cc5 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md @@ -58,7 +58,7 @@ This section describes what SDK should be generated by the automatic system. This is not used by Autorest itself. ``` yaml $(swagger-to-sdk) -#swagger-to-sdk: -# - repo: azure-sdk-for-go -# - repo: azure-sdk-for-net +swagger-to-sdk: + - repo: azure-sdk-for-go + - repo: azure-sdk-for-net ``` From e09521d5c4341d404efe212c041e3e4527cc2e62 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 5 May 2025 00:12:28 -0700 Subject: [PATCH 051/119] Remove readme/openapi instructions --- .../data-plane/Azure.AI.TextTranslation/readme.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md index 4d54540a1cc5..80591c179abf 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md @@ -1,5 +1,16 @@ # Cognitive Services Translation Text SDK +> see https://aka.ms/autorest + +This is the AutoRest configuration file for Translation Text SDK. + +> `autorest` + +To see additional help and options, run: + +> `autorest --help` +--- + The current release is `package-2025-05-01-preview`. ``` yaml From 4604da2eb0fd6bff4f4471a1206d384ae64d6374 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Wed, 7 May 2025 13:24:56 -0700 Subject: [PATCH 052/119] Add autorest emitter --- .../Azure.AI.TextTranslation/tspconfig.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml b/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml index de0ad3b46239..1cc7a2693cec 100644 --- a/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml +++ b/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml @@ -3,19 +3,19 @@ parameters: default: "sdk/translation" "dependencies": default: "" -#emit: -# - "@azure-tools/typespec-autorest" +emit: + - "@azure-tools/typespec-autorest" linter: extends: - "@azure-tools/typespec-azure-rulesets/data-plane" disable: "@azure-tools/typespec-azure-core/composition-over-inheritance": "New rule" options: -# "@azure-tools/typespec-autorest": -# azure-resource-provider-folder: "data-plane" -# emit-lro-options: "none" -# emitter-output-dir: "{project-root}/.." -# output-file: "{azure-resource-provider-folder}/Azure.AI.TextTranslation/{version-status}/{version}/openapi.json" + "@azure-tools/typespec-autorest": + azure-resource-provider-folder: "data-plane" + emit-lro-options: "none" + emitter-output-dir: "{project-root}/.." + output-file: "{azure-resource-provider-folder}/Azure.AI.TextTranslation/{version-status}/{version}/openapi.json" "@azure-tools/typespec-csharp": package-dir: "Azure.AI.Translation.Text" clear-output-folder: true From 886b567dcca3b6154900467fcd099942a7746b78 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Thu, 8 May 2025 12:55:08 -0700 Subject: [PATCH 053/119] Remove OpenAPI SDK generation --- .../data-plane/Azure.AI.TextTranslation/readme.md | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md index 80591c179abf..58418ab55572 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md @@ -61,15 +61,4 @@ uncomment the `exclude-file` section below and add the file paths. ``` yaml $(tag) == 'all-api-versions' #exclude-file: # - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json -``` - -## Swagger to SDK - -This section describes what SDK should be generated by the automatic system. -This is not used by Autorest itself. - -``` yaml $(swagger-to-sdk) -swagger-to-sdk: - - repo: azure-sdk-for-go - - repo: azure-sdk-for-net -``` +``` \ No newline at end of file From 6a8db16729098e13bc8cd1e3a1d69697e8cbbafd Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Thu, 8 May 2025 18:01:54 -0700 Subject: [PATCH 054/119] Fix v3 api to remove breaking change --- .../models-translate.tsp | 4 + .../Azure.AI.TextTranslation/routes.tsp | 14 ++ .../preview/2025-05-01-preview/openapi.json | 12 +- .../stable/v3.0/openapi.json | 191 +----------------- 4 files changed, 21 insertions(+), 200 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index 625bd6227a3d..872331436eb1 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -11,6 +11,7 @@ using Azure.Core; namespace TextTranslation; @doc("Request body parameters for the translate API.") +@added(APIVersion.v2025_05_01_preview) model TranslateBodyParameters { @doc(""" Details of the translate request @@ -134,6 +135,7 @@ model TranslateParameters { } @doc("Translate targets parameters") +@added(APIVersion.v2025_05_01_preview) model TranslateTarget { @doc(""" Specifies the language of the output text. The target language must be one of the supported languages included @@ -214,6 +216,7 @@ model TranslateTarget { } @doc("Request body parameters for the translate API.") +@added(APIVersion.v2025_05_01_preview) model TranslateBodyDetails { @doc(""" Specifies the text string to be translated in the translate API. @@ -249,6 +252,7 @@ model TranslateBodyDetails { } @doc("Reference sentence pair.") +@added(APIVersion.v2025_05_01_preview) model ReferenceSentencePair { @doc("Source reference sentence.") referenceTextPairsSource: string; diff --git a/specification/translation/Azure.AI.TextTranslation/routes.tsp b/specification/translation/Azure.AI.TextTranslation/routes.tsp index e353aff52925..ceed32bef9f6 100644 --- a/specification/translation/Azure.AI.TextTranslation/routes.tsp +++ b/specification/translation/Azure.AI.TextTranslation/routes.tsp @@ -46,11 +46,25 @@ op getSupportedLanguages is CustomGetOperation< >; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." +@removed(APIVersion.v2025_05_01_preview) @post @route("translate") @summary("Translate Text") @doc("Translate Text") op translate is CustomOperation< + InputTextItem[], + TranslateParameters, + TranslationResult, + ErrorResponse +>; + +#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." +@added(APIVersion.v2025_05_01_preview) +@post +@route("translate2") +@summary("Translate Text") +@doc("Translate Text") +op translate2 is CustomOperation< TranslateBodyDetails[], TranslateParameters, TranslationResult, diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json index 023b60a694fe..3c714a3f7632 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json @@ -108,9 +108,9 @@ } } }, - "/translate": { + "/translate2": { "post": { - "operationId": "Translate", + "operationId": "Translate2", "summary": "Translate Text", "description": "Translate Text", "parameters": [ @@ -182,14 +182,6 @@ } } } - }, - "x-ms-examples": { - "Translate Text": { - "$ref": "./examples/Translate_MaximumSet_Gen.json" - }, - "Translate Text with minimum properties": { - "$ref": "./examples/Translate_MinimumSet_Gen.json" - } } } }, diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json index e66833f6e092..c26b36483492 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json @@ -420,7 +420,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/TranslateBodyDetails" + "$ref": "#/definitions/InputTextItem" }, "x-ms-identifiers": [] } @@ -1014,24 +1014,6 @@ ] } }, - "ReferenceSentencePair": { - "type": "object", - "description": "Reference sentence pair.", - "properties": { - "referenceTextPairsSource": { - "type": "string", - "description": "Source reference sentence." - }, - "referenceTextPairsTarget": { - "type": "string", - "description": "Target reference sentence." - } - }, - "required": [ - "referenceTextPairsSource", - "referenceTextPairsTarget" - ] - }, "SentenceBoundaries": { "type": "object", "description": "An object returning sentence boundaries in the input and output texts.", @@ -1155,177 +1137,6 @@ ] } }, - "TranslateBodyDetails": { - "type": "object", - "description": "Request body parameters for the translate API.", - "properties": { - "text": { - "type": "string", - "description": "Specifies the text string to be translated in the translate API." - }, - "script": { - "type": "string", - "description": "Specifies the script of the input text." - }, - "language": { - "type": "string", - "description": "Specifies the language of the input text. Find which languages are available to translate by \nlooking up supported languages using the translation scope. If the language parameter isn't \nspecified, automatic language detection is applied to determine the source language.\n\nYou must use the language parameter rather than autodetection when using the dynamic dictionary feature. \nNote: the dynamic dictionary feature is case-sensitive." - }, - "textType": { - "type": "string", - "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", - "default": "Plain", - "enum": [ - "Plain", - "Html" - ], - "x-ms-enum": { - "name": "TextType", - "modelAsString": true, - "values": [ - { - "name": "Plain", - "value": "Plain", - "description": "Plain text." - }, - { - "name": "Html", - "value": "Html", - "description": "HTML-encoded text." - } - ] - } - } - }, - "required": [ - "text" - ] - }, - "TranslateBodyParameters": { - "type": "object", - "description": "Request body parameters for the translate API.", - "properties": { - "body": { - "$ref": "#/definitions/TranslateBodyDetails", - "description": "Details of the translate request" - } - }, - "required": [ - "body" - ] - }, - "TranslateTarget": { - "type": "object", - "description": "Translate targets parameters", - "properties": { - "language": { - "type": "array", - "description": "Specifies the language of the output text. The target language must be one of the supported languages included \nin the translation scope. It's possible to translate to multiple languages simultaneously by including \nmultiple string values in the targetsLanguage array.", - "items": { - "type": "string" - } - }, - "script": { - "type": "string", - "description": "Specifies the script of the translated text." - }, - "profanityAction": { - "type": "string", - "description": "Specifies how profanities should be treated in translations.\nPossible values are: NoAction (default), Marked or Deleted.", - "default": "NoAction", - "enum": [ - "NoAction", - "Marked", - "Deleted" - ], - "x-ms-enum": { - "name": "ProfanityAction", - "modelAsString": false, - "values": [ - { - "name": "NoAction", - "value": "NoAction", - "description": "No Action is taken on profanity" - }, - { - "name": "Marked", - "value": "Marked", - "description": "Profanity is marked." - }, - { - "name": "Deleted", - "value": "Deleted", - "description": "Profanity is deleted from the translated text." - } - ] - } - }, - "profanityMarker": { - "type": "string", - "description": "Specifies how profanities should be marked in translations.\nPossible values are: Asterisk (default) or Tag. ", - "default": "Asterisk", - "enum": [ - "Asterisk", - "Tag" - ], - "x-ms-enum": { - "name": "ProfanityMarker", - "modelAsString": false, - "values": [ - { - "name": "Asterisk", - "value": "Asterisk", - "description": "Profanity is marked with asterisk." - }, - { - "name": "Tag", - "value": "Tag", - "description": "Profanity is marked with the tags." - } - ] - } - }, - "deploymentNameModel": { - "type": "string", - "description": "Default is ‘general’, which uses NMT system.\n‘abc-inc-gpt-4o’, and ‘abc-inc-gpt-4o-mini’ are examples of deployment names which use GPT-4o uses or \nGPT-4o-mini model. ‘gpt-4o’ uses GPT-4o model. \n\n‘’ uses the custom NMT model tuned by customer.\n‘best’ system determines which is the best model to use for the request. This intelligence could be introduced\nin future. Customer should have deployed it in their resource.\n", - "default": "general" - }, - "allowFallback": { - "type": "boolean", - "description": "In the case where a custom system is being used, specifies that the service is allowed to fall back to a\ngeneral system when a custom system doesn't exist. \nIn the case where a Large Language Model is being used, specifies that the service is allowed to fall\nback to a Small Language Model if an error occurs.\nPossible values are: true (default) or false.\n\nallowFallback=false specifies that the translation should only use systems trained for the category specified \nby the request. If a translation for language X to language Y requires chaining through a pivot language E, \nthen all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. \nIf no system is found with the specific category, the request will return a 400 status code. allowFallback=true \nspecifies that the service is allowed to fall back to a general system when a custom system doesn't exist.", - "default": true - }, - "grade": { - "type": "string", - "description": "Defines complexity of LLM prompts to provide high accuracy translation.", - "default": "basic" - }, - "tone": { - "type": "string", - "description": "Desired tone of target translation." - }, - "gender": { - "type": "string", - "description": "Desired gender of target translation." - }, - "adaptiveDatasetId": { - "type": "string", - "description": "Reference dataset ID having sentence pair to generate adaptive customized translation." - }, - "referenceTextPairs": { - "type": "array", - "description": "Reference sentence pairs to generate adaptive results.", - "maxItems": 5, - "items": { - "$ref": "#/definitions/ReferenceSentencePair" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "language" - ] - }, "TranslatedTextAlignment": { "type": "object", "description": "Alignment information object.", From e379194b600c8199132ff7bad606d8ab4c7b7a6e Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 9 May 2025 00:17:16 -0700 Subject: [PATCH 055/119] Fix v3 api to remove breaking change --- ...en.json => Translate2_MaximumSet_Gen.json} | 2 +- ...en.json => Translate2_MinimumSet_Gen.json} | 2 +- .../examples/Translate2_MaximumSet_Gen.json | 63 +++++++++++++++++++ .../examples/Translate2_MinimumSet_Gen.json | 33 ++++++++++ .../preview/2025-05-01-preview/openapi.json | 8 +++ 5 files changed, 106 insertions(+), 2 deletions(-) rename specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/{Translate_MaximumSet_Gen.json => Translate2_MaximumSet_Gen.json} (97%) rename specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/{Translate_MinimumSet_Gen.json => Translate2_MinimumSet_Gen.json} (94%) create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MaximumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MinimumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate2_MaximumSet_Gen.json similarity index 97% rename from specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate2_MaximumSet_Gen.json index 1f0f56b92ecc..1dc163624052 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate2_MaximumSet_Gen.json @@ -1,6 +1,6 @@ { "title": "Translate Text", - "operationId": "Translate", + "operationId": "Translate2", "parameters": { "X-ClientTraceId": "ndbkaatzsnoetqkiehappoza", "api-version": "2025-05-01-preview", diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate2_MinimumSet_Gen.json similarity index 94% rename from specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate2_MinimumSet_Gen.json index d22bf9d8e56a..945c96eaba73 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate2_MinimumSet_Gen.json @@ -1,6 +1,6 @@ { "title": "Translate Text with minimum properties", - "operationId": "Translate", + "operationId": "Translate2", "parameters": { "api-version": "2025-05-01-preview", "body": [ diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MaximumSet_Gen.json new file mode 100644 index 000000000000..1dc163624052 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MaximumSet_Gen.json @@ -0,0 +1,63 @@ +{ + "title": "Translate Text", + "operationId": "Translate2", + "parameters": { + "X-ClientTraceId": "ndbkaatzsnoetqkiehappoza", + "api-version": "2025-05-01-preview", + "body": [ + { + "text": "This is a test.", + "script": "Latn", + "language": "en", + "textType": "Plain", + "targets": [ + { + "language": [ + "cs" + ], + "script": "Latn", + "profanityAction": "NoAction", + "profanityMarker": "Asterisk", + "deploymentNameModel": "general", + "allowFallback": true, + "grade": "basic", + "tone": "formal", + "gender": "neutral", + "adaptiveDatasetId": "21000", + "referenceTextPairs": [ + { + "referenceTextPairsSource": "Please test this out.", + "referenceTextPairsTarget": "Vyzkoušejte si to." + } + ] + } + ] + } + ] + }, + "responses": { + "200": { + "body": [ + { + "detectedLanguage": { + "language": "en", + "score": 1.0 + }, + "translations": [ + { + "to": "cs", + "text": "Tohle je test.", + "transliteration": { + "text": "Tohle je test.", + "script": "Latn" + } + } + ], + "sourceText": { + "text": "This is a test" + } + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MinimumSet_Gen.json new file mode 100644 index 000000000000..945c96eaba73 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MinimumSet_Gen.json @@ -0,0 +1,33 @@ +{ + "title": "Translate Text with minimum properties", + "operationId": "Translate2", + "parameters": { + "api-version": "2025-05-01-preview", + "body": [ + { + "text": "This is a test.", + "targets": [ + { + "language": [ + "cs" + ] + } + ] + } + ] + }, + "responses": { + "200": { + "body": [ + { + "translations": [ + { + "text": "Tohle je test.", + "to": "cs" + } + ] + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json index 3c714a3f7632..456f90e30be2 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json @@ -182,6 +182,14 @@ } } } + }, + "x-ms-examples": { + "Translate Text": { + "$ref": "./examples/Translate2_MaximumSet_Gen.json" + }, + "Translate Text with minimum properties": { + "$ref": "./examples/Translate2_MinimumSet_Gen.json" + } } } }, From 4b3fc2f03d9ae39ab5bd71f1d680288c24bc74e0 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 9 May 2025 00:20:51 -0700 Subject: [PATCH 056/119] Fix v3 api to remove breaking change --- .../examples/Translate_MaximumSet_Gen.json | 63 ------------------- .../examples/Translate_MinimumSet_Gen.json | 33 ---------- 2 files changed, 96 deletions(-) delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json deleted file mode 100644 index 1f0f56b92ecc..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "title": "Translate Text", - "operationId": "Translate", - "parameters": { - "X-ClientTraceId": "ndbkaatzsnoetqkiehappoza", - "api-version": "2025-05-01-preview", - "body": [ - { - "text": "This is a test.", - "script": "Latn", - "language": "en", - "textType": "Plain", - "targets": [ - { - "language": [ - "cs" - ], - "script": "Latn", - "profanityAction": "NoAction", - "profanityMarker": "Asterisk", - "deploymentNameModel": "general", - "allowFallback": true, - "grade": "basic", - "tone": "formal", - "gender": "neutral", - "adaptiveDatasetId": "21000", - "referenceTextPairs": [ - { - "referenceTextPairsSource": "Please test this out.", - "referenceTextPairsTarget": "Vyzkoušejte si to." - } - ] - } - ] - } - ] - }, - "responses": { - "200": { - "body": [ - { - "detectedLanguage": { - "language": "en", - "score": 1.0 - }, - "translations": [ - { - "to": "cs", - "text": "Tohle je test.", - "transliteration": { - "text": "Tohle je test.", - "script": "Latn" - } - } - ], - "sourceText": { - "text": "This is a test" - } - } - ] - } - } -} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json deleted file mode 100644 index d22bf9d8e56a..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "title": "Translate Text with minimum properties", - "operationId": "Translate", - "parameters": { - "api-version": "2025-05-01-preview", - "body": [ - { - "text": "This is a test.", - "targets": [ - { - "language": [ - "cs" - ] - } - ] - } - ] - }, - "responses": { - "200": { - "body": [ - { - "translations": [ - { - "text": "Tohle je test.", - "to": "cs" - } - ] - } - ] - } - } -} From 5f13e1884f53cbe9cac20729eca523e9b64a8057 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 9 May 2025 15:34:28 -0700 Subject: [PATCH 057/119] Unify v3 and 2025_05_01 body model --- .../models-shared.tsp | 32 ++++++++++ .../models-translate.tsp | 10 ---- .../Azure.AI.TextTranslation/routes.tsp | 14 ----- .../preview/2025-05-01-preview/openapi.json | 59 ++++++++++++++----- 4 files changed, 76 insertions(+), 39 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-shared.tsp b/specification/translation/Azure.AI.TextTranslation/models-shared.tsp index 87df889e0c2b..5394bf6f18b3 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-shared.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-shared.tsp @@ -3,6 +3,7 @@ import "@azure-tools/typespec-azure-core"; using TypeSpec.Http; using TypeSpec.Rest; +using TypeSpec.Versioning; using Azure.Core; namespace TextTranslation; @@ -19,6 +20,37 @@ alias CommonParameters = { model InputTextItem { @doc("Text to translate.") text: string; + + @added(APIVersion.v2025_05_01_preview) + @doc(""" + Specifies the script of the input text. + """) + script?: string; + + @added(APIVersion.v2025_05_01_preview) + @doc(""" + Specifies the language of the input text. Find which languages are available to translate by + looking up supported languages using the translation scope. If the language parameter isn't + specified, automatic language detection is applied to determine the source language. + + You must use the language parameter rather than autodetection when using the dynamic dictionary feature. + Note: the dynamic dictionary feature is case-sensitive. + """) + language?: string; + + @added(APIVersion.v2025_05_01_preview) + @doc(""" + Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, + complete element. Possible values are: plain (default) or html. + """) + textType?: TextType = "Plain"; + + @added(APIVersion.v2025_05_01_preview) + @doc(""" + Translation target parameters. + """) + targets: TranslateTarget[]; + } alias CommonResultHeaders = { diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index 872331436eb1..1f017ee62a2e 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -10,16 +10,6 @@ using Azure.Core; namespace TextTranslation; -@doc("Request body parameters for the translate API.") -@added(APIVersion.v2025_05_01_preview) -model TranslateBodyParameters { - @doc(""" - Details of the translate request - """) - @body - body: TranslateBodyDetails; -} - @doc("Request parameters for the translate API.") model TranslateParameters { ...CommonParameters; diff --git a/specification/translation/Azure.AI.TextTranslation/routes.tsp b/specification/translation/Azure.AI.TextTranslation/routes.tsp index ceed32bef9f6..ece38e7c64b6 100644 --- a/specification/translation/Azure.AI.TextTranslation/routes.tsp +++ b/specification/translation/Azure.AI.TextTranslation/routes.tsp @@ -46,7 +46,6 @@ op getSupportedLanguages is CustomGetOperation< >; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." -@removed(APIVersion.v2025_05_01_preview) @post @route("translate") @summary("Translate Text") @@ -58,19 +57,6 @@ op translate is CustomOperation< ErrorResponse >; -#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." -@added(APIVersion.v2025_05_01_preview) -@post -@route("translate2") -@summary("Translate Text") -@doc("Translate Text") -op translate2 is CustomOperation< - TranslateBodyDetails[], - TranslateParameters, - TranslationResult, - ErrorResponse ->; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." @post @route("transliterate") diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json index 456f90e30be2..990322b04143 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json @@ -138,7 +138,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/TranslateBodyDetails" + "$ref": "#/definitions/InputTextItem" }, "x-ms-identifiers": [] } @@ -365,10 +365,52 @@ "text": { "type": "string", "description": "Text to translate." + }, + "script": { + "type": "string", + "description": "Specifies the script of the input text." + }, + "language": { + "type": "string", + "description": "Specifies the language of the input text. Find which languages are available to translate by \nlooking up supported languages using the translation scope. If the language parameter isn't \nspecified, automatic language detection is applied to determine the source language.\n\nYou must use the language parameter rather than autodetection when using the dynamic dictionary feature. \nNote: the dynamic dictionary feature is case-sensitive." + }, + "textType": { + "type": "string", + "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", + "default": "Plain", + "enum": [ + "Plain", + "Html" + ], + "x-ms-enum": { + "name": "TextType", + "modelAsString": true, + "values": [ + { + "name": "Plain", + "value": "Plain", + "description": "Plain text." + }, + { + "name": "Html", + "value": "Html", + "description": "HTML-encoded text." + } + ] + } + }, + "targets": { + "type": "array", + "description": "Translation target parameters.", + "items": { + "$ref": "#/definitions/TranslateTarget" + }, + "x-ms-identifiers": [] } }, "required": [ - "text" + "text", + "targets" ] }, "LanguageDirectionality": { @@ -647,19 +689,6 @@ "targets" ] }, - "TranslateBodyParameters": { - "type": "object", - "description": "Request body parameters for the translate API.", - "properties": { - "body": { - "$ref": "#/definitions/TranslateBodyDetails", - "description": "Details of the translate request" - } - }, - "required": [ - "body" - ] - }, "TranslateParameters": { "type": "object", "description": "Request parameters for the translate API." From 8d42d2e92f9797f18949a175488173e83b6e0d99 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 9 May 2025 15:39:17 -0700 Subject: [PATCH 058/119] Unify v3 and 2025_05_01 body model --- ...anslate2_MaximumSet_Gen.json => Translate_MaximumSet_Gen.json} | 0 ...anslate2_MinimumSet_Gen.json => Translate_MinimumSet_Gen.json} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/{Translate2_MaximumSet_Gen.json => Translate_MaximumSet_Gen.json} (100%) rename specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/{Translate2_MinimumSet_Gen.json => Translate_MinimumSet_Gen.json} (100%) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json similarity index 100% rename from specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MaximumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json similarity index 100% rename from specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MinimumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json From 37a0c4229344cf53644f0c2422d2111cc20fe97a Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 9 May 2025 15:42:23 -0700 Subject: [PATCH 059/119] Unify v3 and 2025_05_01 body model --- .../preview/2025-05-01-preview/openapi.json | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json index 990322b04143..f9ff9dbfbc0a 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json @@ -108,9 +108,9 @@ } } }, - "/translate2": { + "/translate": { "post": { - "operationId": "Translate2", + "operationId": "Translate", "summary": "Translate Text", "description": "Translate Text", "parameters": [ @@ -182,14 +182,6 @@ } } } - }, - "x-ms-examples": { - "Translate Text": { - "$ref": "./examples/Translate2_MaximumSet_Gen.json" - }, - "Translate Text with minimum properties": { - "$ref": "./examples/Translate2_MinimumSet_Gen.json" - } } } }, From 55f21c10a618a9e5a6bf2f3b675b0e9d12340724 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 9 May 2025 15:45:40 -0700 Subject: [PATCH 060/119] Unify v3 and 2025_05_01 body model --- .../Translate2_MaximumSet_Gen.json | 2 +- .../Translate2_MinimumSet_Gen.json | 2 +- .../examples/Translate2_MaximumSet_Gen.json | 63 +++++++++++++++++++ .../examples/Translate2_MinimumSet_Gen.json | 33 ++++++++++ .../examples/Translate_MaximumSet_Gen.json | 2 +- .../examples/Translate_MinimumSet_Gen.json | 2 +- .../preview/2025-05-01-preview/openapi.json | 8 +++ 7 files changed, 108 insertions(+), 4 deletions(-) create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MaximumSet_Gen.json create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MinimumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate2_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate2_MaximumSet_Gen.json index 1dc163624052..1f0f56b92ecc 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate2_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate2_MaximumSet_Gen.json @@ -1,6 +1,6 @@ { "title": "Translate Text", - "operationId": "Translate2", + "operationId": "Translate", "parameters": { "X-ClientTraceId": "ndbkaatzsnoetqkiehappoza", "api-version": "2025-05-01-preview", diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate2_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate2_MinimumSet_Gen.json index 945c96eaba73..d22bf9d8e56a 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate2_MinimumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate2_MinimumSet_Gen.json @@ -1,6 +1,6 @@ { "title": "Translate Text with minimum properties", - "operationId": "Translate2", + "operationId": "Translate", "parameters": { "api-version": "2025-05-01-preview", "body": [ diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MaximumSet_Gen.json new file mode 100644 index 000000000000..1f0f56b92ecc --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MaximumSet_Gen.json @@ -0,0 +1,63 @@ +{ + "title": "Translate Text", + "operationId": "Translate", + "parameters": { + "X-ClientTraceId": "ndbkaatzsnoetqkiehappoza", + "api-version": "2025-05-01-preview", + "body": [ + { + "text": "This is a test.", + "script": "Latn", + "language": "en", + "textType": "Plain", + "targets": [ + { + "language": [ + "cs" + ], + "script": "Latn", + "profanityAction": "NoAction", + "profanityMarker": "Asterisk", + "deploymentNameModel": "general", + "allowFallback": true, + "grade": "basic", + "tone": "formal", + "gender": "neutral", + "adaptiveDatasetId": "21000", + "referenceTextPairs": [ + { + "referenceTextPairsSource": "Please test this out.", + "referenceTextPairsTarget": "Vyzkoušejte si to." + } + ] + } + ] + } + ] + }, + "responses": { + "200": { + "body": [ + { + "detectedLanguage": { + "language": "en", + "score": 1.0 + }, + "translations": [ + { + "to": "cs", + "text": "Tohle je test.", + "transliteration": { + "text": "Tohle je test.", + "script": "Latn" + } + } + ], + "sourceText": { + "text": "This is a test" + } + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MinimumSet_Gen.json new file mode 100644 index 000000000000..d22bf9d8e56a --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MinimumSet_Gen.json @@ -0,0 +1,33 @@ +{ + "title": "Translate Text with minimum properties", + "operationId": "Translate", + "parameters": { + "api-version": "2025-05-01-preview", + "body": [ + { + "text": "This is a test.", + "targets": [ + { + "language": [ + "cs" + ] + } + ] + } + ] + }, + "responses": { + "200": { + "body": [ + { + "translations": [ + { + "text": "Tohle je test.", + "to": "cs" + } + ] + } + ] + } + } +} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json index 1dc163624052..1f0f56b92ecc 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json @@ -1,6 +1,6 @@ { "title": "Translate Text", - "operationId": "Translate2", + "operationId": "Translate", "parameters": { "X-ClientTraceId": "ndbkaatzsnoetqkiehappoza", "api-version": "2025-05-01-preview", diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json index 945c96eaba73..d22bf9d8e56a 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json @@ -1,6 +1,6 @@ { "title": "Translate Text with minimum properties", - "operationId": "Translate2", + "operationId": "Translate", "parameters": { "api-version": "2025-05-01-preview", "body": [ diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json index f9ff9dbfbc0a..b8e78b2b1aec 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json @@ -182,6 +182,14 @@ } } } + }, + "x-ms-examples": { + "Translate Text": { + "$ref": "./examples/Translate2_MaximumSet_Gen.json" + }, + "Translate Text with minimum properties": { + "$ref": "./examples/Translate2_MinimumSet_Gen.json" + } } } }, From c8589738b0978d74de89455522d1e8d311e1a4ba Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 9 May 2025 16:07:30 -0700 Subject: [PATCH 061/119] Fix examples --- ...Gen.json => Translate_MaximumSet_Gen.json} | 0 ...Gen.json => Translate_MinimumSet_Gen.json} | 0 .../examples/Translate2_MaximumSet_Gen.json | 63 ------------------- .../examples/Translate2_MinimumSet_Gen.json | 33 ---------- .../preview/2025-05-01-preview/openapi.json | 4 +- 5 files changed, 2 insertions(+), 98 deletions(-) rename specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/{Translate2_MaximumSet_Gen.json => Translate_MaximumSet_Gen.json} (100%) rename specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/{Translate2_MinimumSet_Gen.json => Translate_MinimumSet_Gen.json} (100%) delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MaximumSet_Gen.json delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MinimumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate2_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate2_MaximumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate2_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate2_MinimumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MaximumSet_Gen.json deleted file mode 100644 index 1f0f56b92ecc..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MaximumSet_Gen.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "title": "Translate Text", - "operationId": "Translate", - "parameters": { - "X-ClientTraceId": "ndbkaatzsnoetqkiehappoza", - "api-version": "2025-05-01-preview", - "body": [ - { - "text": "This is a test.", - "script": "Latn", - "language": "en", - "textType": "Plain", - "targets": [ - { - "language": [ - "cs" - ], - "script": "Latn", - "profanityAction": "NoAction", - "profanityMarker": "Asterisk", - "deploymentNameModel": "general", - "allowFallback": true, - "grade": "basic", - "tone": "formal", - "gender": "neutral", - "adaptiveDatasetId": "21000", - "referenceTextPairs": [ - { - "referenceTextPairsSource": "Please test this out.", - "referenceTextPairsTarget": "Vyzkoušejte si to." - } - ] - } - ] - } - ] - }, - "responses": { - "200": { - "body": [ - { - "detectedLanguage": { - "language": "en", - "score": 1.0 - }, - "translations": [ - { - "to": "cs", - "text": "Tohle je test.", - "transliteration": { - "text": "Tohle je test.", - "script": "Latn" - } - } - ], - "sourceText": { - "text": "This is a test" - } - } - ] - } - } -} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MinimumSet_Gen.json deleted file mode 100644 index d22bf9d8e56a..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate2_MinimumSet_Gen.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "title": "Translate Text with minimum properties", - "operationId": "Translate", - "parameters": { - "api-version": "2025-05-01-preview", - "body": [ - { - "text": "This is a test.", - "targets": [ - { - "language": [ - "cs" - ] - } - ] - } - ] - }, - "responses": { - "200": { - "body": [ - { - "translations": [ - { - "text": "Tohle je test.", - "to": "cs" - } - ] - } - ] - } - } -} diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json index b8e78b2b1aec..451e7dd79cb5 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json @@ -185,10 +185,10 @@ }, "x-ms-examples": { "Translate Text": { - "$ref": "./examples/Translate2_MaximumSet_Gen.json" + "$ref": "./examples/Translate_MaximumSet_Gen.json" }, "Translate Text with minimum properties": { - "$ref": "./examples/Translate2_MinimumSet_Gen.json" + "$ref": "./examples/Translate_MinimumSet_Gen.json" } } } From 34b8984dd0610923642527b2b1bfe69fd8fbfac9 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 9 May 2025 16:24:15 -0700 Subject: [PATCH 062/119] Fix examples --- .../translation/Azure.AI.TextTranslation/models-shared.tsp | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-shared.tsp b/specification/translation/Azure.AI.TextTranslation/models-shared.tsp index 5394bf6f18b3..533715faf8a6 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-shared.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-shared.tsp @@ -50,7 +50,6 @@ model InputTextItem { Translation target parameters. """) targets: TranslateTarget[]; - } alias CommonResultHeaders = { From 3e96f4960bbc50b11f095b630f9202700bc144e1 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 9 May 2025 16:52:53 -0700 Subject: [PATCH 063/119] Fix examples --- .../models-shared.tsp | 7 ++ .../Azure.AI.TextTranslation/routes.tsp | 2 +- .../preview/2025-05-01-preview/openapi.json | 106 ++++++++++-------- .../stable/v3.0/openapi.json | 20 +++- 4 files changed, 89 insertions(+), 46 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-shared.tsp b/specification/translation/Azure.AI.TextTranslation/models-shared.tsp index 533715faf8a6..e23c4202493c 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-shared.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-shared.tsp @@ -16,10 +16,17 @@ alias CommonParameters = { clientTraceId?: string; }; + @doc("Element containing the text for translation.") model InputTextItem { @doc("Text to translate.") text: string; +} + +@doc("Element containing the text for translation.") +model TranslateBody extends InputTextItem { + @doc("Text to translate.") + text: string; @added(APIVersion.v2025_05_01_preview) @doc(""" diff --git a/specification/translation/Azure.AI.TextTranslation/routes.tsp b/specification/translation/Azure.AI.TextTranslation/routes.tsp index ece38e7c64b6..8cd9da371aa3 100644 --- a/specification/translation/Azure.AI.TextTranslation/routes.tsp +++ b/specification/translation/Azure.AI.TextTranslation/routes.tsp @@ -51,7 +51,7 @@ op getSupportedLanguages is CustomGetOperation< @summary("Translate Text") @doc("Translate Text") op translate is CustomOperation< - InputTextItem[], + TranslateBody[], TranslateParameters, TranslationResult, ErrorResponse diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json index 451e7dd79cb5..082c813094d6 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json @@ -138,7 +138,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/InputTextItem" + "$ref": "#/definitions/TranslateBody" }, "x-ms-identifiers": [] } @@ -365,52 +365,10 @@ "text": { "type": "string", "description": "Text to translate." - }, - "script": { - "type": "string", - "description": "Specifies the script of the input text." - }, - "language": { - "type": "string", - "description": "Specifies the language of the input text. Find which languages are available to translate by \nlooking up supported languages using the translation scope. If the language parameter isn't \nspecified, automatic language detection is applied to determine the source language.\n\nYou must use the language parameter rather than autodetection when using the dynamic dictionary feature. \nNote: the dynamic dictionary feature is case-sensitive." - }, - "textType": { - "type": "string", - "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", - "default": "Plain", - "enum": [ - "Plain", - "Html" - ], - "x-ms-enum": { - "name": "TextType", - "modelAsString": true, - "values": [ - { - "name": "Plain", - "value": "Plain", - "description": "Plain text." - }, - { - "name": "Html", - "value": "Html", - "description": "HTML-encoded text." - } - ] - } - }, - "targets": { - "type": "array", - "description": "Translation target parameters.", - "items": { - "$ref": "#/definitions/TranslateTarget" - }, - "x-ms-identifiers": [] } }, "required": [ - "text", - "targets" + "text" ] }, "LanguageDirectionality": { @@ -634,6 +592,66 @@ ] } }, + "TranslateBody": { + "type": "object", + "description": "Element containing the text for translation.", + "properties": { + "text": { + "type": "string", + "description": "Text to translate." + }, + "script": { + "type": "string", + "description": "Specifies the script of the input text." + }, + "language": { + "type": "string", + "description": "Specifies the language of the input text. Find which languages are available to translate by \nlooking up supported languages using the translation scope. If the language parameter isn't \nspecified, automatic language detection is applied to determine the source language.\n\nYou must use the language parameter rather than autodetection when using the dynamic dictionary feature. \nNote: the dynamic dictionary feature is case-sensitive." + }, + "textType": { + "type": "string", + "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", + "default": "Plain", + "enum": [ + "Plain", + "Html" + ], + "x-ms-enum": { + "name": "TextType", + "modelAsString": true, + "values": [ + { + "name": "Plain", + "value": "Plain", + "description": "Plain text." + }, + { + "name": "Html", + "value": "Html", + "description": "HTML-encoded text." + } + ] + } + }, + "targets": { + "type": "array", + "description": "Translation target parameters.", + "items": { + "$ref": "#/definitions/TranslateTarget" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "text", + "targets" + ], + "allOf": [ + { + "$ref": "#/definitions/InputTextItem" + } + ] + }, "TranslateBodyDetails": { "type": "object", "description": "Request body parameters for the translate API.", diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json index c26b36483492..1ba449ef5558 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json @@ -420,7 +420,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/InputTextItem" + "$ref": "#/definitions/TranslateBody" }, "x-ms-identifiers": [] } @@ -1137,6 +1137,24 @@ ] } }, + "TranslateBody": { + "type": "object", + "description": "Element containing the text for translation.", + "properties": { + "text": { + "type": "string", + "description": "Text to translate." + } + }, + "required": [ + "text" + ], + "allOf": [ + { + "$ref": "#/definitions/InputTextItem" + } + ] + }, "TranslatedTextAlignment": { "type": "object", "description": "Alignment information object.", From 21306bbdf8ab68c11fca3b38445bfa1facd177e1 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 9 May 2025 16:57:51 -0700 Subject: [PATCH 064/119] Fix examples --- .../translation/Azure.AI.TextTranslation/models-shared.tsp | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-shared.tsp b/specification/translation/Azure.AI.TextTranslation/models-shared.tsp index e23c4202493c..f52c2fcb69aa 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-shared.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-shared.tsp @@ -16,7 +16,6 @@ alias CommonParameters = { clientTraceId?: string; }; - @doc("Element containing the text for translation.") model InputTextItem { @doc("Text to translate.") From aee437872eeb36ff3ea20d709f8c05f4e467635d Mon Sep 17 00:00:00 2001 From: Eugenia Date: Fri, 9 May 2025 20:00:50 -0700 Subject: [PATCH 065/119] Adding swagger-to-sdk block --- .../data-plane/Azure.AI.TextTranslation/readme.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md index 58418ab55572..23b6ebc08665 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md @@ -19,6 +19,20 @@ add-credentials: true openapi-type: data-plane ``` +# Code Generation + +## Swagger to SDK + +This section describes what SDK should be generated by the automatic system. +This is not used by Autorest itself. + +```yaml $(swagger-to-sdk) +swagger-to-sdk: + - repo: azure-sdk-for-java + - repo: azure-sdk-for-go + - repo: azure-sdk-for-js +``` + ## Releases ### Release 3.0 From 2e821a7cb26150584b0417a91cbc7bb8c2dbfc84 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 12 May 2025 17:49:19 -0700 Subject: [PATCH 066/119] Remove 3.0 --- specification/translation/Azure.AI.TextTranslation/main.tsp | 3 --- 1 file changed, 3 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/main.tsp b/specification/translation/Azure.AI.TextTranslation/main.tsp index 4ef6b176604d..df9936af9378 100644 --- a/specification/translation/Azure.AI.TextTranslation/main.tsp +++ b/specification/translation/Azure.AI.TextTranslation/main.tsp @@ -39,9 +39,6 @@ namespace TextTranslation; @doc("Text Translation supported versions") enum APIVersion { - @doc("Version 3.0") - v3_0: "v3.0", - @doc("Version 2025-05-01") v2025_05_01_preview: "2025-05-01-preview", } From d5505717eab2b99dbcfdf7fcc977af5b61dee50f Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 12 May 2025 22:28:47 -0700 Subject: [PATCH 067/119] add 3.0 --- specification/translation/Azure.AI.TextTranslation/main.tsp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/specification/translation/Azure.AI.TextTranslation/main.tsp b/specification/translation/Azure.AI.TextTranslation/main.tsp index df9936af9378..4ef6b176604d 100644 --- a/specification/translation/Azure.AI.TextTranslation/main.tsp +++ b/specification/translation/Azure.AI.TextTranslation/main.tsp @@ -39,6 +39,9 @@ namespace TextTranslation; @doc("Text Translation supported versions") enum APIVersion { + @doc("Version 3.0") + v3_0: "v3.0", + @doc("Version 2025-05-01") v2025_05_01_preview: "2025-05-01-preview", } From c49c8f332887cc72b1dab34c6d0ebcaeec9e95bc Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 12 May 2025 22:43:59 -0700 Subject: [PATCH 068/119] Remove Go --- .../translation/Azure.AI.TextTranslation/tspconfig.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml b/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml index 1cc7a2693cec..59de2f6e9f65 100644 --- a/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml +++ b/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml @@ -44,11 +44,3 @@ options: name: "@azure-rest/ai-translation-text" description: "Microsoft Translation Text" flavor: azure - "@azure-tools/typespec-go": - module: "github.com/Azure/azure-sdk-for-go/{service-dir}/{package-dir}" - service-dir: "sdk/translation" - package-dir: "azure-ai-translation-text" - generate-samples: true - generate-fakes: true - head-as-boolean: true - inject-spans: true From 1b94ded8fbc174386df38e49fdeacaa4a057677a Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 12 May 2025 23:51:35 -0700 Subject: [PATCH 069/119] Remove go sdk --- .../Azure.AI.DocumentTranslation/tspconfig.yaml | 8 -------- .../data-plane/Azure.AI.TextTranslation/readme.md | 14 -------------- 2 files changed, 22 deletions(-) diff --git a/specification/translation/Azure.AI.DocumentTranslation/tspconfig.yaml b/specification/translation/Azure.AI.DocumentTranslation/tspconfig.yaml index 721c01df2df1..7cc2b6fd3191 100644 --- a/specification/translation/Azure.AI.DocumentTranslation/tspconfig.yaml +++ b/specification/translation/Azure.AI.DocumentTranslation/tspconfig.yaml @@ -49,11 +49,3 @@ options: description: "Microsoft Translation Document" flavor: azure generate-sample-project: false - "@azure-tools/typespec-go": - module: "github.com/Azure/azure-sdk-for-go/{service-dir}/{package-dir}" - service-dir: "sdk/translation" - package-dir: "azure-ai-translation-document" - generate-samples: true - generate-fakes: true - head-as-boolean: true - inject-spans: true diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md index 23b6ebc08665..58418ab55572 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md @@ -19,20 +19,6 @@ add-credentials: true openapi-type: data-plane ``` -# Code Generation - -## Swagger to SDK - -This section describes what SDK should be generated by the automatic system. -This is not used by Autorest itself. - -```yaml $(swagger-to-sdk) -swagger-to-sdk: - - repo: azure-sdk-for-java - - repo: azure-sdk-for-go - - repo: azure-sdk-for-js -``` - ## Releases ### Release 3.0 From 5ce23426f0ee8a4860cd0d98b2bb6945860dcb86 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 13 Jun 2025 13:19:04 -0700 Subject: [PATCH 070/119] More cleanup --- ...FindSentenceBoundaries_MaximumSet_Gen.json | 2 +- ...FindSentenceBoundaries_MinimumSet_Gen.json | 2 +- .../GetSupportedLanguages_MaximumSet_Gen.json | 2 +- .../GetSupportedLanguages_MinimumSet_Gen.json | 2 +- ...ookupDictionaryEntries_MaximumSet_Gen.json | 2 +- ...ookupDictionaryEntries_MinimumSet_Gen.json | 2 +- ...okupDictionaryExamples_MaximumSet_Gen.json | 2 +- ...okupDictionaryExamples_MinimumSet_Gen.json | 2 +- .../v3.0/Translate_MaximumSet_Gen.json | 2 +- .../v3.0/Translate_MinimumSet_Gen.json | 2 +- .../v3.0/Transliterate_MaximumSet_Gen.json | 2 +- .../v3.0/Transliterate_MinimumSet_Gen.json | 2 +- .../Azure.AI.TextTranslation/main.tsp | 2 +- .../Azure.AI.TextTranslation/tspconfig.yaml | 2 +- .../GetSupportedLanguages_MaximumSet_Gen.json | 0 .../GetSupportedLanguages_MinimumSet_Gen.json | 0 .../examples/Translate_MaximumSet_Gen.json | 0 .../examples/Translate_MinimumSet_Gen.json | 0 .../Transliterate_MaximumSet_Gen.json | 0 .../Transliterate_MinimumSet_Gen.json | 0 .../openapi.json | 0 .../stable/v3.0/openapi.json | 50 +------------------ 22 files changed, 15 insertions(+), 63 deletions(-) rename specification/translation/data-plane/Azure.AI.TextTranslation/preview/{2025-05-01-preview => v2025-05-01-preview}/examples/GetSupportedLanguages_MaximumSet_Gen.json (100%) rename specification/translation/data-plane/Azure.AI.TextTranslation/preview/{2025-05-01-preview => v2025-05-01-preview}/examples/GetSupportedLanguages_MinimumSet_Gen.json (100%) rename specification/translation/data-plane/Azure.AI.TextTranslation/preview/{2025-05-01-preview => v2025-05-01-preview}/examples/Translate_MaximumSet_Gen.json (100%) rename specification/translation/data-plane/Azure.AI.TextTranslation/preview/{2025-05-01-preview => v2025-05-01-preview}/examples/Translate_MinimumSet_Gen.json (100%) rename specification/translation/data-plane/Azure.AI.TextTranslation/preview/{2025-05-01-preview => v2025-05-01-preview}/examples/Transliterate_MaximumSet_Gen.json (100%) rename specification/translation/data-plane/Azure.AI.TextTranslation/preview/{2025-05-01-preview => v2025-05-01-preview}/examples/Transliterate_MinimumSet_Gen.json (100%) rename specification/translation/data-plane/Azure.AI.TextTranslation/preview/{2025-05-01-preview => v2025-05-01-preview}/openapi.json (100%) diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/FindSentenceBoundaries_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/FindSentenceBoundaries_MaximumSet_Gen.json index ce515a0ed2e8..1847c3f5e3d3 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/FindSentenceBoundaries_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/FindSentenceBoundaries_MaximumSet_Gen.json @@ -5,7 +5,7 @@ "X-ClientTraceId": "svun", "language": "en", "script": "Latn", - "api-version": "v3.0", + "api-version": "3.0", "body": [ { "text": "How are you? I am fine. What did you do today?" diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/FindSentenceBoundaries_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/FindSentenceBoundaries_MinimumSet_Gen.json index eb1c638be3cd..4175072f8566 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/FindSentenceBoundaries_MinimumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/FindSentenceBoundaries_MinimumSet_Gen.json @@ -2,7 +2,7 @@ "title": "Find Sentence Boundaries with minimum properties", "operationId": "FindSentenceBoundaries", "parameters": { - "api-version": "v3.0", + "api-version": "3.0", "body": [ { "text": "How are you? I am fine. What did you do today?" diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/GetSupportedLanguages_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/GetSupportedLanguages_MaximumSet_Gen.json index ca7cc03dc422..0fdb83142178 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/GetSupportedLanguages_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/GetSupportedLanguages_MaximumSet_Gen.json @@ -6,7 +6,7 @@ "scope": "translation,transliteration,dictionary", "Accept-Language": "en", "If-None-Match": "fpnhruttllvc", - "api-version": "v3.0" + "api-version": "3.0" }, "responses": { "200": { diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/GetSupportedLanguages_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/GetSupportedLanguages_MinimumSet_Gen.json index 598524bee498..5f8405e887d9 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/GetSupportedLanguages_MinimumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/GetSupportedLanguages_MinimumSet_Gen.json @@ -2,7 +2,7 @@ "title": "Gets the set of languages currently supported by other operations of the Translator with minimum properties.", "operationId": "GetSupportedLanguages", "parameters": { - "api-version": "v3.0" + "api-version": "3.0" }, "responses": { "200": { diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryEntries_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryEntries_MaximumSet_Gen.json index 2357a8bf1802..636eb73b04f6 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryEntries_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryEntries_MaximumSet_Gen.json @@ -5,7 +5,7 @@ "X-ClientTraceId": "yqst", "from": "en", "to": "es", - "api-version": "v3.0", + "api-version": "3.0", "body": [ { "text": "fly" diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryEntries_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryEntries_MinimumSet_Gen.json index 289e6bc6030e..dfc24a03bdea 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryEntries_MinimumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryEntries_MinimumSet_Gen.json @@ -4,7 +4,7 @@ "parameters": { "from": "en", "to": "es", - "api-version": "v3.0", + "api-version": "3.0", "body": [ { "text": "fly" diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryExamples_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryExamples_MaximumSet_Gen.json index 377465a51238..00c751e3e39c 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryExamples_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryExamples_MaximumSet_Gen.json @@ -5,7 +5,7 @@ "X-ClientTraceId": "vykwwekvcncclrmsyjhbok", "from": "en", "to": "es", - "api-version": "v3.0", + "api-version": "3.0", "body": [ { "text": "fly", diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryExamples_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryExamples_MinimumSet_Gen.json index 7095f37f0c6e..7f2b08865c25 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryExamples_MinimumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryExamples_MinimumSet_Gen.json @@ -4,7 +4,7 @@ "parameters": { "from": "en", "to": "es", - "api-version": "v3.0", + "api-version": "3.0", "body": [ { "text": "fly", diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Translate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Translate_MaximumSet_Gen.json index 59c4d43f0f8c..06f74471d1df 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Translate_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Translate_MaximumSet_Gen.json @@ -17,7 +17,7 @@ "fromScript": "Latn", "toScript": "Latn", "allowFallback": true, - "api-version": "v3.0", + "api-version": "3.0", "body": [ { "text": "This is a test." diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Translate_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Translate_MinimumSet_Gen.json index 0d8533cdb0e3..b29982929425 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Translate_MinimumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Translate_MinimumSet_Gen.json @@ -5,7 +5,7 @@ "to": [ "fmlxpuepn" ], - "api-version": "v3.0", + "api-version": "3.0", "body": [ { "text": "This is a test." diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Transliterate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Transliterate_MaximumSet_Gen.json index 4508865be80e..92f67b4a62d3 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Transliterate_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Transliterate_MaximumSet_Gen.json @@ -6,7 +6,7 @@ "language": "zh-Hans", "fromScript": "Hans", "toScript": "Latn", - "api-version": "v3.0", + "api-version": "3.0", "body": [ { "text": "这是个测试。" diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Transliterate_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Transliterate_MinimumSet_Gen.json index 03cf8b0f6630..24c5aee2ffb1 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Transliterate_MinimumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Transliterate_MinimumSet_Gen.json @@ -5,7 +5,7 @@ "language": "zh-Hans", "fromScript": "Hans", "toScript": "Latn", - "api-version": "v3.0", + "api-version": "3.0", "body": [ { "text": "这是个测试。" diff --git a/specification/translation/Azure.AI.TextTranslation/main.tsp b/specification/translation/Azure.AI.TextTranslation/main.tsp index 4ef6b176604d..6781c417d002 100644 --- a/specification/translation/Azure.AI.TextTranslation/main.tsp +++ b/specification/translation/Azure.AI.TextTranslation/main.tsp @@ -40,7 +40,7 @@ namespace TextTranslation; @doc("Text Translation supported versions") enum APIVersion { @doc("Version 3.0") - v3_0: "v3.0", + v3_0: "3.0", @doc("Version 2025-05-01") v2025_05_01_preview: "2025-05-01-preview", diff --git a/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml b/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml index 59de2f6e9f65..663f84c1a802 100644 --- a/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml +++ b/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml @@ -15,7 +15,7 @@ options: azure-resource-provider-folder: "data-plane" emit-lro-options: "none" emitter-output-dir: "{project-root}/.." - output-file: "{azure-resource-provider-folder}/Azure.AI.TextTranslation/{version-status}/{version}/openapi.json" + output-file: "{azure-resource-provider-folder}/Azure.AI.TextTranslation/{version-status}/v{version}/openapi.json" "@azure-tools/typespec-csharp": package-dir: "Azure.AI.Translation.Text" clear-output-folder: true diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/GetSupportedLanguages_MaximumSet_Gen.json similarity index 100% rename from specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MaximumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/GetSupportedLanguages_MaximumSet_Gen.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/GetSupportedLanguages_MinimumSet_Gen.json similarity index 100% rename from specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MinimumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/GetSupportedLanguages_MinimumSet_Gen.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json similarity index 100% rename from specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MinimumSet_Gen.json similarity index 100% rename from specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MinimumSet_Gen.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json similarity index 100% rename from specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json similarity index 100% rename from specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json similarity index 100% rename from specification/translation/data-plane/Azure.AI.TextTranslation/preview/2025-05-01-preview/openapi.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json index 1ba449ef5558..8426597742e5 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "title": "Text Translation", - "version": "v3.0", + "version": "3.0", "description": "Text translation is a cloud-based REST API feature of the Translator service that uses neural\nmachine translation technology to enable quick and accurate source-to-target text translation\nin real time across all supported languages.\n\nThe following methods are supported by the Text Translation feature:\n\nLanguages. Returns a list of languages supported by Translate, Transliterate, and Dictionary Lookup operations.\n\nTranslate. Renders single source-language text to multiple target-language texts with a single request.\n\nTransliterate. Converts characters or letters of a source language to the corresponding characters or letters of a target language.\n\nDetect. Returns the source code language code and a boolean variable denoting whether the detected language is supported for text translation and transliteration.", "x-typespec-generated": [ { @@ -107,14 +107,6 @@ } } } - }, - "x-ms-examples": { - "Find Sentence Boundaries": { - "$ref": "./examples/FindSentenceBoundaries_MaximumSet_Gen.json" - }, - "Find Sentence Boundaries with minimum properties": { - "$ref": "./examples/FindSentenceBoundaries_MinimumSet_Gen.json" - } } } }, @@ -189,14 +181,6 @@ } } } - }, - "x-ms-examples": { - "Lookup Dictionary Examples": { - "$ref": "./examples/LookupDictionaryExamples_MaximumSet_Gen.json" - }, - "Lookup Dictionary Examples with minimum properties": { - "$ref": "./examples/LookupDictionaryExamples_MinimumSet_Gen.json" - } } } }, @@ -271,14 +255,6 @@ } } } - }, - "x-ms-examples": { - "Lookup Dictionary Entries": { - "$ref": "./examples/LookupDictionaryEntries_MaximumSet_Gen.json" - }, - "Lookup Dictionary Entries with minimum properties": { - "$ref": "./examples/LookupDictionaryEntries_MinimumSet_Gen.json" - } } } }, @@ -343,14 +319,6 @@ } } } - }, - "x-ms-examples": { - "Gets the set of languages currently supported by other operations of the Translator with minimum properties.": { - "$ref": "./examples/GetSupportedLanguages_MinimumSet_Gen.json" - }, - "Gets the set of languages currently supported by other operations of the Translator.": { - "$ref": "./examples/GetSupportedLanguages_MaximumSet_Gen.json" - } } } }, @@ -464,14 +432,6 @@ } } } - }, - "x-ms-examples": { - "Translate Text": { - "$ref": "./examples/Translate_MaximumSet_Gen.json" - }, - "Translate Text with minimum properties": { - "$ref": "./examples/Translate_MinimumSet_Gen.json" - } } } }, @@ -549,14 +509,6 @@ } } } - }, - "x-ms-examples": { - "Transliterate Text": { - "$ref": "./examples/Transliterate_MaximumSet_Gen.json" - }, - "Transliterate Text with minimum properties": { - "$ref": "./examples/Transliterate_MinimumSet_Gen.json" - } } } } From daff86bc75eaa64e36ec71684d5794eac70974ab Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 13 Jun 2025 14:00:34 -0700 Subject: [PATCH 071/119] More cleanup --- .../models-shared.tsp | 1 + .../stable/v3.0/openapi.json | 68 ++++++++++++------- 2 files changed, 46 insertions(+), 23 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-shared.tsp b/specification/translation/Azure.AI.TextTranslation/models-shared.tsp index f52c2fcb69aa..ee749dd7483e 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-shared.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-shared.tsp @@ -24,6 +24,7 @@ model InputTextItem { @doc("Element containing the text for translation.") model TranslateBody extends InputTextItem { + @doc("Text to translate.") text: string; diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json index 886ce770df53..8426597742e5 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json @@ -73,7 +73,8 @@ "type": "array", "items": { "$ref": "#/definitions/InputTextItem" - } + }, + "x-ms-identifiers": [] } } ], @@ -84,7 +85,8 @@ "type": "array", "items": { "$ref": "#/definitions/BreakSentenceItem" - } + }, + "x-ms-identifiers": [] }, "headers": { "X-RequestId": { @@ -145,7 +147,8 @@ "type": "array", "items": { "$ref": "#/definitions/DictionaryExampleTextItem" - } + }, + "x-ms-identifiers": [] } } ], @@ -156,7 +159,8 @@ "type": "array", "items": { "$ref": "#/definitions/DictionaryExampleItem" - } + }, + "x-ms-identifiers": [] }, "headers": { "X-RequestId": { @@ -217,7 +221,8 @@ "type": "array", "items": { "$ref": "#/definitions/InputTextItem" - } + }, + "x-ms-identifiers": [] } } ], @@ -228,7 +233,8 @@ "type": "array", "items": { "$ref": "#/definitions/DictionaryLookupItem" - } + }, + "x-ms-identifiers": [] }, "headers": { "X-RequestId": { @@ -382,8 +388,9 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/InputTextItem" - } + "$ref": "#/definitions/TranslateBody" + }, + "x-ms-identifiers": [] } } ], @@ -394,7 +401,8 @@ "type": "array", "items": { "$ref": "#/definitions/TranslatedTextItem" - } + }, + "x-ms-identifiers": [] }, "headers": { "X-RequestId": { @@ -467,7 +475,8 @@ "type": "array", "items": { "$ref": "#/definitions/InputTextItem" - } + }, + "x-ms-identifiers": [] } } ], @@ -478,7 +487,8 @@ "type": "array", "items": { "$ref": "#/definitions/TransliteratedText" - } + }, + "x-ms-identifiers": [] }, "headers": { "X-RequestId": { @@ -564,7 +574,8 @@ "description": "Array of the break sentence elements.", "items": { "$ref": "#/definitions/BreakSentenceItem" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -645,7 +656,8 @@ "description": "A list of examples for the (source term, target term) pair.", "items": { "$ref": "#/definitions/DictionaryExample" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -681,7 +693,8 @@ "description": "Array of the dictionary examples elements.", "items": { "$ref": "#/definitions/DictionaryExampleItem" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -705,7 +718,8 @@ "description": "A list of translations for the source term.", "items": { "$ref": "#/definitions/DictionaryTranslation" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -723,7 +737,8 @@ "description": "Array of the dictionary lookup elements.", "items": { "$ref": "#/definitions/DictionaryLookupItem" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -760,7 +775,8 @@ "description": "A list of \"back translations\" of the target. For example, source words that the target can translate to.\nThe list is guaranteed to contain the source word that was requested (e.g., if the source word being\nlooked up is \"fly\", then it is guaranteed that \"fly\" will be in the backTranslations list).\nHowever, it is not guaranteed to be in the first position, and often will not be.", "items": { "$ref": "#/definitions/BackTranslation" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -997,7 +1013,8 @@ "description": "List of languages with alterative translations and examples for the query expressed in the source language.", "items": { "$ref": "#/definitions/TargetDictionaryLanguage" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -1116,7 +1133,8 @@ "description": "An array of translation results. The size of the array matches the number of target \nlanguages specified through the to query parameter.", "items": { "$ref": "#/definitions/TranslationText" - } + }, + "x-ms-identifiers": [] }, "sourceText": { "$ref": "#/definitions/SourceText", @@ -1159,7 +1177,8 @@ "description": "Array of the translated text elements.", "items": { "$ref": "#/definitions/TranslatedTextItem" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -1205,7 +1224,8 @@ "description": "List of scripts available to convert text to.", "items": { "$ref": "#/definitions/LanguageScript" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -1226,7 +1246,8 @@ "description": "Array of transliterated texts", "items": { "$ref": "#/definitions/TransliteratedText" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -1268,7 +1289,8 @@ "description": "List of scripts to convert from.", "items": { "$ref": "#/definitions/TransliterableScript" - } + }, + "x-ms-identifiers": [] } }, "required": [ From 05d8b8ebe60d3c068f4375fa67814d38e3aec4ea Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 13 Jun 2025 15:07:05 -0700 Subject: [PATCH 072/119] More cleanup --- .../translation/data-plane/Azure.AI.TextTranslation/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md index 58418ab55572..6358d619aa21 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md @@ -36,7 +36,7 @@ These settings apply only when `--tag=package-2025-05-01-preview` is specified o ``` yaml $(tag) == 'package-2025-05-01-preview' version: package-2025-05-01-preview input-file: - - preview/2025-05-01-preview/openapi.json + - preview/v2025-05-01-preview/openapi.json ``` ## Multi-API/Profile support for AutoRest v3 generators From d639c1ec231591c9299661d83ebcf45215336497 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 16 Jun 2025 19:17:03 -0700 Subject: [PATCH 073/119] More cleanup --- .../Azure.AI.TextTranslation/readme.md | 64 ------------------- ...FindSentenceBoundaries_MaximumSet_Gen.json | 2 +- ...FindSentenceBoundaries_MinimumSet_Gen.json | 2 +- .../GetSupportedLanguages_MaximumSet_Gen.json | 2 +- .../GetSupportedLanguages_MinimumSet_Gen.json | 2 +- ...ookupDictionaryEntries_MaximumSet_Gen.json | 2 +- ...ookupDictionaryEntries_MinimumSet_Gen.json | 2 +- ...okupDictionaryExamples_MaximumSet_Gen.json | 2 +- ...okupDictionaryExamples_MinimumSet_Gen.json | 2 +- .../examples/Translate_MaximumSet_Gen.json | 2 +- .../examples/Translate_MinimumSet_Gen.json | 2 +- .../Transliterate_MaximumSet_Gen.json | 2 +- .../Transliterate_MinimumSet_Gen.json | 2 +- .../stable/v3.0/openapi.json | 48 ++++++++++++++ 14 files changed, 60 insertions(+), 76 deletions(-) delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/readme.md diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md deleted file mode 100644 index 6358d619aa21..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ /dev/null @@ -1,64 +0,0 @@ -# Cognitive Services Translation Text SDK - -> see https://aka.ms/autorest - -This is the AutoRest configuration file for Translation Text SDK. - -> `autorest` - -To see additional help and options, run: - -> `autorest --help` ---- - -The current release is `package-2025-05-01-preview`. - -``` yaml -tag: package-2025-05-01-preview -add-credentials: true -openapi-type: data-plane -``` - -## Releases - -### Release 3.0 - -These settings apply only when `--tag=release_3_0` is specified on the command line. - -``` yaml $(tag) == 'release_3_0' -input-file: stable/v3.0/openapi.json -``` - -### Release 2025-05-01-preview - -These settings apply only when `--tag=package-2025-05-01-preview` is specified on the command line. - -``` yaml $(tag) == 'package-2025-05-01-preview' -version: package-2025-05-01-preview -input-file: - - preview/v2025-05-01-preview/openapi.json -``` - -## Multi-API/Profile support for AutoRest v3 generators - -AutoRest V3 generators require the use of `--tag=all-api-versions` to select api files. - -This block is updated by an automatic script. Edits may be lost! - -``` yaml $(tag) == 'all-api-versions' /* autogenerated */ -# include the azure profile definitions from the standard location -require: $(this-folder)/../../../../profiles/readme.md - -# all the input files across all versions -input-file: - - $(this-folder)/stable/v3.0/openapi.json - - $(this-folder)/preview/2025-05-01-preview/openapi.json -``` - -If there are files that should not be in the `all-api-versions` set, -uncomment the `exclude-file` section below and add the file paths. - -``` yaml $(tag) == 'all-api-versions' -#exclude-file: -# - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json -``` \ No newline at end of file diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MaximumSet_Gen.json index ce515a0ed2e8..1847c3f5e3d3 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MaximumSet_Gen.json @@ -5,7 +5,7 @@ "X-ClientTraceId": "svun", "language": "en", "script": "Latn", - "api-version": "v3.0", + "api-version": "3.0", "body": [ { "text": "How are you? I am fine. What did you do today?" diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json index eb1c638be3cd..4175072f8566 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json @@ -2,7 +2,7 @@ "title": "Find Sentence Boundaries with minimum properties", "operationId": "FindSentenceBoundaries", "parameters": { - "api-version": "v3.0", + "api-version": "3.0", "body": [ { "text": "How are you? I am fine. What did you do today?" diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MaximumSet_Gen.json index ca7cc03dc422..0fdb83142178 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MaximumSet_Gen.json @@ -6,7 +6,7 @@ "scope": "translation,transliteration,dictionary", "Accept-Language": "en", "If-None-Match": "fpnhruttllvc", - "api-version": "v3.0" + "api-version": "3.0" }, "responses": { "200": { diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MinimumSet_Gen.json index 598524bee498..5f8405e887d9 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MinimumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetSupportedLanguages_MinimumSet_Gen.json @@ -2,7 +2,7 @@ "title": "Gets the set of languages currently supported by other operations of the Translator with minimum properties.", "operationId": "GetSupportedLanguages", "parameters": { - "api-version": "v3.0" + "api-version": "3.0" }, "responses": { "200": { diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MaximumSet_Gen.json index 2357a8bf1802..636eb73b04f6 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MaximumSet_Gen.json @@ -5,7 +5,7 @@ "X-ClientTraceId": "yqst", "from": "en", "to": "es", - "api-version": "v3.0", + "api-version": "3.0", "body": [ { "text": "fly" diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json index 289e6bc6030e..dfc24a03bdea 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json @@ -4,7 +4,7 @@ "parameters": { "from": "en", "to": "es", - "api-version": "v3.0", + "api-version": "3.0", "body": [ { "text": "fly" diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MaximumSet_Gen.json index 377465a51238..00c751e3e39c 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MaximumSet_Gen.json @@ -5,7 +5,7 @@ "X-ClientTraceId": "vykwwekvcncclrmsyjhbok", "from": "en", "to": "es", - "api-version": "v3.0", + "api-version": "3.0", "body": [ { "text": "fly", diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json index 7095f37f0c6e..7f2b08865c25 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json @@ -4,7 +4,7 @@ "parameters": { "from": "en", "to": "es", - "api-version": "v3.0", + "api-version": "3.0", "body": [ { "text": "fly", diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MaximumSet_Gen.json index 59c4d43f0f8c..06f74471d1df 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MaximumSet_Gen.json @@ -17,7 +17,7 @@ "fromScript": "Latn", "toScript": "Latn", "allowFallback": true, - "api-version": "v3.0", + "api-version": "3.0", "body": [ { "text": "This is a test." diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MinimumSet_Gen.json index 0d8533cdb0e3..b29982929425 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MinimumSet_Gen.json @@ -5,7 +5,7 @@ "to": [ "fmlxpuepn" ], - "api-version": "v3.0", + "api-version": "3.0", "body": [ { "text": "This is a test." diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MaximumSet_Gen.json index 4508865be80e..92f67b4a62d3 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MaximumSet_Gen.json @@ -6,7 +6,7 @@ "language": "zh-Hans", "fromScript": "Hans", "toScript": "Latn", - "api-version": "v3.0", + "api-version": "3.0", "body": [ { "text": "这是个测试。" diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MinimumSet_Gen.json index 03cf8b0f6630..24c5aee2ffb1 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MinimumSet_Gen.json @@ -5,7 +5,7 @@ "language": "zh-Hans", "fromScript": "Hans", "toScript": "Latn", - "api-version": "v3.0", + "api-version": "3.0", "body": [ { "text": "这是个测试。" diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json index 8426597742e5..514222e5d903 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json @@ -107,6 +107,14 @@ } } } + }, + "x-ms-examples": { + "Find Sentence Boundaries": { + "$ref": "./examples/FindSentenceBoundaries_MaximumSet_Gen.json" + }, + "Find Sentence Boundaries with minimum properties": { + "$ref": "./examples/FindSentenceBoundaries_MinimumSet_Gen.json" + } } } }, @@ -181,6 +189,14 @@ } } } + }, + "x-ms-examples": { + "Lookup Dictionary Examples": { + "$ref": "./examples/LookupDictionaryExamples_MaximumSet_Gen.json" + }, + "Lookup Dictionary Examples with minimum properties": { + "$ref": "./examples/LookupDictionaryExamples_MinimumSet_Gen.json" + } } } }, @@ -255,6 +271,14 @@ } } } + }, + "x-ms-examples": { + "Lookup Dictionary Entries": { + "$ref": "./examples/LookupDictionaryEntries_MaximumSet_Gen.json" + }, + "Lookup Dictionary Entries with minimum properties": { + "$ref": "./examples/LookupDictionaryEntries_MinimumSet_Gen.json" + } } } }, @@ -319,6 +343,14 @@ } } } + }, + "x-ms-examples": { + "Gets the set of languages currently supported by other operations of the Translator with minimum properties.": { + "$ref": "./examples/GetSupportedLanguages_MinimumSet_Gen.json" + }, + "Gets the set of languages currently supported by other operations of the Translator.": { + "$ref": "./examples/GetSupportedLanguages_MaximumSet_Gen.json" + } } } }, @@ -432,6 +464,14 @@ } } } + }, + "x-ms-examples": { + "Translate Text": { + "$ref": "./examples/Translate_MaximumSet_Gen.json" + }, + "Translate Text with minimum properties": { + "$ref": "./examples/Translate_MinimumSet_Gen.json" + } } } }, @@ -509,6 +549,14 @@ } } } + }, + "x-ms-examples": { + "Transliterate Text": { + "$ref": "./examples/Transliterate_MaximumSet_Gen.json" + }, + "Transliterate Text with minimum properties": { + "$ref": "./examples/Transliterate_MinimumSet_Gen.json" + } } } } From 94de425ca4cc9bf38ee0f4fccf353f1dea06d4db Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 16 Jun 2025 23:05:59 -0700 Subject: [PATCH 074/119] More cleanup --- .../translation/data-plane/Azure.AI.TextTranslation/readme.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/readme.md diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md new file mode 100644 index 000000000000..e69de29bb2d1 From 220f3e36bddaff749a0d358f3dcd69327dc08ccf Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 16 Jun 2025 23:37:57 -0700 Subject: [PATCH 075/119] More cleanup --- .../stable/v3.0/openapi.json | 48 ------------------- 1 file changed, 48 deletions(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json index 514222e5d903..8426597742e5 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json @@ -107,14 +107,6 @@ } } } - }, - "x-ms-examples": { - "Find Sentence Boundaries": { - "$ref": "./examples/FindSentenceBoundaries_MaximumSet_Gen.json" - }, - "Find Sentence Boundaries with minimum properties": { - "$ref": "./examples/FindSentenceBoundaries_MinimumSet_Gen.json" - } } } }, @@ -189,14 +181,6 @@ } } } - }, - "x-ms-examples": { - "Lookup Dictionary Examples": { - "$ref": "./examples/LookupDictionaryExamples_MaximumSet_Gen.json" - }, - "Lookup Dictionary Examples with minimum properties": { - "$ref": "./examples/LookupDictionaryExamples_MinimumSet_Gen.json" - } } } }, @@ -271,14 +255,6 @@ } } } - }, - "x-ms-examples": { - "Lookup Dictionary Entries": { - "$ref": "./examples/LookupDictionaryEntries_MaximumSet_Gen.json" - }, - "Lookup Dictionary Entries with minimum properties": { - "$ref": "./examples/LookupDictionaryEntries_MinimumSet_Gen.json" - } } } }, @@ -343,14 +319,6 @@ } } } - }, - "x-ms-examples": { - "Gets the set of languages currently supported by other operations of the Translator with minimum properties.": { - "$ref": "./examples/GetSupportedLanguages_MinimumSet_Gen.json" - }, - "Gets the set of languages currently supported by other operations of the Translator.": { - "$ref": "./examples/GetSupportedLanguages_MaximumSet_Gen.json" - } } } }, @@ -464,14 +432,6 @@ } } } - }, - "x-ms-examples": { - "Translate Text": { - "$ref": "./examples/Translate_MaximumSet_Gen.json" - }, - "Translate Text with minimum properties": { - "$ref": "./examples/Translate_MinimumSet_Gen.json" - } } } }, @@ -549,14 +509,6 @@ } } } - }, - "x-ms-examples": { - "Transliterate Text": { - "$ref": "./examples/Transliterate_MaximumSet_Gen.json" - }, - "Transliterate Text with minimum properties": { - "$ref": "./examples/Transliterate_MinimumSet_Gen.json" - } } } } From da33b99be10b86b8c6860a63a93593f911dda255 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 16 Jun 2025 23:43:34 -0700 Subject: [PATCH 076/119] More cleanup --- .../Azure.AI.TextTranslation/readme.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md index e69de29bb2d1..6358d619aa21 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md @@ -0,0 +1,64 @@ +# Cognitive Services Translation Text SDK + +> see https://aka.ms/autorest + +This is the AutoRest configuration file for Translation Text SDK. + +> `autorest` + +To see additional help and options, run: + +> `autorest --help` +--- + +The current release is `package-2025-05-01-preview`. + +``` yaml +tag: package-2025-05-01-preview +add-credentials: true +openapi-type: data-plane +``` + +## Releases + +### Release 3.0 + +These settings apply only when `--tag=release_3_0` is specified on the command line. + +``` yaml $(tag) == 'release_3_0' +input-file: stable/v3.0/openapi.json +``` + +### Release 2025-05-01-preview + +These settings apply only when `--tag=package-2025-05-01-preview` is specified on the command line. + +``` yaml $(tag) == 'package-2025-05-01-preview' +version: package-2025-05-01-preview +input-file: + - preview/v2025-05-01-preview/openapi.json +``` + +## Multi-API/Profile support for AutoRest v3 generators + +AutoRest V3 generators require the use of `--tag=all-api-versions` to select api files. + +This block is updated by an automatic script. Edits may be lost! + +``` yaml $(tag) == 'all-api-versions' /* autogenerated */ +# include the azure profile definitions from the standard location +require: $(this-folder)/../../../../profiles/readme.md + +# all the input files across all versions +input-file: + - $(this-folder)/stable/v3.0/openapi.json + - $(this-folder)/preview/2025-05-01-preview/openapi.json +``` + +If there are files that should not be in the `all-api-versions` set, +uncomment the `exclude-file` section below and add the file paths. + +``` yaml $(tag) == 'all-api-versions' +#exclude-file: +# - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json +``` \ No newline at end of file From 7042a7bfa3345c6e3483dd9e1dcb7aa931a8491b Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 16 Jun 2025 23:50:58 -0700 Subject: [PATCH 077/119] More cleanup --- .../translation/data-plane/Azure.AI.TextTranslation/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md index 6358d619aa21..7c0c11737ee9 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md @@ -52,7 +52,7 @@ require: $(this-folder)/../../../../profiles/readme.md # all the input files across all versions input-file: - $(this-folder)/stable/v3.0/openapi.json - - $(this-folder)/preview/2025-05-01-preview/openapi.json + - $(this-folder)/preview/v2025-05-01-preview/openapi.json ``` If there are files that should not be in the `all-api-versions` set, From 155bfe8ef9b2c9ad38f8d3b103be01e24fe58529 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Tue, 17 Jun 2025 16:52:22 -0700 Subject: [PATCH 078/119] More cleanup --- specification/translation/Azure.AI.TextTranslation/routes.tsp | 2 +- .../preview/v2025-05-01-preview/openapi.json | 2 +- .../Azure.AI.TextTranslation/stable/v3.0/openapi.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/routes.tsp b/specification/translation/Azure.AI.TextTranslation/routes.tsp index 8cd9da371aa3..ece38e7c64b6 100644 --- a/specification/translation/Azure.AI.TextTranslation/routes.tsp +++ b/specification/translation/Azure.AI.TextTranslation/routes.tsp @@ -51,7 +51,7 @@ op getSupportedLanguages is CustomGetOperation< @summary("Translate Text") @doc("Translate Text") op translate is CustomOperation< - TranslateBody[], + InputTextItem[], TranslateParameters, TranslationResult, ErrorResponse diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json index 082c813094d6..2f2d150b1412 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json @@ -138,7 +138,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/TranslateBody" + "$ref": "#/definitions/InputTextItem" }, "x-ms-identifiers": [] } diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json index 8426597742e5..13fb1ed1de2b 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json @@ -388,7 +388,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/TranslateBody" + "$ref": "#/definitions/InputTextItem" }, "x-ms-identifiers": [] } From d245f50ccbeec98e0af873a66cbb380ef6845b29 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Wed, 18 Jun 2025 20:13:33 -0700 Subject: [PATCH 079/119] More cleanup --- .../models-shared.tsp | 5 +- .../preview/v2025-05-01-preview/openapi.json | 104 ++++++++---------- .../stable/v3.0/openapi.json | 18 --- 3 files changed, 47 insertions(+), 80 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-shared.tsp b/specification/translation/Azure.AI.TextTranslation/models-shared.tsp index ee749dd7483e..b3f707831907 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-shared.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-shared.tsp @@ -16,14 +16,17 @@ alias CommonParameters = { clientTraceId?: string; }; +/* @doc("Element containing the text for translation.") model InputTextItem { @doc("Text to translate.") text: string; } + */ @doc("Element containing the text for translation.") -model TranslateBody extends InputTextItem { +//model TranslateBody extends InputTextItem { +model InputTextItem { @doc("Text to translate.") text: string; diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json index 2f2d150b1412..451e7dd79cb5 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json @@ -365,10 +365,52 @@ "text": { "type": "string", "description": "Text to translate." + }, + "script": { + "type": "string", + "description": "Specifies the script of the input text." + }, + "language": { + "type": "string", + "description": "Specifies the language of the input text. Find which languages are available to translate by \nlooking up supported languages using the translation scope. If the language parameter isn't \nspecified, automatic language detection is applied to determine the source language.\n\nYou must use the language parameter rather than autodetection when using the dynamic dictionary feature. \nNote: the dynamic dictionary feature is case-sensitive." + }, + "textType": { + "type": "string", + "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", + "default": "Plain", + "enum": [ + "Plain", + "Html" + ], + "x-ms-enum": { + "name": "TextType", + "modelAsString": true, + "values": [ + { + "name": "Plain", + "value": "Plain", + "description": "Plain text." + }, + { + "name": "Html", + "value": "Html", + "description": "HTML-encoded text." + } + ] + } + }, + "targets": { + "type": "array", + "description": "Translation target parameters.", + "items": { + "$ref": "#/definitions/TranslateTarget" + }, + "x-ms-identifiers": [] } }, "required": [ - "text" + "text", + "targets" ] }, "LanguageDirectionality": { @@ -592,66 +634,6 @@ ] } }, - "TranslateBody": { - "type": "object", - "description": "Element containing the text for translation.", - "properties": { - "text": { - "type": "string", - "description": "Text to translate." - }, - "script": { - "type": "string", - "description": "Specifies the script of the input text." - }, - "language": { - "type": "string", - "description": "Specifies the language of the input text. Find which languages are available to translate by \nlooking up supported languages using the translation scope. If the language parameter isn't \nspecified, automatic language detection is applied to determine the source language.\n\nYou must use the language parameter rather than autodetection when using the dynamic dictionary feature. \nNote: the dynamic dictionary feature is case-sensitive." - }, - "textType": { - "type": "string", - "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", - "default": "Plain", - "enum": [ - "Plain", - "Html" - ], - "x-ms-enum": { - "name": "TextType", - "modelAsString": true, - "values": [ - { - "name": "Plain", - "value": "Plain", - "description": "Plain text." - }, - { - "name": "Html", - "value": "Html", - "description": "HTML-encoded text." - } - ] - } - }, - "targets": { - "type": "array", - "description": "Translation target parameters.", - "items": { - "$ref": "#/definitions/TranslateTarget" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "text", - "targets" - ], - "allOf": [ - { - "$ref": "#/definitions/InputTextItem" - } - ] - }, "TranslateBodyDetails": { "type": "object", "description": "Request body parameters for the translate API.", diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json index 13fb1ed1de2b..35ee7d9fca14 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json @@ -1089,24 +1089,6 @@ ] } }, - "TranslateBody": { - "type": "object", - "description": "Element containing the text for translation.", - "properties": { - "text": { - "type": "string", - "description": "Text to translate." - } - }, - "required": [ - "text" - ], - "allOf": [ - { - "$ref": "#/definitions/InputTextItem" - } - ] - }, "TranslatedTextAlignment": { "type": "object", "description": "Alignment information object.", From 317d894d5a1e448dedf8d7d11cdc76175783cf3f Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 23 Jun 2025 13:15:19 -0700 Subject: [PATCH 080/119] Fix versioning --- .../models-shared.tsp | 8 +- .../Azure.AI.TextTranslation/routes.tsp | 22 +- .../preview/v2025-05-01-preview/openapi.json | 217 +++++++++--------- .../stable/v3.0/openapi.json | 210 ++++++++--------- 4 files changed, 242 insertions(+), 215 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-shared.tsp b/specification/translation/Azure.AI.TextTranslation/models-shared.tsp index b3f707831907..7f4031d7b113 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-shared.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-shared.tsp @@ -16,17 +16,17 @@ alias CommonParameters = { clientTraceId?: string; }; -/* + @doc("Element containing the text for translation.") model InputTextItem { @doc("Text to translate.") text: string; } - */ + @doc("Element containing the text for translation.") -//model TranslateBody extends InputTextItem { -model InputTextItem { +@added(APIVersion.v2025_05_01_preview) +model TranslateBody { @doc("Text to translate.") text: string; diff --git a/specification/translation/Azure.AI.TextTranslation/routes.tsp b/specification/translation/Azure.AI.TextTranslation/routes.tsp index ece38e7c64b6..960238412e08 100644 --- a/specification/translation/Azure.AI.TextTranslation/routes.tsp +++ b/specification/translation/Azure.AI.TextTranslation/routes.tsp @@ -1,11 +1,13 @@ import "@typespec/rest"; import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-client-generator-core"; import "./models-languages.tsp"; import "./models-translate.tsp"; import "./models-transliterate.tsp"; import "./models-breaksentence.tsp"; import "./models-dictionary.tsp"; +using Azure.ClientGenerator.Core; using TypeSpec.Http; using TypeSpec.Versioning; @@ -47,16 +49,32 @@ op getSupportedLanguages is CustomGetOperation< #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." @post -@route("translate") @summary("Translate Text") @doc("Translate Text") -op translate is CustomOperation< +@sharedRoute +@renamedFrom(APIVersion.v2025_05_01_preview,"translate") +@removed(APIVersion.v2025_05_01_preview) +op translateV3 is CustomOperation< InputTextItem[], TranslateParameters, TranslationResult, ErrorResponse >; +#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." +@post +@sharedRoute +@summary("Translate Text") +@doc("Translate Text") +@added(APIVersion.v2025_05_01_preview) +op translate is CustomOperation< + TranslateBody, + TranslateParameters, + TranslationResult, + ErrorResponse +>; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." @post @route("transliterate") diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json index 451e7dd79cb5..da03281c5737 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json @@ -36,11 +36,11 @@ ], "tags": [], "paths": { - "/languages": { - "get": { - "operationId": "GetSupportedLanguages", - "summary": "Gets the set of languages currently supported by other operations of the Translator.", - "description": "Gets the set of languages currently supported by other operations of the Translator.", + "/": { + "post": { + "operationId": "Translate", + "summary": "Translate Text", + "description": "Translate Text", "parameters": [ { "name": "X-ClientTraceId", @@ -50,15 +50,6 @@ "type": "string", "x-ms-client-name": "clientTraceId" }, - { - "$ref": "#/parameters/GetSupportedLanguagesParameters.scope" - }, - { - "$ref": "#/parameters/GetSupportedLanguagesParameters.acceptLanguage" - }, - { - "$ref": "#/parameters/GetSupportedLanguagesParameters.ifNoneMatch" - }, { "name": "api-version", "in": "query", @@ -66,22 +57,40 @@ "required": true, "type": "string", "x-ms-client-name": "apiVersion" + }, + { + "name": "body", + "in": "body", + "description": "Defines the content of the request", + "required": true, + "schema": { + "$ref": "#/definitions/TranslateBody" + } } ], "responses": { "200": { - "description": "The request has succeeded.", + "description": "Response for the translation API.", "schema": { - "$ref": "#/definitions/GetSupportedLanguagesResult" + "type": "array", + "items": { + "$ref": "#/definitions/TranslatedTextItem" + }, + "x-ms-identifiers": [] }, "headers": { - "ETag": { - "type": "string", - "description": "Current value of the entity tag for the requested groups of supported languages. \nTo make subsequent requests more efficient, the client may send the `ETag` value in an \n`If-None-Match` header field." - }, "X-RequestId": { "type": "string", "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + }, + "x-metered-usage": { + "type": "integer", + "format": "int32", + "description": "Specifies consumption (the number of characters for which the user will be charged) for the translation \njob request. For example, if the word \"Hello\" is translated from English (en) to French (fr), \nthis field will return the value '5'." + }, + "x-mt-system": { + "type": "string", + "description": "Specifies the system type that was used for translation for each 'to' language requested for translation. \nThe value is a comma-separated list of strings. Each string indicates a type:\n\n* Custom - Request includes a custom system and at least one custom system was used during translation.\n* Team - All other requests" } } }, @@ -99,20 +108,20 @@ } }, "x-ms-examples": { - "Gets the set of languages currently supported by other operations of the Translator with minimum properties.": { - "$ref": "./examples/GetSupportedLanguages_MinimumSet_Gen.json" + "Translate Text": { + "$ref": "./examples/Translate_MaximumSet_Gen.json" }, - "Gets the set of languages currently supported by other operations of the Translator.": { - "$ref": "./examples/GetSupportedLanguages_MaximumSet_Gen.json" + "Translate Text with minimum properties": { + "$ref": "./examples/Translate_MinimumSet_Gen.json" } } } }, - "/translate": { - "post": { - "operationId": "Translate", - "summary": "Translate Text", - "description": "Translate Text", + "/languages": { + "get": { + "operationId": "GetSupportedLanguages", + "summary": "Gets the set of languages currently supported by other operations of the Translator.", + "description": "Gets the set of languages currently supported by other operations of the Translator.", "parameters": [ { "name": "X-ClientTraceId", @@ -122,6 +131,15 @@ "type": "string", "x-ms-client-name": "clientTraceId" }, + { + "$ref": "#/parameters/GetSupportedLanguagesParameters.scope" + }, + { + "$ref": "#/parameters/GetSupportedLanguagesParameters.acceptLanguage" + }, + { + "$ref": "#/parameters/GetSupportedLanguagesParameters.ifNoneMatch" + }, { "name": "api-version", "in": "query", @@ -129,44 +147,22 @@ "required": true, "type": "string", "x-ms-client-name": "apiVersion" - }, - { - "name": "body", - "in": "body", - "description": "Defines the content of the request", - "required": true, - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [] - } } ], "responses": { "200": { - "description": "Response for the translation API.", + "description": "The request has succeeded.", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/TranslatedTextItem" - }, - "x-ms-identifiers": [] + "$ref": "#/definitions/GetSupportedLanguagesResult" }, "headers": { - "X-RequestId": { + "ETag": { "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - }, - "x-metered-usage": { - "type": "integer", - "format": "int32", - "description": "Specifies consumption (the number of characters for which the user will be charged) for the translation \njob request. For example, if the word \"Hello\" is translated from English (en) to French (fr), \nthis field will return the value '5'." + "description": "Current value of the entity tag for the requested groups of supported languages. \nTo make subsequent requests more efficient, the client may send the `ETag` value in an \n`If-None-Match` header field." }, - "x-mt-system": { + "X-RequestId": { "type": "string", - "description": "Specifies the system type that was used for translation for each 'to' language requested for translation. \nThe value is a comma-separated list of strings. Each string indicates a type:\n\n* Custom - Request includes a custom system and at least one custom system was used during translation.\n* Team - All other requests" + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." } } }, @@ -184,11 +180,11 @@ } }, "x-ms-examples": { - "Translate Text": { - "$ref": "./examples/Translate_MaximumSet_Gen.json" + "Gets the set of languages currently supported by other operations of the Translator with minimum properties.": { + "$ref": "./examples/GetSupportedLanguages_MinimumSet_Gen.json" }, - "Translate Text with minimum properties": { - "$ref": "./examples/Translate_MinimumSet_Gen.json" + "Gets the set of languages currently supported by other operations of the Translator.": { + "$ref": "./examples/GetSupportedLanguages_MaximumSet_Gen.json" } } } @@ -365,52 +361,10 @@ "text": { "type": "string", "description": "Text to translate." - }, - "script": { - "type": "string", - "description": "Specifies the script of the input text." - }, - "language": { - "type": "string", - "description": "Specifies the language of the input text. Find which languages are available to translate by \nlooking up supported languages using the translation scope. If the language parameter isn't \nspecified, automatic language detection is applied to determine the source language.\n\nYou must use the language parameter rather than autodetection when using the dynamic dictionary feature. \nNote: the dynamic dictionary feature is case-sensitive." - }, - "textType": { - "type": "string", - "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", - "default": "Plain", - "enum": [ - "Plain", - "Html" - ], - "x-ms-enum": { - "name": "TextType", - "modelAsString": true, - "values": [ - { - "name": "Plain", - "value": "Plain", - "description": "Plain text." - }, - { - "name": "Html", - "value": "Html", - "description": "HTML-encoded text." - } - ] - } - }, - "targets": { - "type": "array", - "description": "Translation target parameters.", - "items": { - "$ref": "#/definitions/TranslateTarget" - }, - "x-ms-identifiers": [] } }, "required": [ - "text", - "targets" + "text" ] }, "LanguageDirectionality": { @@ -634,6 +588,61 @@ ] } }, + "TranslateBody": { + "type": "object", + "description": "Element containing the text for translation.", + "properties": { + "text": { + "type": "string", + "description": "Text to translate." + }, + "script": { + "type": "string", + "description": "Specifies the script of the input text." + }, + "language": { + "type": "string", + "description": "Specifies the language of the input text. Find which languages are available to translate by \nlooking up supported languages using the translation scope. If the language parameter isn't \nspecified, automatic language detection is applied to determine the source language.\n\nYou must use the language parameter rather than autodetection when using the dynamic dictionary feature. \nNote: the dynamic dictionary feature is case-sensitive." + }, + "textType": { + "type": "string", + "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", + "default": "Plain", + "enum": [ + "Plain", + "Html" + ], + "x-ms-enum": { + "name": "TextType", + "modelAsString": true, + "values": [ + { + "name": "Plain", + "value": "Plain", + "description": "Plain text." + }, + { + "name": "Html", + "value": "Html", + "description": "HTML-encoded text." + } + ] + } + }, + "targets": { + "type": "array", + "description": "Translation target parameters.", + "items": { + "$ref": "#/definitions/TranslateTarget" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "text", + "targets" + ] + }, "TranslateBodyDetails": { "type": "object", "description": "Request body parameters for the translate API.", diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json index 35ee7d9fca14..17c4df3b2907 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json @@ -36,11 +36,11 @@ ], "tags": [], "paths": { - "/breaksentence": { + "/": { "post": { - "operationId": "FindSentenceBoundaries", - "summary": "Find Sentence Boundaries", - "description": "Find Sentence Boundaries", + "operationId": "Translate", + "summary": "Translate Text", + "description": "Translate Text", "parameters": [ { "name": "X-ClientTraceId", @@ -51,10 +51,40 @@ "x-ms-client-name": "clientTraceId" }, { - "$ref": "#/parameters/BreakSentenceParameters.language" + "$ref": "#/parameters/TranslateParameters.to" }, { - "$ref": "#/parameters/BreakSentenceParameters.script" + "$ref": "#/parameters/TranslateParameters.from" + }, + { + "$ref": "#/parameters/TranslateParameters.textType" + }, + { + "$ref": "#/parameters/TranslateParameters.category" + }, + { + "$ref": "#/parameters/TranslateParameters.profanityAction" + }, + { + "$ref": "#/parameters/TranslateParameters.profanityMarker" + }, + { + "$ref": "#/parameters/TranslateParameters.includeAlignment" + }, + { + "$ref": "#/parameters/TranslateParameters.includeSentenceLength" + }, + { + "$ref": "#/parameters/TranslateParameters.suggestedFrom" + }, + { + "$ref": "#/parameters/TranslateParameters.fromScript" + }, + { + "$ref": "#/parameters/TranslateParameters.toScript" + }, + { + "$ref": "#/parameters/TranslateParameters.allowFallback" }, { "name": "api-version", @@ -80,11 +110,11 @@ ], "responses": { "200": { - "description": "Response for the Break SEntence API.", + "description": "Response for the translation API.", "schema": { "type": "array", "items": { - "$ref": "#/definitions/BreakSentenceItem" + "$ref": "#/definitions/TranslatedTextItem" }, "x-ms-identifiers": [] }, @@ -92,6 +122,15 @@ "X-RequestId": { "type": "string", "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + }, + "x-metered-usage": { + "type": "integer", + "format": "int32", + "description": "Specifies consumption (the number of characters for which the user will be charged) for the translation \njob request. For example, if the word \"Hello\" is translated from English (en) to French (fr), \nthis field will return the value '5'." + }, + "x-mt-system": { + "type": "string", + "description": "Specifies the system type that was used for translation for each 'to' language requested for translation. \nThe value is a comma-separated list of strings. Each string indicates a type:\n\n* Custom - Request includes a custom system and at least one custom system was used during translation.\n* Team - All other requests" } } }, @@ -110,11 +149,11 @@ } } }, - "/dictionary/examples": { + "/breaksentence": { "post": { - "operationId": "LookupDictionaryExamples", - "summary": "Lookup Dictionary Examples", - "description": "Lookup Dictionary Examples", + "operationId": "FindSentenceBoundaries", + "summary": "Find Sentence Boundaries", + "description": "Find Sentence Boundaries", "parameters": [ { "name": "X-ClientTraceId", @@ -125,10 +164,10 @@ "x-ms-client-name": "clientTraceId" }, { - "$ref": "#/parameters/DictionaryExamplesParameters.from" + "$ref": "#/parameters/BreakSentenceParameters.language" }, { - "$ref": "#/parameters/DictionaryExamplesParameters.to" + "$ref": "#/parameters/BreakSentenceParameters.script" }, { "name": "api-version", @@ -146,7 +185,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/DictionaryExampleTextItem" + "$ref": "#/definitions/InputTextItem" }, "x-ms-identifiers": [] } @@ -154,11 +193,11 @@ ], "responses": { "200": { - "description": "Response for the dictionary examples API.", + "description": "Response for the Break SEntence API.", "schema": { "type": "array", "items": { - "$ref": "#/definitions/DictionaryExampleItem" + "$ref": "#/definitions/BreakSentenceItem" }, "x-ms-identifiers": [] }, @@ -184,11 +223,11 @@ } } }, - "/dictionary/lookup": { + "/dictionary/examples": { "post": { - "operationId": "LookupDictionaryEntries", - "summary": "Lookup Dictionary Entries", - "description": "Lookup Dictionary Entries", + "operationId": "LookupDictionaryExamples", + "summary": "Lookup Dictionary Examples", + "description": "Lookup Dictionary Examples", "parameters": [ { "name": "X-ClientTraceId", @@ -199,10 +238,10 @@ "x-ms-client-name": "clientTraceId" }, { - "$ref": "#/parameters/DictionaryLookupParameters.from" + "$ref": "#/parameters/DictionaryExamplesParameters.from" }, { - "$ref": "#/parameters/DictionaryLookupParameters.to" + "$ref": "#/parameters/DictionaryExamplesParameters.to" }, { "name": "api-version", @@ -220,7 +259,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/InputTextItem" + "$ref": "#/definitions/DictionaryExampleTextItem" }, "x-ms-identifiers": [] } @@ -228,11 +267,11 @@ ], "responses": { "200": { - "description": "Response for the dictionary lookup API.", + "description": "Response for the dictionary examples API.", "schema": { "type": "array", "items": { - "$ref": "#/definitions/DictionaryLookupItem" + "$ref": "#/definitions/DictionaryExampleItem" }, "x-ms-identifiers": [] }, @@ -258,11 +297,11 @@ } } }, - "/languages": { - "get": { - "operationId": "GetSupportedLanguages", - "summary": "Gets the set of languages currently supported by other operations of the Translator.", - "description": "Gets the set of languages currently supported by other operations of the Translator.", + "/dictionary/lookup": { + "post": { + "operationId": "LookupDictionaryEntries", + "summary": "Lookup Dictionary Entries", + "description": "Lookup Dictionary Entries", "parameters": [ { "name": "X-ClientTraceId", @@ -273,13 +312,10 @@ "x-ms-client-name": "clientTraceId" }, { - "$ref": "#/parameters/GetSupportedLanguagesParameters.scope" - }, - { - "$ref": "#/parameters/GetSupportedLanguagesParameters.acceptLanguage" + "$ref": "#/parameters/DictionaryLookupParameters.from" }, { - "$ref": "#/parameters/GetSupportedLanguagesParameters.ifNoneMatch" + "$ref": "#/parameters/DictionaryLookupParameters.to" }, { "name": "api-version", @@ -288,19 +324,32 @@ "required": true, "type": "string", "x-ms-client-name": "apiVersion" + }, + { + "name": "body", + "in": "body", + "description": "Defines the content of the request", + "required": true, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [] + } } ], "responses": { "200": { - "description": "The request has succeeded.", + "description": "Response for the dictionary lookup API.", "schema": { - "$ref": "#/definitions/GetSupportedLanguagesResult" + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryLookupItem" + }, + "x-ms-identifiers": [] }, "headers": { - "ETag": { - "type": "string", - "description": "Current value of the entity tag for the requested groups of supported languages. \nTo make subsequent requests more efficient, the client may send the `ETag` value in an \n`If-None-Match` header field." - }, "X-RequestId": { "type": "string", "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." @@ -322,11 +371,11 @@ } } }, - "/translate": { - "post": { - "operationId": "Translate", - "summary": "Translate Text", - "description": "Translate Text", + "/languages": { + "get": { + "operationId": "GetSupportedLanguages", + "summary": "Gets the set of languages currently supported by other operations of the Translator.", + "description": "Gets the set of languages currently supported by other operations of the Translator.", "parameters": [ { "name": "X-ClientTraceId", @@ -337,40 +386,13 @@ "x-ms-client-name": "clientTraceId" }, { - "$ref": "#/parameters/TranslateParameters.to" - }, - { - "$ref": "#/parameters/TranslateParameters.from" - }, - { - "$ref": "#/parameters/TranslateParameters.textType" - }, - { - "$ref": "#/parameters/TranslateParameters.category" - }, - { - "$ref": "#/parameters/TranslateParameters.profanityAction" - }, - { - "$ref": "#/parameters/TranslateParameters.profanityMarker" - }, - { - "$ref": "#/parameters/TranslateParameters.includeAlignment" - }, - { - "$ref": "#/parameters/TranslateParameters.includeSentenceLength" - }, - { - "$ref": "#/parameters/TranslateParameters.suggestedFrom" - }, - { - "$ref": "#/parameters/TranslateParameters.fromScript" + "$ref": "#/parameters/GetSupportedLanguagesParameters.scope" }, { - "$ref": "#/parameters/TranslateParameters.toScript" + "$ref": "#/parameters/GetSupportedLanguagesParameters.acceptLanguage" }, { - "$ref": "#/parameters/TranslateParameters.allowFallback" + "$ref": "#/parameters/GetSupportedLanguagesParameters.ifNoneMatch" }, { "name": "api-version", @@ -379,44 +401,22 @@ "required": true, "type": "string", "x-ms-client-name": "apiVersion" - }, - { - "name": "body", - "in": "body", - "description": "Defines the content of the request", - "required": true, - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [] - } } ], "responses": { "200": { - "description": "Response for the translation API.", + "description": "The request has succeeded.", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/TranslatedTextItem" - }, - "x-ms-identifiers": [] + "$ref": "#/definitions/GetSupportedLanguagesResult" }, "headers": { - "X-RequestId": { + "ETag": { "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - }, - "x-metered-usage": { - "type": "integer", - "format": "int32", - "description": "Specifies consumption (the number of characters for which the user will be charged) for the translation \njob request. For example, if the word \"Hello\" is translated from English (en) to French (fr), \nthis field will return the value '5'." + "description": "Current value of the entity tag for the requested groups of supported languages. \nTo make subsequent requests more efficient, the client may send the `ETag` value in an \n`If-None-Match` header field." }, - "x-mt-system": { + "X-RequestId": { "type": "string", - "description": "Specifies the system type that was used for translation for each 'to' language requested for translation. \nThe value is a comma-separated list of strings. Each string indicates a type:\n\n* Custom - Request includes a custom system and at least one custom system was used during translation.\n* Team - All other requests" + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." } } }, From f1e609873b8951206b4e1c484e38639dde51601c Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 23 Jun 2025 13:20:52 -0700 Subject: [PATCH 081/119] Fix versioning --- specification/translation/Azure.AI.TextTranslation/routes.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/translation/Azure.AI.TextTranslation/routes.tsp b/specification/translation/Azure.AI.TextTranslation/routes.tsp index 960238412e08..c8425c7e927f 100644 --- a/specification/translation/Azure.AI.TextTranslation/routes.tsp +++ b/specification/translation/Azure.AI.TextTranslation/routes.tsp @@ -68,7 +68,7 @@ op translateV3 is CustomOperation< @doc("Translate Text") @added(APIVersion.v2025_05_01_preview) op translate is CustomOperation< - TranslateBody, + TranslateBody[], TranslateParameters, TranslationResult, ErrorResponse From 6ed1f84dede47c63343460266f681ce2f4557f5c Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 23 Jun 2025 13:26:04 -0700 Subject: [PATCH 082/119] Fix versioning --- .../preview/v2025-05-01-preview/openapi.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json index da03281c5737..7d18d9c55a13 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json @@ -64,7 +64,11 @@ "description": "Defines the content of the request", "required": true, "schema": { - "$ref": "#/definitions/TranslateBody" + "type": "array", + "items": { + "$ref": "#/definitions/TranslateBody" + }, + "x-ms-identifiers": [] } } ], From 4536615c206a7202ab7d9ab726cb78595ae3ebc1 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 23 Jun 2025 13:48:27 -0700 Subject: [PATCH 083/119] Fix versioning --- .../preview/v2025-05-01-preview/openapi.json | 39 ++++------- .../stable/v3.0/openapi.json | 66 +++++++------------ 2 files changed, 35 insertions(+), 70 deletions(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json index 7d18d9c55a13..9e36ecb12973 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json @@ -67,8 +67,7 @@ "type": "array", "items": { "$ref": "#/definitions/TranslateBody" - }, - "x-ms-identifiers": [] + } } } ], @@ -79,8 +78,7 @@ "type": "array", "items": { "$ref": "#/definitions/TranslatedTextItem" - }, - "x-ms-identifiers": [] + } }, "headers": { "X-RequestId": { @@ -233,8 +231,7 @@ "type": "array", "items": { "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [] + } } } ], @@ -245,8 +242,7 @@ "type": "array", "items": { "$ref": "#/definitions/TransliteratedText" - }, - "x-ms-identifiers": [] + } }, "headers": { "X-RequestId": { @@ -516,8 +512,7 @@ "description": "List of languages with alterative translations and examples for the query expressed in the source language.", "items": { "$ref": "#/definitions/TargetDictionaryLanguage" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -638,8 +633,7 @@ "description": "Translation target parameters.", "items": { "$ref": "#/definitions/TranslateTarget" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -693,8 +687,7 @@ "description": "Translation target parameters.", "items": { "$ref": "#/definitions/TranslateTarget" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -810,8 +803,7 @@ "maxItems": 5, "items": { "$ref": "#/definitions/ReferenceSentencePair" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -831,8 +823,7 @@ "description": "An array of translation results. The size of the array matches the number of target \nlanguages specified through the to query parameter.", "items": { "$ref": "#/definitions/TranslationText" - }, - "x-ms-identifiers": [] + } }, "sourceText": { "$ref": "#/definitions/SourceText", @@ -875,8 +866,7 @@ "description": "Array of the translated text elements.", "items": { "$ref": "#/definitions/TranslatedTextItem" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -914,8 +904,7 @@ "description": "List of scripts available to convert text to.", "items": { "$ref": "#/definitions/LanguageScript" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -936,8 +925,7 @@ "description": "Array of transliterated texts", "items": { "$ref": "#/definitions/TransliteratedText" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -979,8 +967,7 @@ "description": "List of scripts to convert from.", "items": { "$ref": "#/definitions/TransliterableScript" - }, - "x-ms-identifiers": [] + } } }, "required": [ diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json index 17c4df3b2907..0b373c4f3920 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json @@ -103,8 +103,7 @@ "type": "array", "items": { "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [] + } } } ], @@ -115,8 +114,7 @@ "type": "array", "items": { "$ref": "#/definitions/TranslatedTextItem" - }, - "x-ms-identifiers": [] + } }, "headers": { "X-RequestId": { @@ -186,8 +184,7 @@ "type": "array", "items": { "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [] + } } } ], @@ -198,8 +195,7 @@ "type": "array", "items": { "$ref": "#/definitions/BreakSentenceItem" - }, - "x-ms-identifiers": [] + } }, "headers": { "X-RequestId": { @@ -260,8 +256,7 @@ "type": "array", "items": { "$ref": "#/definitions/DictionaryExampleTextItem" - }, - "x-ms-identifiers": [] + } } } ], @@ -272,8 +267,7 @@ "type": "array", "items": { "$ref": "#/definitions/DictionaryExampleItem" - }, - "x-ms-identifiers": [] + } }, "headers": { "X-RequestId": { @@ -334,8 +328,7 @@ "type": "array", "items": { "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [] + } } } ], @@ -346,8 +339,7 @@ "type": "array", "items": { "$ref": "#/definitions/DictionaryLookupItem" - }, - "x-ms-identifiers": [] + } }, "headers": { "X-RequestId": { @@ -475,8 +467,7 @@ "type": "array", "items": { "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [] + } } } ], @@ -487,8 +478,7 @@ "type": "array", "items": { "$ref": "#/definitions/TransliteratedText" - }, - "x-ms-identifiers": [] + } }, "headers": { "X-RequestId": { @@ -574,8 +564,7 @@ "description": "Array of the break sentence elements.", "items": { "$ref": "#/definitions/BreakSentenceItem" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -656,8 +645,7 @@ "description": "A list of examples for the (source term, target term) pair.", "items": { "$ref": "#/definitions/DictionaryExample" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -693,8 +681,7 @@ "description": "Array of the dictionary examples elements.", "items": { "$ref": "#/definitions/DictionaryExampleItem" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -718,8 +705,7 @@ "description": "A list of translations for the source term.", "items": { "$ref": "#/definitions/DictionaryTranslation" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -737,8 +723,7 @@ "description": "Array of the dictionary lookup elements.", "items": { "$ref": "#/definitions/DictionaryLookupItem" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -775,8 +760,7 @@ "description": "A list of \"back translations\" of the target. For example, source words that the target can translate to.\nThe list is guaranteed to contain the source word that was requested (e.g., if the source word being\nlooked up is \"fly\", then it is guaranteed that \"fly\" will be in the backTranslations list).\nHowever, it is not guaranteed to be in the first position, and often will not be.", "items": { "$ref": "#/definitions/BackTranslation" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -1013,8 +997,7 @@ "description": "List of languages with alterative translations and examples for the query expressed in the source language.", "items": { "$ref": "#/definitions/TargetDictionaryLanguage" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -1115,8 +1098,7 @@ "description": "An array of translation results. The size of the array matches the number of target \nlanguages specified through the to query parameter.", "items": { "$ref": "#/definitions/TranslationText" - }, - "x-ms-identifiers": [] + } }, "sourceText": { "$ref": "#/definitions/SourceText", @@ -1159,8 +1141,7 @@ "description": "Array of the translated text elements.", "items": { "$ref": "#/definitions/TranslatedTextItem" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -1206,8 +1187,7 @@ "description": "List of scripts available to convert text to.", "items": { "$ref": "#/definitions/LanguageScript" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -1228,8 +1208,7 @@ "description": "Array of transliterated texts", "items": { "$ref": "#/definitions/TransliteratedText" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -1271,8 +1250,7 @@ "description": "List of scripts to convert from.", "items": { "$ref": "#/definitions/TransliterableScript" - }, - "x-ms-identifiers": [] + } } }, "required": [ From b12210a6f08bda18d8e8d049cf5b4365486e959e Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 23 Jun 2025 13:53:01 -0700 Subject: [PATCH 084/119] Fix versioning --- .../translation/Azure.AI.TextTranslation/models-shared.tsp | 3 --- specification/translation/Azure.AI.TextTranslation/routes.tsp | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-shared.tsp b/specification/translation/Azure.AI.TextTranslation/models-shared.tsp index 7f4031d7b113..7c5e1ddefb33 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-shared.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-shared.tsp @@ -16,18 +16,15 @@ alias CommonParameters = { clientTraceId?: string; }; - @doc("Element containing the text for translation.") model InputTextItem { @doc("Text to translate.") text: string; } - @doc("Element containing the text for translation.") @added(APIVersion.v2025_05_01_preview) model TranslateBody { - @doc("Text to translate.") text: string; diff --git a/specification/translation/Azure.AI.TextTranslation/routes.tsp b/specification/translation/Azure.AI.TextTranslation/routes.tsp index c8425c7e927f..65054dbcf6e3 100644 --- a/specification/translation/Azure.AI.TextTranslation/routes.tsp +++ b/specification/translation/Azure.AI.TextTranslation/routes.tsp @@ -52,7 +52,7 @@ op getSupportedLanguages is CustomGetOperation< @summary("Translate Text") @doc("Translate Text") @sharedRoute -@renamedFrom(APIVersion.v2025_05_01_preview,"translate") +@renamedFrom(APIVersion.v2025_05_01_preview, "translate") @removed(APIVersion.v2025_05_01_preview) op translateV3 is CustomOperation< InputTextItem[], @@ -74,7 +74,6 @@ op translate is CustomOperation< ErrorResponse >; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." @post @route("transliterate") From a15b88dd80ee5877363d275ea8dd1484eb092734 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 23 Jun 2025 19:25:21 -0700 Subject: [PATCH 085/119] Fix 3.0 examples --- ...FindSentenceBoundaries_MaximumSet_Gen.json | 0 ...FindSentenceBoundaries_MinimumSet_Gen.json | 0 .../GetSupportedLanguages_MaximumSet_Gen.json | 0 .../GetSupportedLanguages_MinimumSet_Gen.json | 0 ...ookupDictionaryEntries_MaximumSet_Gen.json | 0 ...ookupDictionaryEntries_MinimumSet_Gen.json | 0 ...okupDictionaryExamples_MaximumSet_Gen.json | 0 ...okupDictionaryExamples_MinimumSet_Gen.json | 0 .../Translate_MaximumSet_Gen.json | 0 .../Translate_MinimumSet_Gen.json | 0 .../Transliterate_MaximumSet_Gen.json | 0 .../Transliterate_MinimumSet_Gen.json | 0 .../stable/v3.0/openapi.json | 48 +++++++++++++++++++ 13 files changed, 48 insertions(+) rename specification/translation/Azure.AI.TextTranslation/examples/{v3.0 => 3.0}/FindSentenceBoundaries_MaximumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{v3.0 => 3.0}/FindSentenceBoundaries_MinimumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{v3.0 => 3.0}/GetSupportedLanguages_MaximumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{v3.0 => 3.0}/GetSupportedLanguages_MinimumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{v3.0 => 3.0}/LookupDictionaryEntries_MaximumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{v3.0 => 3.0}/LookupDictionaryEntries_MinimumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{v3.0 => 3.0}/LookupDictionaryExamples_MaximumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{v3.0 => 3.0}/LookupDictionaryExamples_MinimumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{v3.0 => 3.0}/Translate_MaximumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{v3.0 => 3.0}/Translate_MinimumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{v3.0 => 3.0}/Transliterate_MaximumSet_Gen.json (100%) rename specification/translation/Azure.AI.TextTranslation/examples/{v3.0 => 3.0}/Transliterate_MinimumSet_Gen.json (100%) diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/FindSentenceBoundaries_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/FindSentenceBoundaries_MaximumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/v3.0/FindSentenceBoundaries_MaximumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/FindSentenceBoundaries_MaximumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/FindSentenceBoundaries_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/FindSentenceBoundaries_MinimumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/v3.0/FindSentenceBoundaries_MinimumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/FindSentenceBoundaries_MinimumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/GetSupportedLanguages_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/GetSupportedLanguages_MaximumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/v3.0/GetSupportedLanguages_MaximumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/GetSupportedLanguages_MaximumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/GetSupportedLanguages_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/GetSupportedLanguages_MinimumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/v3.0/GetSupportedLanguages_MinimumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/GetSupportedLanguages_MinimumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryEntries_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryEntries_MaximumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryEntries_MaximumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryEntries_MaximumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryEntries_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryEntries_MinimumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryEntries_MinimumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryEntries_MinimumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryExamples_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryExamples_MaximumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryExamples_MaximumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryExamples_MaximumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryExamples_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryExamples_MinimumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/v3.0/LookupDictionaryExamples_MinimumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryExamples_MinimumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Translate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/Translate_MaximumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/v3.0/Translate_MaximumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/Translate_MaximumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Translate_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/Translate_MinimumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/v3.0/Translate_MinimumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/Translate_MinimumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Transliterate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/Transliterate_MaximumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/v3.0/Transliterate_MaximumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/Transliterate_MaximumSet_Gen.json diff --git a/specification/translation/Azure.AI.TextTranslation/examples/v3.0/Transliterate_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/Transliterate_MinimumSet_Gen.json similarity index 100% rename from specification/translation/Azure.AI.TextTranslation/examples/v3.0/Transliterate_MinimumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/Transliterate_MinimumSet_Gen.json diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json index 0b373c4f3920..24cfdfe34e30 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json @@ -144,6 +144,14 @@ } } } + }, + "x-ms-examples": { + "Translate Text": { + "$ref": "./examples/Translate_MaximumSet_Gen.json" + }, + "Translate Text with minimum properties": { + "$ref": "./examples/Translate_MinimumSet_Gen.json" + } } } }, @@ -216,6 +224,14 @@ } } } + }, + "x-ms-examples": { + "Find Sentence Boundaries": { + "$ref": "./examples/FindSentenceBoundaries_MaximumSet_Gen.json" + }, + "Find Sentence Boundaries with minimum properties": { + "$ref": "./examples/FindSentenceBoundaries_MinimumSet_Gen.json" + } } } }, @@ -288,6 +304,14 @@ } } } + }, + "x-ms-examples": { + "Lookup Dictionary Examples": { + "$ref": "./examples/LookupDictionaryExamples_MaximumSet_Gen.json" + }, + "Lookup Dictionary Examples with minimum properties": { + "$ref": "./examples/LookupDictionaryExamples_MinimumSet_Gen.json" + } } } }, @@ -360,6 +384,14 @@ } } } + }, + "x-ms-examples": { + "Lookup Dictionary Entries": { + "$ref": "./examples/LookupDictionaryEntries_MaximumSet_Gen.json" + }, + "Lookup Dictionary Entries with minimum properties": { + "$ref": "./examples/LookupDictionaryEntries_MinimumSet_Gen.json" + } } } }, @@ -424,6 +456,14 @@ } } } + }, + "x-ms-examples": { + "Gets the set of languages currently supported by other operations of the Translator with minimum properties.": { + "$ref": "./examples/GetSupportedLanguages_MinimumSet_Gen.json" + }, + "Gets the set of languages currently supported by other operations of the Translator.": { + "$ref": "./examples/GetSupportedLanguages_MaximumSet_Gen.json" + } } } }, @@ -499,6 +539,14 @@ } } } + }, + "x-ms-examples": { + "Transliterate Text": { + "$ref": "./examples/Transliterate_MaximumSet_Gen.json" + }, + "Transliterate Text with minimum properties": { + "$ref": "./examples/Transliterate_MinimumSet_Gen.json" + } } } } From 25ae60b4c4028d59802de9ed4c1cf4427d652caf Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 23 Jun 2025 19:39:14 -0700 Subject: [PATCH 086/119] Fix 3.0 examples --- .../Azure.AI.TextTranslation/routes.tsp | 2 + .../preview/v2025-05-01-preview/openapi.json | 118 ++++----- .../stable/v3.0/openapi.json | 238 +++++++++--------- 3 files changed, 180 insertions(+), 178 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/routes.tsp b/specification/translation/Azure.AI.TextTranslation/routes.tsp index 65054dbcf6e3..c9a7d8c6a791 100644 --- a/specification/translation/Azure.AI.TextTranslation/routes.tsp +++ b/specification/translation/Azure.AI.TextTranslation/routes.tsp @@ -51,6 +51,7 @@ op getSupportedLanguages is CustomGetOperation< @post @summary("Translate Text") @doc("Translate Text") +@route("translate") @sharedRoute @renamedFrom(APIVersion.v2025_05_01_preview, "translate") @removed(APIVersion.v2025_05_01_preview) @@ -66,6 +67,7 @@ op translateV3 is CustomOperation< @sharedRoute @summary("Translate Text") @doc("Translate Text") +@route("translate") @added(APIVersion.v2025_05_01_preview) op translate is CustomOperation< TranslateBody[], diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json index 9e36ecb12973..2744b1a7c722 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json @@ -36,11 +36,11 @@ ], "tags": [], "paths": { - "/": { - "post": { - "operationId": "Translate", - "summary": "Translate Text", - "description": "Translate Text", + "/languages": { + "get": { + "operationId": "GetSupportedLanguages", + "summary": "Gets the set of languages currently supported by other operations of the Translator.", + "description": "Gets the set of languages currently supported by other operations of the Translator.", "parameters": [ { "name": "X-ClientTraceId", @@ -50,6 +50,15 @@ "type": "string", "x-ms-client-name": "clientTraceId" }, + { + "$ref": "#/parameters/GetSupportedLanguagesParameters.scope" + }, + { + "$ref": "#/parameters/GetSupportedLanguagesParameters.acceptLanguage" + }, + { + "$ref": "#/parameters/GetSupportedLanguagesParameters.ifNoneMatch" + }, { "name": "api-version", "in": "query", @@ -57,42 +66,22 @@ "required": true, "type": "string", "x-ms-client-name": "apiVersion" - }, - { - "name": "body", - "in": "body", - "description": "Defines the content of the request", - "required": true, - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/TranslateBody" - } - } } ], "responses": { "200": { - "description": "Response for the translation API.", + "description": "The request has succeeded.", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/TranslatedTextItem" - } + "$ref": "#/definitions/GetSupportedLanguagesResult" }, "headers": { - "X-RequestId": { + "ETag": { "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - }, - "x-metered-usage": { - "type": "integer", - "format": "int32", - "description": "Specifies consumption (the number of characters for which the user will be charged) for the translation \njob request. For example, if the word \"Hello\" is translated from English (en) to French (fr), \nthis field will return the value '5'." + "description": "Current value of the entity tag for the requested groups of supported languages. \nTo make subsequent requests more efficient, the client may send the `ETag` value in an \n`If-None-Match` header field." }, - "x-mt-system": { + "X-RequestId": { "type": "string", - "description": "Specifies the system type that was used for translation for each 'to' language requested for translation. \nThe value is a comma-separated list of strings. Each string indicates a type:\n\n* Custom - Request includes a custom system and at least one custom system was used during translation.\n* Team - All other requests" + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." } } }, @@ -110,20 +99,20 @@ } }, "x-ms-examples": { - "Translate Text": { - "$ref": "./examples/Translate_MaximumSet_Gen.json" + "Gets the set of languages currently supported by other operations of the Translator with minimum properties.": { + "$ref": "./examples/GetSupportedLanguages_MinimumSet_Gen.json" }, - "Translate Text with minimum properties": { - "$ref": "./examples/Translate_MinimumSet_Gen.json" + "Gets the set of languages currently supported by other operations of the Translator.": { + "$ref": "./examples/GetSupportedLanguages_MaximumSet_Gen.json" } } } }, - "/languages": { - "get": { - "operationId": "GetSupportedLanguages", - "summary": "Gets the set of languages currently supported by other operations of the Translator.", - "description": "Gets the set of languages currently supported by other operations of the Translator.", + "/translate": { + "post": { + "operationId": "Translate", + "summary": "Translate Text", + "description": "Translate Text", "parameters": [ { "name": "X-ClientTraceId", @@ -133,15 +122,6 @@ "type": "string", "x-ms-client-name": "clientTraceId" }, - { - "$ref": "#/parameters/GetSupportedLanguagesParameters.scope" - }, - { - "$ref": "#/parameters/GetSupportedLanguagesParameters.acceptLanguage" - }, - { - "$ref": "#/parameters/GetSupportedLanguagesParameters.ifNoneMatch" - }, { "name": "api-version", "in": "query", @@ -149,22 +129,42 @@ "required": true, "type": "string", "x-ms-client-name": "apiVersion" + }, + { + "name": "body", + "in": "body", + "description": "Defines the content of the request", + "required": true, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TranslateBody" + } + } } ], "responses": { "200": { - "description": "The request has succeeded.", + "description": "Response for the translation API.", "schema": { - "$ref": "#/definitions/GetSupportedLanguagesResult" + "type": "array", + "items": { + "$ref": "#/definitions/TranslatedTextItem" + } }, "headers": { - "ETag": { - "type": "string", - "description": "Current value of the entity tag for the requested groups of supported languages. \nTo make subsequent requests more efficient, the client may send the `ETag` value in an \n`If-None-Match` header field." - }, "X-RequestId": { "type": "string", "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + }, + "x-metered-usage": { + "type": "integer", + "format": "int32", + "description": "Specifies consumption (the number of characters for which the user will be charged) for the translation \njob request. For example, if the word \"Hello\" is translated from English (en) to French (fr), \nthis field will return the value '5'." + }, + "x-mt-system": { + "type": "string", + "description": "Specifies the system type that was used for translation for each 'to' language requested for translation. \nThe value is a comma-separated list of strings. Each string indicates a type:\n\n* Custom - Request includes a custom system and at least one custom system was used during translation.\n* Team - All other requests" } } }, @@ -182,11 +182,11 @@ } }, "x-ms-examples": { - "Gets the set of languages currently supported by other operations of the Translator with minimum properties.": { - "$ref": "./examples/GetSupportedLanguages_MinimumSet_Gen.json" + "Translate Text": { + "$ref": "./examples/Translate_MaximumSet_Gen.json" }, - "Gets the set of languages currently supported by other operations of the Translator.": { - "$ref": "./examples/GetSupportedLanguages_MaximumSet_Gen.json" + "Translate Text with minimum properties": { + "$ref": "./examples/Translate_MinimumSet_Gen.json" } } } diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json index 24cfdfe34e30..8f53bc59db5b 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json @@ -36,125 +36,6 @@ ], "tags": [], "paths": { - "/": { - "post": { - "operationId": "Translate", - "summary": "Translate Text", - "description": "Translate Text", - "parameters": [ - { - "name": "X-ClientTraceId", - "in": "header", - "description": "A client-generated GUID to uniquely identify the request.", - "required": false, - "type": "string", - "x-ms-client-name": "clientTraceId" - }, - { - "$ref": "#/parameters/TranslateParameters.to" - }, - { - "$ref": "#/parameters/TranslateParameters.from" - }, - { - "$ref": "#/parameters/TranslateParameters.textType" - }, - { - "$ref": "#/parameters/TranslateParameters.category" - }, - { - "$ref": "#/parameters/TranslateParameters.profanityAction" - }, - { - "$ref": "#/parameters/TranslateParameters.profanityMarker" - }, - { - "$ref": "#/parameters/TranslateParameters.includeAlignment" - }, - { - "$ref": "#/parameters/TranslateParameters.includeSentenceLength" - }, - { - "$ref": "#/parameters/TranslateParameters.suggestedFrom" - }, - { - "$ref": "#/parameters/TranslateParameters.fromScript" - }, - { - "$ref": "#/parameters/TranslateParameters.toScript" - }, - { - "$ref": "#/parameters/TranslateParameters.allowFallback" - }, - { - "name": "api-version", - "in": "query", - "description": "Mandatory API version parameter", - "required": true, - "type": "string", - "x-ms-client-name": "apiVersion" - }, - { - "name": "body", - "in": "body", - "description": "Defines the content of the request", - "required": true, - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/InputTextItem" - } - } - } - ], - "responses": { - "200": { - "description": "Response for the translation API.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/TranslatedTextItem" - } - }, - "headers": { - "X-RequestId": { - "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - }, - "x-metered-usage": { - "type": "integer", - "format": "int32", - "description": "Specifies consumption (the number of characters for which the user will be charged) for the translation \njob request. For example, if the word \"Hello\" is translated from English (en) to French (fr), \nthis field will return the value '5'." - }, - "x-mt-system": { - "type": "string", - "description": "Specifies the system type that was used for translation for each 'to' language requested for translation. \nThe value is a comma-separated list of strings. Each string indicates a type:\n\n* Custom - Request includes a custom system and at least one custom system was used during translation.\n* Team - All other requests" - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - }, - "headers": { - "X-RequestId": { - "type": "string", - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." - } - } - } - }, - "x-ms-examples": { - "Translate Text": { - "$ref": "./examples/Translate_MaximumSet_Gen.json" - }, - "Translate Text with minimum properties": { - "$ref": "./examples/Translate_MinimumSet_Gen.json" - } - } - } - }, "/breaksentence": { "post": { "operationId": "FindSentenceBoundaries", @@ -467,6 +348,125 @@ } } }, + "/translate": { + "post": { + "operationId": "Translate", + "summary": "Translate Text", + "description": "Translate Text", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "description": "A client-generated GUID to uniquely identify the request.", + "required": false, + "type": "string", + "x-ms-client-name": "clientTraceId" + }, + { + "$ref": "#/parameters/TranslateParameters.to" + }, + { + "$ref": "#/parameters/TranslateParameters.from" + }, + { + "$ref": "#/parameters/TranslateParameters.textType" + }, + { + "$ref": "#/parameters/TranslateParameters.category" + }, + { + "$ref": "#/parameters/TranslateParameters.profanityAction" + }, + { + "$ref": "#/parameters/TranslateParameters.profanityMarker" + }, + { + "$ref": "#/parameters/TranslateParameters.includeAlignment" + }, + { + "$ref": "#/parameters/TranslateParameters.includeSentenceLength" + }, + { + "$ref": "#/parameters/TranslateParameters.suggestedFrom" + }, + { + "$ref": "#/parameters/TranslateParameters.fromScript" + }, + { + "$ref": "#/parameters/TranslateParameters.toScript" + }, + { + "$ref": "#/parameters/TranslateParameters.allowFallback" + }, + { + "name": "api-version", + "in": "query", + "description": "Mandatory API version parameter", + "required": true, + "type": "string", + "x-ms-client-name": "apiVersion" + }, + { + "name": "body", + "in": "body", + "description": "Defines the content of the request", + "required": true, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + } + } + } + ], + "responses": { + "200": { + "description": "Response for the translation API.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TranslatedTextItem" + } + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + }, + "x-metered-usage": { + "type": "integer", + "format": "int32", + "description": "Specifies consumption (the number of characters for which the user will be charged) for the translation \njob request. For example, if the word \"Hello\" is translated from English (en) to French (fr), \nthis field will return the value '5'." + }, + "x-mt-system": { + "type": "string", + "description": "Specifies the system type that was used for translation for each 'to' language requested for translation. \nThe value is a comma-separated list of strings. Each string indicates a type:\n\n* Custom - Request includes a custom system and at least one custom system was used during translation.\n* Team - All other requests" + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "headers": { + "X-RequestId": { + "type": "string", + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." + } + } + } + }, + "x-ms-examples": { + "Translate Text": { + "$ref": "./examples/Translate_MaximumSet_Gen.json" + }, + "Translate Text with minimum properties": { + "$ref": "./examples/Translate_MinimumSet_Gen.json" + } + } + } + }, "/transliterate": { "post": { "operationId": "Transliterate", From 3793b2692da83d5ff71cd544eb1235f0a397d5cf Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Wed, 2 Jul 2025 20:12:46 -0700 Subject: [PATCH 087/119] Update target.language --- .../translation/Azure.AI.TextTranslation/models-translate.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index 1f017ee62a2e..c7a21ad2d553 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -132,7 +132,7 @@ model TranslateTarget { in the translation scope. It's possible to translate to multiple languages simultaneously by including multiple string values in the targetsLanguage array. """) - language: string[]; + language: string; @doc(""" Specifies the script of the translated text. From e966b79af4f0d224f435a8d67b528c91fc7595b4 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Wed, 2 Jul 2025 20:22:20 -0700 Subject: [PATCH 088/119] Update target.language --- .../preview/v2025-05-01-preview/openapi.json | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json index 2744b1a7c722..edc7260f19bb 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json @@ -704,11 +704,8 @@ "description": "Translate targets parameters", "properties": { "language": { - "type": "array", - "description": "Specifies the language of the output text. The target language must be one of the supported languages included \nin the translation scope. It's possible to translate to multiple languages simultaneously by including \nmultiple string values in the targetsLanguage array.", - "items": { - "type": "string" - } + "type": "string", + "description": "Specifies the language of the output text. The target language must be one of the supported languages included \nin the translation scope. It's possible to translate to multiple languages simultaneously by including \nmultiple string values in the targetsLanguage array." }, "script": { "type": "string", From 897ff05f3bb0a84774e9ebe87d772ead79da9f73 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Wed, 2 Jul 2025 20:35:04 -0700 Subject: [PATCH 089/119] Update target.language --- .../examples/2025-05-01-preview/Translate_MaximumSet_Gen.json | 4 +--- .../examples/2025-05-01-preview/Translate_MinimumSet_Gen.json | 4 +--- .../examples/Translate_MaximumSet_Gen.json | 4 +--- .../examples/Translate_MinimumSet_Gen.json | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json index 1f0f56b92ecc..a2e8de398ca9 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json @@ -12,9 +12,7 @@ "textType": "Plain", "targets": [ { - "language": [ - "cs" - ], + "language": "cs", "script": "Latn", "profanityAction": "NoAction", "profanityMarker": "Asterisk", diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json index d22bf9d8e56a..186996d144b5 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json @@ -8,9 +8,7 @@ "text": "This is a test.", "targets": [ { - "language": [ - "cs" - ] + "language": "cs" } ] } diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json index 1f0f56b92ecc..a2e8de398ca9 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json @@ -12,9 +12,7 @@ "textType": "Plain", "targets": [ { - "language": [ - "cs" - ], + "language": "cs", "script": "Latn", "profanityAction": "NoAction", "profanityMarker": "Asterisk", diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MinimumSet_Gen.json index d22bf9d8e56a..186996d144b5 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MinimumSet_Gen.json @@ -8,9 +8,7 @@ "text": "This is a test.", "targets": [ { - "language": [ - "cs" - ] + "language": "cs" } ] } From ca41dcbe9dd8495afa18e4dbf21738ec4111a983 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Thu, 10 Jul 2025 19:56:26 -0700 Subject: [PATCH 090/119] Remove SourceText. Rename DeploymentName --- .../examples/2025-05-01-preview/Translate_MaximumSet_Gen.json | 2 +- .../translation/Azure.AI.TextTranslation/models-translate.tsp | 3 ++- .../v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json | 2 +- .../preview/v2025-05-01-preview/openapi.json | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json index a2e8de398ca9..9b217c78dfd5 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json @@ -16,7 +16,7 @@ "script": "Latn", "profanityAction": "NoAction", "profanityMarker": "Asterisk", - "deploymentNameModel": "general", + "deploymentName": "general", "allowFallback": true, "grade": "basic", "tone": "formal", diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index c7a21ad2d553..f94a93132f75 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -161,7 +161,7 @@ model TranslateTarget { in future. Customer should have deployed it in their resource. """) - deploymentNameModel?: string = "general"; + deploymentName?: string = "general"; @doc(""" In the case where a custom system is being used, specifies that the service is allowed to fall back to a @@ -327,6 +327,7 @@ model TranslatedTextItem { """) translations: TranslationText[]; + @removed(APIVersion.v2025_05_01_preview) @doc(""" Input text in the default script of the source language. sourceText property is present only when the input is expressed in a script that's not the usual script for the language. For example, diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json index a2e8de398ca9..9b217c78dfd5 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json @@ -16,7 +16,7 @@ "script": "Latn", "profanityAction": "NoAction", "profanityMarker": "Asterisk", - "deploymentNameModel": "general", + "deploymentName": "general", "allowFallback": true, "grade": "basic", "tone": "formal", diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json index edc7260f19bb..fc9357e80e1f 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json @@ -767,7 +767,7 @@ ] } }, - "deploymentNameModel": { + "deploymentName": { "type": "string", "description": "Default is ‘general’, which uses NMT system.\n‘abc-inc-gpt-4o’, and ‘abc-inc-gpt-4o-mini’ are examples of deployment names which use GPT-4o uses or \nGPT-4o-mini model. ‘gpt-4o’ uses GPT-4o model. \n\n‘’ uses the custom NMT model tuned by customer.\n‘best’ system determines which is the best model to use for the request. This intelligence could be introduced\nin future. Customer should have deployed it in their resource.\n", "default": "general" From 1110e138d67e5745368ac77870f0031f09a18216 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Thu, 10 Jul 2025 20:02:00 -0700 Subject: [PATCH 091/119] Remove SourceText. Rename DeploymentName --- .../preview/v2025-05-01-preview/openapi.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json index fc9357e80e1f..c5a735d0a6a9 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json @@ -821,10 +821,6 @@ "items": { "$ref": "#/definitions/TranslationText" } - }, - "sourceText": { - "$ref": "#/definitions/SourceText", - "description": "Input text in the default script of the source language. sourceText property is present only when \nthe input is expressed in a script that's not the usual script for the language. For example, \nif the input were Arabic written in Latin script, then sourceText.text would be the same Arabic text \nconverted into Arab script." } }, "required": [ From 53895f72e7547e48c627da33cb283b4b78d65952 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Thu, 10 Jul 2025 20:20:31 -0700 Subject: [PATCH 092/119] Remove SourceText. Rename DeploymentName --- .../2025-05-01-preview/Translate_MaximumSet_Gen.json | 5 +---- .../examples/Translate_MaximumSet_Gen.json | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json index 9b217c78dfd5..cc24ca7c9ca4 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json @@ -50,10 +50,7 @@ "script": "Latn" } } - ], - "sourceText": { - "text": "This is a test" - } + ] } ] } diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json index 9b217c78dfd5..cc24ca7c9ca4 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json @@ -50,10 +50,7 @@ "script": "Latn" } } - ], - "sourceText": { - "text": "This is a test" - } + ] } ] } From 04159bf313e21e8bbd5a8d415f4c9895bb233a36 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 22 Aug 2025 12:15:06 -0700 Subject: [PATCH 093/119] updating comment --- specification/translation/Azure.AI.TextTranslation/main.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/translation/Azure.AI.TextTranslation/main.tsp b/specification/translation/Azure.AI.TextTranslation/main.tsp index 6781c417d002..074176cbe0ac 100644 --- a/specification/translation/Azure.AI.TextTranslation/main.tsp +++ b/specification/translation/Azure.AI.TextTranslation/main.tsp @@ -30,7 +30,7 @@ using TypeSpec.Versioning; Translate. Renders single source-language text to multiple target-language texts with a single request. - Transliterate. Converts characters or letters of a source language to the corresponding characters or letters of a target language. + Transliterate. Converts characters or letters of a source language to the corresponding characters or letters of a target language via translit. Detect. Returns the source code language code and a boolean variable denoting whether the detected language is supported for text translation and transliteration. """) From 2adf5d79cbeb5f1df264162ba0d0b0e1a54de922 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 22 Aug 2025 14:10:36 -0700 Subject: [PATCH 094/119] Remove deprecated @fixed decorators from typespec --- .../translation/Azure.AI.TextTranslation/models-languages.tsp | 1 - .../translation/Azure.AI.TextTranslation/models-translate.tsp | 2 -- 2 files changed, 3 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-languages.tsp b/specification/translation/Azure.AI.TextTranslation/models-languages.tsp index 1e7e697ccf79..5e3a13c5af7e 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-languages.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-languages.tsp @@ -139,7 +139,6 @@ model TargetDictionaryLanguage { #suppress "@azure-tools/typespec-azure-core/use-extensible-enum" "Enums should be defined without the `@fixed` decorator." #suppress "@azure-tools/typespec-azure-core/no-enum" "Azure services should not use the enum keyword." -@fixed @doc("Language Directionality") enum LanguageDirectionality { @doc("Language is written left to right.") diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index f94a93132f75..fdcf216ad96b 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -291,7 +291,6 @@ union TextType { #suppress "@azure-tools/typespec-azure-core/use-extensible-enum" "Enums should be defined without the `@fixed` decorator." #suppress "@azure-tools/typespec-azure-core/no-enum" "Azure services should not use the enum keyword." -@fixed @doc("Translator profanity actions") enum ProfanityAction { @doc("No Action is taken on profanity") @@ -306,7 +305,6 @@ enum ProfanityAction { #suppress "@azure-tools/typespec-azure-core/use-extensible-enum" "Enums should be defined without the `@fixed` decorator." #suppress "@azure-tools/typespec-azure-core/no-enum" "Azure services should not use the enum keyword." -@fixed @doc("Translator profanity markers") enum ProfanityMarker { @doc("Profanity is marked with asterisk.") From 883f7927dade4dcb60bddc469225ab625dcd49d2 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 22 Aug 2025 14:16:57 -0700 Subject: [PATCH 095/119] Remove deprecated @fixed decorators from typespec --- .../Azure.AI.TextTranslation/main.tsp | 2 +- .../preview/v2025-05-01-preview/openapi.json | 39 +++++++---- .../stable/v3.0/openapi.json | 66 ++++++++++++------- 3 files changed, 71 insertions(+), 36 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/main.tsp b/specification/translation/Azure.AI.TextTranslation/main.tsp index 074176cbe0ac..6781c417d002 100644 --- a/specification/translation/Azure.AI.TextTranslation/main.tsp +++ b/specification/translation/Azure.AI.TextTranslation/main.tsp @@ -30,7 +30,7 @@ using TypeSpec.Versioning; Translate. Renders single source-language text to multiple target-language texts with a single request. - Transliterate. Converts characters or letters of a source language to the corresponding characters or letters of a target language via translit. + Transliterate. Converts characters or letters of a source language to the corresponding characters or letters of a target language. Detect. Returns the source code language code and a boolean variable denoting whether the detected language is supported for text translation and transliteration. """) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json index c5a735d0a6a9..65d69063fb3b 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json @@ -139,7 +139,8 @@ "type": "array", "items": { "$ref": "#/definitions/TranslateBody" - } + }, + "x-ms-identifiers": [] } } ], @@ -150,7 +151,8 @@ "type": "array", "items": { "$ref": "#/definitions/TranslatedTextItem" - } + }, + "x-ms-identifiers": [] }, "headers": { "X-RequestId": { @@ -231,7 +233,8 @@ "type": "array", "items": { "$ref": "#/definitions/InputTextItem" - } + }, + "x-ms-identifiers": [] } } ], @@ -242,7 +245,8 @@ "type": "array", "items": { "$ref": "#/definitions/TransliteratedText" - } + }, + "x-ms-identifiers": [] }, "headers": { "X-RequestId": { @@ -512,7 +516,8 @@ "description": "List of languages with alterative translations and examples for the query expressed in the source language.", "items": { "$ref": "#/definitions/TargetDictionaryLanguage" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -633,7 +638,8 @@ "description": "Translation target parameters.", "items": { "$ref": "#/definitions/TranslateTarget" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -687,7 +693,8 @@ "description": "Translation target parameters.", "items": { "$ref": "#/definitions/TranslateTarget" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -800,7 +807,8 @@ "maxItems": 5, "items": { "$ref": "#/definitions/ReferenceSentencePair" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -820,7 +828,8 @@ "description": "An array of translation results. The size of the array matches the number of target \nlanguages specified through the to query parameter.", "items": { "$ref": "#/definitions/TranslationText" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -859,7 +868,8 @@ "description": "Array of the translated text elements.", "items": { "$ref": "#/definitions/TranslatedTextItem" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -897,7 +907,8 @@ "description": "List of scripts available to convert text to.", "items": { "$ref": "#/definitions/LanguageScript" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -918,7 +929,8 @@ "description": "Array of transliterated texts", "items": { "$ref": "#/definitions/TransliteratedText" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -960,7 +972,8 @@ "description": "List of scripts to convert from.", "items": { "$ref": "#/definitions/TransliterableScript" - } + }, + "x-ms-identifiers": [] } }, "required": [ diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json index 8f53bc59db5b..67d9879f46b6 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json @@ -73,7 +73,8 @@ "type": "array", "items": { "$ref": "#/definitions/InputTextItem" - } + }, + "x-ms-identifiers": [] } } ], @@ -84,7 +85,8 @@ "type": "array", "items": { "$ref": "#/definitions/BreakSentenceItem" - } + }, + "x-ms-identifiers": [] }, "headers": { "X-RequestId": { @@ -153,7 +155,8 @@ "type": "array", "items": { "$ref": "#/definitions/DictionaryExampleTextItem" - } + }, + "x-ms-identifiers": [] } } ], @@ -164,7 +167,8 @@ "type": "array", "items": { "$ref": "#/definitions/DictionaryExampleItem" - } + }, + "x-ms-identifiers": [] }, "headers": { "X-RequestId": { @@ -233,7 +237,8 @@ "type": "array", "items": { "$ref": "#/definitions/InputTextItem" - } + }, + "x-ms-identifiers": [] } } ], @@ -244,7 +249,8 @@ "type": "array", "items": { "$ref": "#/definitions/DictionaryLookupItem" - } + }, + "x-ms-identifiers": [] }, "headers": { "X-RequestId": { @@ -415,7 +421,8 @@ "type": "array", "items": { "$ref": "#/definitions/InputTextItem" - } + }, + "x-ms-identifiers": [] } } ], @@ -426,7 +433,8 @@ "type": "array", "items": { "$ref": "#/definitions/TranslatedTextItem" - } + }, + "x-ms-identifiers": [] }, "headers": { "X-RequestId": { @@ -507,7 +515,8 @@ "type": "array", "items": { "$ref": "#/definitions/InputTextItem" - } + }, + "x-ms-identifiers": [] } } ], @@ -518,7 +527,8 @@ "type": "array", "items": { "$ref": "#/definitions/TransliteratedText" - } + }, + "x-ms-identifiers": [] }, "headers": { "X-RequestId": { @@ -612,7 +622,8 @@ "description": "Array of the break sentence elements.", "items": { "$ref": "#/definitions/BreakSentenceItem" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -693,7 +704,8 @@ "description": "A list of examples for the (source term, target term) pair.", "items": { "$ref": "#/definitions/DictionaryExample" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -729,7 +741,8 @@ "description": "Array of the dictionary examples elements.", "items": { "$ref": "#/definitions/DictionaryExampleItem" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -753,7 +766,8 @@ "description": "A list of translations for the source term.", "items": { "$ref": "#/definitions/DictionaryTranslation" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -771,7 +785,8 @@ "description": "Array of the dictionary lookup elements.", "items": { "$ref": "#/definitions/DictionaryLookupItem" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -808,7 +823,8 @@ "description": "A list of \"back translations\" of the target. For example, source words that the target can translate to.\nThe list is guaranteed to contain the source word that was requested (e.g., if the source word being\nlooked up is \"fly\", then it is guaranteed that \"fly\" will be in the backTranslations list).\nHowever, it is not guaranteed to be in the first position, and often will not be.", "items": { "$ref": "#/definitions/BackTranslation" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -1045,7 +1061,8 @@ "description": "List of languages with alterative translations and examples for the query expressed in the source language.", "items": { "$ref": "#/definitions/TargetDictionaryLanguage" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -1146,7 +1163,8 @@ "description": "An array of translation results. The size of the array matches the number of target \nlanguages specified through the to query parameter.", "items": { "$ref": "#/definitions/TranslationText" - } + }, + "x-ms-identifiers": [] }, "sourceText": { "$ref": "#/definitions/SourceText", @@ -1189,7 +1207,8 @@ "description": "Array of the translated text elements.", "items": { "$ref": "#/definitions/TranslatedTextItem" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -1235,7 +1254,8 @@ "description": "List of scripts available to convert text to.", "items": { "$ref": "#/definitions/LanguageScript" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -1256,7 +1276,8 @@ "description": "Array of transliterated texts", "items": { "$ref": "#/definitions/TransliteratedText" - } + }, + "x-ms-identifiers": [] } }, "required": [ @@ -1298,7 +1319,8 @@ "description": "List of scripts to convert from.", "items": { "$ref": "#/definitions/TransliterableScript" - } + }, + "x-ms-identifiers": [] } }, "required": [ From 125017fe8886b22f6e09a37bccbb8984fc7415d4 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Fri, 22 Aug 2025 18:00:18 -0700 Subject: [PATCH 096/119] Remove deprecated @fixed decorators from typespec --- .../preview/v2025-05-01-preview/openapi.json | 39 ++++------- .../stable/v3.0/openapi.json | 66 +++++++------------ 2 files changed, 35 insertions(+), 70 deletions(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json index 65d69063fb3b..c5a735d0a6a9 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json @@ -139,8 +139,7 @@ "type": "array", "items": { "$ref": "#/definitions/TranslateBody" - }, - "x-ms-identifiers": [] + } } } ], @@ -151,8 +150,7 @@ "type": "array", "items": { "$ref": "#/definitions/TranslatedTextItem" - }, - "x-ms-identifiers": [] + } }, "headers": { "X-RequestId": { @@ -233,8 +231,7 @@ "type": "array", "items": { "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [] + } } } ], @@ -245,8 +242,7 @@ "type": "array", "items": { "$ref": "#/definitions/TransliteratedText" - }, - "x-ms-identifiers": [] + } }, "headers": { "X-RequestId": { @@ -516,8 +512,7 @@ "description": "List of languages with alterative translations and examples for the query expressed in the source language.", "items": { "$ref": "#/definitions/TargetDictionaryLanguage" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -638,8 +633,7 @@ "description": "Translation target parameters.", "items": { "$ref": "#/definitions/TranslateTarget" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -693,8 +687,7 @@ "description": "Translation target parameters.", "items": { "$ref": "#/definitions/TranslateTarget" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -807,8 +800,7 @@ "maxItems": 5, "items": { "$ref": "#/definitions/ReferenceSentencePair" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -828,8 +820,7 @@ "description": "An array of translation results. The size of the array matches the number of target \nlanguages specified through the to query parameter.", "items": { "$ref": "#/definitions/TranslationText" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -868,8 +859,7 @@ "description": "Array of the translated text elements.", "items": { "$ref": "#/definitions/TranslatedTextItem" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -907,8 +897,7 @@ "description": "List of scripts available to convert text to.", "items": { "$ref": "#/definitions/LanguageScript" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -929,8 +918,7 @@ "description": "Array of transliterated texts", "items": { "$ref": "#/definitions/TransliteratedText" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -972,8 +960,7 @@ "description": "List of scripts to convert from.", "items": { "$ref": "#/definitions/TransliterableScript" - }, - "x-ms-identifiers": [] + } } }, "required": [ diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json index 67d9879f46b6..8f53bc59db5b 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json @@ -73,8 +73,7 @@ "type": "array", "items": { "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [] + } } } ], @@ -85,8 +84,7 @@ "type": "array", "items": { "$ref": "#/definitions/BreakSentenceItem" - }, - "x-ms-identifiers": [] + } }, "headers": { "X-RequestId": { @@ -155,8 +153,7 @@ "type": "array", "items": { "$ref": "#/definitions/DictionaryExampleTextItem" - }, - "x-ms-identifiers": [] + } } } ], @@ -167,8 +164,7 @@ "type": "array", "items": { "$ref": "#/definitions/DictionaryExampleItem" - }, - "x-ms-identifiers": [] + } }, "headers": { "X-RequestId": { @@ -237,8 +233,7 @@ "type": "array", "items": { "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [] + } } } ], @@ -249,8 +244,7 @@ "type": "array", "items": { "$ref": "#/definitions/DictionaryLookupItem" - }, - "x-ms-identifiers": [] + } }, "headers": { "X-RequestId": { @@ -421,8 +415,7 @@ "type": "array", "items": { "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [] + } } } ], @@ -433,8 +426,7 @@ "type": "array", "items": { "$ref": "#/definitions/TranslatedTextItem" - }, - "x-ms-identifiers": [] + } }, "headers": { "X-RequestId": { @@ -515,8 +507,7 @@ "type": "array", "items": { "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [] + } } } ], @@ -527,8 +518,7 @@ "type": "array", "items": { "$ref": "#/definitions/TransliteratedText" - }, - "x-ms-identifiers": [] + } }, "headers": { "X-RequestId": { @@ -622,8 +612,7 @@ "description": "Array of the break sentence elements.", "items": { "$ref": "#/definitions/BreakSentenceItem" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -704,8 +693,7 @@ "description": "A list of examples for the (source term, target term) pair.", "items": { "$ref": "#/definitions/DictionaryExample" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -741,8 +729,7 @@ "description": "Array of the dictionary examples elements.", "items": { "$ref": "#/definitions/DictionaryExampleItem" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -766,8 +753,7 @@ "description": "A list of translations for the source term.", "items": { "$ref": "#/definitions/DictionaryTranslation" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -785,8 +771,7 @@ "description": "Array of the dictionary lookup elements.", "items": { "$ref": "#/definitions/DictionaryLookupItem" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -823,8 +808,7 @@ "description": "A list of \"back translations\" of the target. For example, source words that the target can translate to.\nThe list is guaranteed to contain the source word that was requested (e.g., if the source word being\nlooked up is \"fly\", then it is guaranteed that \"fly\" will be in the backTranslations list).\nHowever, it is not guaranteed to be in the first position, and often will not be.", "items": { "$ref": "#/definitions/BackTranslation" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -1061,8 +1045,7 @@ "description": "List of languages with alterative translations and examples for the query expressed in the source language.", "items": { "$ref": "#/definitions/TargetDictionaryLanguage" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -1163,8 +1146,7 @@ "description": "An array of translation results. The size of the array matches the number of target \nlanguages specified through the to query parameter.", "items": { "$ref": "#/definitions/TranslationText" - }, - "x-ms-identifiers": [] + } }, "sourceText": { "$ref": "#/definitions/SourceText", @@ -1207,8 +1189,7 @@ "description": "Array of the translated text elements.", "items": { "$ref": "#/definitions/TranslatedTextItem" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -1254,8 +1235,7 @@ "description": "List of scripts available to convert text to.", "items": { "$ref": "#/definitions/LanguageScript" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -1276,8 +1256,7 @@ "description": "Array of transliterated texts", "items": { "$ref": "#/definitions/TransliteratedText" - }, - "x-ms-identifiers": [] + } } }, "required": [ @@ -1319,8 +1298,7 @@ "description": "List of scripts to convert from.", "items": { "$ref": "#/definitions/TransliterableScript" - }, - "x-ms-identifiers": [] + } } }, "required": [ From 8bffd66a02a62bc305987af201e2da9147dd591e Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Sun, 24 Aug 2025 23:25:12 -0700 Subject: [PATCH 097/119] Change To into Language. Add SourceCharacters --- .../Azure.AI.TextTranslation/models-translate.tsp | 10 ++++++++++ .../preview/v2025-05-01-preview/openapi.json | 10 ++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index fdcf216ad96b..8fed5897e4da 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -349,9 +349,19 @@ model DetectedLanguage { @doc("Translation result") model TranslationText { + + @removed(APIVersion.v2025_05_01_preview) @doc("A string representing the language code of the target language.") to: string; + @added(APIVersion.v2025_05_01_preview) + @doc("A string representing the language code of the target language.") + language: string; + + @added(APIVersion.v2025_05_01_preview) + @doc("An interger indicating the number of characters in the source text string") + sourceCharacters: int32; + @doc("A string giving the translated text.") text: string; diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json index c5a735d0a6a9..81f08e2843a5 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json @@ -870,10 +870,15 @@ "type": "object", "description": "Translation result", "properties": { - "to": { + "language": { "type": "string", "description": "A string representing the language code of the target language." }, + "sourceCharacters": { + "type": "integer", + "format": "int32", + "description": "An interger indicating the number of characters in the source text string" + }, "text": { "type": "string", "description": "A string giving the translated text." @@ -884,7 +889,8 @@ } }, "required": [ - "to", + "language", + "sourceCharacters", "text" ] }, From 32c95f187587d7a4faa11aaa321c9c8ef927801f Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Mon, 25 Aug 2025 15:59:31 -0700 Subject: [PATCH 098/119] Update a couple more parameters. --- .../Translate_MaximumSet_Gen.json | 18 +++++----- .../Translate_MinimumSet_Gen.json | 10 ++++-- .../models-translate.tsp | 23 +++++++++++-- .../examples/Translate_MaximumSet_Gen.json | 18 +++++----- .../examples/Translate_MinimumSet_Gen.json | 10 ++++-- .../preview/v2025-05-01-preview/openapi.json | 33 ++++++++++++++----- 6 files changed, 78 insertions(+), 34 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json index cc24ca7c9ca4..14815aee1e86 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json @@ -16,7 +16,7 @@ "script": "Latn", "profanityAction": "NoAction", "profanityMarker": "Asterisk", - "deploymentName": "general", + "deploymentName": "gpt-4o-mini", "allowFallback": true, "grade": "basic", "tone": "formal", @@ -24,8 +24,8 @@ "adaptiveDatasetId": "21000", "referenceTextPairs": [ { - "referenceTextPairsSource": "Please test this out.", - "referenceTextPairsTarget": "Vyzkoušejte si to." + "source": "Please test this out.", + "target": "Vyzkoušejte si to." } ] } @@ -43,12 +43,12 @@ }, "translations": [ { - "to": "cs", - "text": "Tohle je test.", - "transliteration": { - "text": "Tohle je test.", - "script": "Latn" - } + "language": "cs", + "instructionTokens":302, + "sourceTokens":5, + "responseTokens":9, + "targetTokens":5, + "text":"Toto je test." } ] } diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json index 186996d144b5..58e9484d23a7 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json @@ -18,10 +18,16 @@ "200": { "body": [ { + "detectedLanguage": + { + "language":"en", + "score":0.12345 + }, "translations": [ { - "text": "Tohle je test.", - "to": "cs" + "language":"cs", + "sourceCharacters": 15, + "text": "Tohle je test." } ] } diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index 8fed5897e4da..771e2c879902 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -245,10 +245,10 @@ model TranslateBodyDetails { @added(APIVersion.v2025_05_01_preview) model ReferenceSentencePair { @doc("Source reference sentence.") - referenceTextPairsSource: string; + source: string; @doc("Target reference sentence.") - referenceTextPairsTarget: string; + target: string; } @doc("Response for the translation API.") @@ -360,11 +360,28 @@ model TranslationText { @added(APIVersion.v2025_05_01_preview) @doc("An interger indicating the number of characters in the source text string") - sourceCharacters: int32; + sourceCharacters?: int32; + + @added(APIVersion.v2025_05_01_preview) + @doc("An interger indicating the number of tokens used in generating the translated text") + instructionTokens?: int32; + + @added(APIVersion.v2025_05_01_preview) + @doc("An interger indicating the number of tokens used in the source sentence") + sourceTokens?: int32; + + @added(APIVersion.v2025_05_01_preview) + @doc("An interger indicating the number of tokens used in the translation response") + responseTokens?: int32; + + @added(APIVersion.v2025_05_01_preview) + @doc("An interger indicating the number of tokens used in the target sentence") + targetTokens?: int32; @doc("A string giving the translated text.") text: string; + @removed(APIVersion.v2025_05_01_preview) @doc(""" An object giving the translated text in the script specified by the toScript parameter. """) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json index cc24ca7c9ca4..14815aee1e86 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json @@ -16,7 +16,7 @@ "script": "Latn", "profanityAction": "NoAction", "profanityMarker": "Asterisk", - "deploymentName": "general", + "deploymentName": "gpt-4o-mini", "allowFallback": true, "grade": "basic", "tone": "formal", @@ -24,8 +24,8 @@ "adaptiveDatasetId": "21000", "referenceTextPairs": [ { - "referenceTextPairsSource": "Please test this out.", - "referenceTextPairsTarget": "Vyzkoušejte si to." + "source": "Please test this out.", + "target": "Vyzkoušejte si to." } ] } @@ -43,12 +43,12 @@ }, "translations": [ { - "to": "cs", - "text": "Tohle je test.", - "transliteration": { - "text": "Tohle je test.", - "script": "Latn" - } + "language": "cs", + "instructionTokens":302, + "sourceTokens":5, + "responseTokens":9, + "targetTokens":5, + "text":"Toto je test." } ] } diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MinimumSet_Gen.json index 186996d144b5..58e9484d23a7 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MinimumSet_Gen.json @@ -18,10 +18,16 @@ "200": { "body": [ { + "detectedLanguage": + { + "language":"en", + "score":0.12345 + }, "translations": [ { - "text": "Tohle je test.", - "to": "cs" + "language":"cs", + "sourceCharacters": 15, + "text": "Tohle je test." } ] } diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json index 81f08e2843a5..8548e6220c2e 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/openapi.json @@ -477,18 +477,18 @@ "type": "object", "description": "Reference sentence pair.", "properties": { - "referenceTextPairsSource": { + "source": { "type": "string", "description": "Source reference sentence." }, - "referenceTextPairsTarget": { + "target": { "type": "string", "description": "Target reference sentence." } }, "required": [ - "referenceTextPairsSource", - "referenceTextPairsTarget" + "source", + "target" ] }, "SourceDictionaryLanguage": { @@ -879,18 +879,33 @@ "format": "int32", "description": "An interger indicating the number of characters in the source text string" }, + "instructionTokens": { + "type": "integer", + "format": "int32", + "description": "An interger indicating the number of tokens used in generating the translated text" + }, + "sourceTokens": { + "type": "integer", + "format": "int32", + "description": "An interger indicating the number of tokens used in the source sentence" + }, + "responseTokens": { + "type": "integer", + "format": "int32", + "description": "An interger indicating the number of tokens used in the translation response" + }, + "targetTokens": { + "type": "integer", + "format": "int32", + "description": "An interger indicating the number of tokens used in the target sentence" + }, "text": { "type": "string", "description": "A string giving the translated text." - }, - "transliteration": { - "$ref": "#/definitions/TransliteratedText", - "description": "An object giving the translated text in the script specified by the toScript parameter." } }, "required": [ "language", - "sourceCharacters", "text" ] }, From 03f0513f8ac547e5b5794819276e345e3b4e6f51 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Tue, 26 Aug 2025 09:48:04 -0700 Subject: [PATCH 099/119] Update a couple more parameters. --- .../2025-05-01-preview/Translate_MaximumSet_Gen.json | 10 +++++----- .../2025-05-01-preview/Translate_MinimumSet_Gen.json | 11 +++++------ .../examples/Translate_MaximumSet_Gen.json | 10 +++++----- .../examples/Translate_MinimumSet_Gen.json | 11 +++++------ 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json index 14815aee1e86..a943a2954ecd 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json @@ -44,11 +44,11 @@ "translations": [ { "language": "cs", - "instructionTokens":302, - "sourceTokens":5, - "responseTokens":9, - "targetTokens":5, - "text":"Toto je test." + "instructionTokens": 302, + "sourceTokens": 5, + "responseTokens": 9, + "targetTokens": 5, + "text": "Toto je test." } ] } diff --git a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json index 58e9484d23a7..88003e501e4b 100644 --- a/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json +++ b/specification/translation/Azure.AI.TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json @@ -18,14 +18,13 @@ "200": { "body": [ { - "detectedLanguage": - { - "language":"en", - "score":0.12345 - }, + "detectedLanguage": { + "language": "en", + "score": 0.12345 + }, "translations": [ { - "language":"cs", + "language": "cs", "sourceCharacters": 15, "text": "Tohle je test." } diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json index 14815aee1e86..a943a2954ecd 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MaximumSet_Gen.json @@ -44,11 +44,11 @@ "translations": [ { "language": "cs", - "instructionTokens":302, - "sourceTokens":5, - "responseTokens":9, - "targetTokens":5, - "text":"Toto je test." + "instructionTokens": 302, + "sourceTokens": 5, + "responseTokens": 9, + "targetTokens": 5, + "text": "Toto je test." } ] } diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MinimumSet_Gen.json index 58e9484d23a7..88003e501e4b 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/preview/v2025-05-01-preview/examples/Translate_MinimumSet_Gen.json @@ -18,14 +18,13 @@ "200": { "body": [ { - "detectedLanguage": - { - "language":"en", - "score":0.12345 - }, + "detectedLanguage": { + "language": "en", + "score": 0.12345 + }, "translations": [ { - "language":"cs", + "language": "cs", "sourceCharacters": 15, "text": "Tohle je test." } From 6048c349bec93d6d6867ac5ea627cea83359febe Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Tue, 26 Aug 2025 09:55:11 -0700 Subject: [PATCH 100/119] Update a couple more parameters. --- .../translation/Azure.AI.TextTranslation/models-translate.tsp | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp index 771e2c879902..e6b49b577920 100644 --- a/specification/translation/Azure.AI.TextTranslation/models-translate.tsp +++ b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp @@ -349,7 +349,6 @@ model DetectedLanguage { @doc("Translation result") model TranslationText { - @removed(APIVersion.v2025_05_01_preview) @doc("A string representing the language code of the target language.") to: string; From 3ab620c33f88ee04d7242f1a555b733464f44522 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Wed, 27 Aug 2025 11:59:21 -0700 Subject: [PATCH 101/119] Remove readme.md for text translation --- .../Azure.AI.TextTranslation/readme.md | 64 ------------------- 1 file changed, 64 deletions(-) delete mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/readme.md diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md deleted file mode 100644 index 7c0c11737ee9..000000000000 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ /dev/null @@ -1,64 +0,0 @@ -# Cognitive Services Translation Text SDK - -> see https://aka.ms/autorest - -This is the AutoRest configuration file for Translation Text SDK. - -> `autorest` - -To see additional help and options, run: - -> `autorest --help` ---- - -The current release is `package-2025-05-01-preview`. - -``` yaml -tag: package-2025-05-01-preview -add-credentials: true -openapi-type: data-plane -``` - -## Releases - -### Release 3.0 - -These settings apply only when `--tag=release_3_0` is specified on the command line. - -``` yaml $(tag) == 'release_3_0' -input-file: stable/v3.0/openapi.json -``` - -### Release 2025-05-01-preview - -These settings apply only when `--tag=package-2025-05-01-preview` is specified on the command line. - -``` yaml $(tag) == 'package-2025-05-01-preview' -version: package-2025-05-01-preview -input-file: - - preview/v2025-05-01-preview/openapi.json -``` - -## Multi-API/Profile support for AutoRest v3 generators - -AutoRest V3 generators require the use of `--tag=all-api-versions` to select api files. - -This block is updated by an automatic script. Edits may be lost! - -``` yaml $(tag) == 'all-api-versions' /* autogenerated */ -# include the azure profile definitions from the standard location -require: $(this-folder)/../../../../profiles/readme.md - -# all the input files across all versions -input-file: - - $(this-folder)/stable/v3.0/openapi.json - - $(this-folder)/preview/v2025-05-01-preview/openapi.json -``` - -If there are files that should not be in the `all-api-versions` set, -uncomment the `exclude-file` section below and add the file paths. - -``` yaml $(tag) == 'all-api-versions' -#exclude-file: -# - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json -``` \ No newline at end of file From ca61eee24577627c277416c4a74e48f73b416c9b Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Wed, 27 Aug 2025 12:33:47 -0700 Subject: [PATCH 102/119] Add readme.md back in --- .../Azure.AI.TextTranslation/readme.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 specification/translation/data-plane/Azure.AI.TextTranslation/readme.md diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md new file mode 100644 index 000000000000..7c0c11737ee9 --- /dev/null +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md @@ -0,0 +1,64 @@ +# Cognitive Services Translation Text SDK + +> see https://aka.ms/autorest + +This is the AutoRest configuration file for Translation Text SDK. + +> `autorest` + +To see additional help and options, run: + +> `autorest --help` +--- + +The current release is `package-2025-05-01-preview`. + +``` yaml +tag: package-2025-05-01-preview +add-credentials: true +openapi-type: data-plane +``` + +## Releases + +### Release 3.0 + +These settings apply only when `--tag=release_3_0` is specified on the command line. + +``` yaml $(tag) == 'release_3_0' +input-file: stable/v3.0/openapi.json +``` + +### Release 2025-05-01-preview + +These settings apply only when `--tag=package-2025-05-01-preview` is specified on the command line. + +``` yaml $(tag) == 'package-2025-05-01-preview' +version: package-2025-05-01-preview +input-file: + - preview/v2025-05-01-preview/openapi.json +``` + +## Multi-API/Profile support for AutoRest v3 generators + +AutoRest V3 generators require the use of `--tag=all-api-versions` to select api files. + +This block is updated by an automatic script. Edits may be lost! + +``` yaml $(tag) == 'all-api-versions' /* autogenerated */ +# include the azure profile definitions from the standard location +require: $(this-folder)/../../../../profiles/readme.md + +# all the input files across all versions +input-file: + - $(this-folder)/stable/v3.0/openapi.json + - $(this-folder)/preview/v2025-05-01-preview/openapi.json +``` + +If there are files that should not be in the `all-api-versions` set, +uncomment the `exclude-file` section below and add the file paths. + +``` yaml $(tag) == 'all-api-versions' +#exclude-file: +# - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json +``` \ No newline at end of file From dbbdc2393e85c3191e43df132e338cf6a0a16cd1 Mon Sep 17 00:00:00 2001 From: Scott Greenwood Date: Wed, 27 Aug 2025 13:29:28 -0700 Subject: [PATCH 103/119] remove 3.0 --- .../translation/data-plane/Azure.AI.TextTranslation/readme.md | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md index 7c0c11737ee9..61df3e161f3f 100644 --- a/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md +++ b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md @@ -51,7 +51,6 @@ require: $(this-folder)/../../../../profiles/readme.md # all the input files across all versions input-file: - - $(this-folder)/stable/v3.0/openapi.json - $(this-folder)/preview/v2025-05-01-preview/openapi.json ``` From f3eb1223894424e9f83f28047a498d6ba921d00f Mon Sep 17 00:00:00 2001 From: Jiarui Guo Date: Mon, 15 Sep 2025 23:56:31 -0700 Subject: [PATCH 104/119] update openapi.json ref in readme --- .../translation/data-plane/TextTranslation/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/translation/data-plane/TextTranslation/readme.md b/specification/translation/data-plane/TextTranslation/readme.md index 61df3e161f3f..f2630a9710ff 100644 --- a/specification/translation/data-plane/TextTranslation/readme.md +++ b/specification/translation/data-plane/TextTranslation/readme.md @@ -26,7 +26,7 @@ openapi-type: data-plane These settings apply only when `--tag=release_3_0` is specified on the command line. ``` yaml $(tag) == 'release_3_0' -input-file: stable/v3.0/openapi.json +input-file: stable/3.0/openapi.json ``` ### Release 2025-05-01-preview @@ -36,7 +36,7 @@ These settings apply only when `--tag=package-2025-05-01-preview` is specified o ``` yaml $(tag) == 'package-2025-05-01-preview' version: package-2025-05-01-preview input-file: - - preview/v2025-05-01-preview/openapi.json + - preview/2025-05-01-preview/openapi.json ``` ## Multi-API/Profile support for AutoRest v3 generators @@ -51,7 +51,7 @@ require: $(this-folder)/../../../../profiles/readme.md # all the input files across all versions input-file: - - $(this-folder)/preview/v2025-05-01-preview/openapi.json + - $(this-folder)/preview/2025-05-01-preview/openapi.json ``` If there are files that should not be in the `all-api-versions` set, From 7a763a5497f6ff445e63bdccf43b23340c34a78a Mon Sep 17 00:00:00 2001 From: Jiarui Guo Date: Tue, 16 Sep 2025 00:19:53 -0700 Subject: [PATCH 105/119] unchange translation tspconfigs --- .../data-plane/DocumentTranslation/tspconfig.yaml | 10 ++++------ .../data-plane/TextTranslation/tspconfig.yaml | 5 ++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/specification/translation/data-plane/DocumentTranslation/tspconfig.yaml b/specification/translation/data-plane/DocumentTranslation/tspconfig.yaml index 0a17f6a66257..f138f052783e 100644 --- a/specification/translation/data-plane/DocumentTranslation/tspconfig.yaml +++ b/specification/translation/data-plane/DocumentTranslation/tspconfig.yaml @@ -17,8 +17,7 @@ options: "@azure-tools/typespec-csharp": emitter-output-dir: "{output-dir}/{service-dir}/{namespace}" flavor: azure - package-dir: "Azure.AI.Translation.Document" - namespace: "{package-dir}" + namespace: Azure.AI.Translation.Document clear-output-folder: true model-namespace: false generate-sample-project: false @@ -30,12 +29,11 @@ options: flavor: azure package-dir: "azure-ai-translation-document" namespace: "azure.ai.translation.document" - package-name: "{package-dir}" package-mode: dataplane package-version: "1.1.0b1" generate-sample-project: false - generate-test: true - generate-sample: true + generate-test: false + generate-sample: false "@azure-tools/typespec-java": emitter-output-dir: "{output-dir}/{service-dir}/azure-ai-translation-document" namespace: com.azure.ai.translation.document @@ -53,4 +51,4 @@ options: name: "@azure-rest/ai-translation-document" description: "Microsoft Translation Document" flavor: azure - generate-sample-project: false + generate-sample-project: false \ No newline at end of file diff --git a/specification/translation/data-plane/TextTranslation/tspconfig.yaml b/specification/translation/data-plane/TextTranslation/tspconfig.yaml index c367b8313f9d..d02f1a31d2fa 100644 --- a/specification/translation/data-plane/TextTranslation/tspconfig.yaml +++ b/specification/translation/data-plane/TextTranslation/tspconfig.yaml @@ -20,7 +20,7 @@ options: emitter-output-dir: "{output-dir}/{service-dir}/{namespace}" clear-output-folder: true model-namespace: false - namespace: "{package-dir}" + namespace: Azure.AI.Translation.Text flavor: azure "@azure-typespec/http-client-csharp": emitter-output-dir: "{output-dir}/{service-dir}/{namespace}" @@ -29,7 +29,6 @@ options: "@azure-tools/typespec-python": namespace: "azure.ai.translation.text" package-dir: "azure-ai-translation-text" - package-name: "{package-dir}" flavor: azure generate-test: true generate-sample: true @@ -48,4 +47,4 @@ options: package-details: name: "@azure-rest/ai-translation-text" description: "Microsoft Translation Text" - flavor: azure + flavor: azure \ No newline at end of file From 4a60a2a97cc1f73b7ee3008e72f4ecf46cccbcf9 Mon Sep 17 00:00:00 2001 From: Jiarui Guo Date: Tue, 16 Sep 2025 13:33:17 -0700 Subject: [PATCH 106/119] translation tspconfig format --- .../translation/data-plane/DocumentTranslation/tspconfig.yaml | 2 +- .../translation/data-plane/TextTranslation/tspconfig.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/translation/data-plane/DocumentTranslation/tspconfig.yaml b/specification/translation/data-plane/DocumentTranslation/tspconfig.yaml index f138f052783e..16b08e86c705 100644 --- a/specification/translation/data-plane/DocumentTranslation/tspconfig.yaml +++ b/specification/translation/data-plane/DocumentTranslation/tspconfig.yaml @@ -51,4 +51,4 @@ options: name: "@azure-rest/ai-translation-document" description: "Microsoft Translation Document" flavor: azure - generate-sample-project: false \ No newline at end of file + generate-sample-project: false diff --git a/specification/translation/data-plane/TextTranslation/tspconfig.yaml b/specification/translation/data-plane/TextTranslation/tspconfig.yaml index d02f1a31d2fa..93f814b12b47 100644 --- a/specification/translation/data-plane/TextTranslation/tspconfig.yaml +++ b/specification/translation/data-plane/TextTranslation/tspconfig.yaml @@ -47,4 +47,4 @@ options: package-details: name: "@azure-rest/ai-translation-text" description: "Microsoft Translation Text" - flavor: azure \ No newline at end of file + flavor: azure From f37f5092256c792c40b4ab28e56ad423eb36cc03 Mon Sep 17 00:00:00 2001 From: Jiarui Guo Date: Tue, 16 Sep 2025 13:50:15 -0700 Subject: [PATCH 107/119] unremove transliteration --- .../data-plane/TextTranslation/models-translate.tsp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/specification/translation/data-plane/TextTranslation/models-translate.tsp b/specification/translation/data-plane/TextTranslation/models-translate.tsp index abcba159b0a0..b3adfe174f0a 100644 --- a/specification/translation/data-plane/TextTranslation/models-translate.tsp +++ b/specification/translation/data-plane/TextTranslation/models-translate.tsp @@ -378,9 +378,8 @@ model TranslationText { @doc("A string giving the translated text.") text: string; - @removed(APIVersion.v2025_05_01_preview) @doc(""" - An object giving the translated text in the script specified by the toScript parameter. + An object giving the translated text in the script specified in the request. """) transliteration?: TransliteratedText; From 827ae8700c2c00ad43ba33f7dc7242bac0f1c66f Mon Sep 17 00:00:00 2001 From: Jiarui Guo Date: Tue, 16 Sep 2025 14:59:12 -0700 Subject: [PATCH 108/119] keep v3 and v4 transliteration docs --- .../data-plane/TextTranslation/models-translate.tsp | 10 +++++++++- .../preview/2025-05-01-preview/openapi.json | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/specification/translation/data-plane/TextTranslation/models-translate.tsp b/specification/translation/data-plane/TextTranslation/models-translate.tsp index b3adfe174f0a..9f1fe1ebce34 100644 --- a/specification/translation/data-plane/TextTranslation/models-translate.tsp +++ b/specification/translation/data-plane/TextTranslation/models-translate.tsp @@ -378,8 +378,16 @@ model TranslationText { @doc("A string giving the translated text.") text: string; + @renamedFrom(APIVersion.v2025_05_01_preview, "transliteration") + @removed(APIVersion.v2025_05_01_preview) + @doc(""" + An object giving the translated text in the script specified by the toScript parameter. + """) + transliterationV3?: TransliteratedText; + + @added(APIVersion.v2025_05_01_preview) @doc(""" - An object giving the translated text in the script specified in the request. + An object giving the translated text in the script specified by the target's script parameter. """) transliteration?: TransliteratedText; diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json index 8548e6220c2e..384a967fb1e6 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json @@ -902,6 +902,10 @@ "text": { "type": "string", "description": "A string giving the translated text." + }, + "transliteration": { + "$ref": "#/definitions/TransliteratedText", + "description": "An object giving the translated text in the script specified by the target's script parameter." } }, "required": [ From 2bee36db73e1c1760cfa9a283b09980c2314ad73 Mon Sep 17 00:00:00 2001 From: Jiarui Guo Date: Wed, 17 Sep 2025 15:45:58 -0700 Subject: [PATCH 109/119] -sourceText +text --- .../TextTranslation/models-translate.tsp | 10 ++++++++++ .../preview/2025-05-01-preview/openapi.json | 17 ++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/specification/translation/data-plane/TextTranslation/models-translate.tsp b/specification/translation/data-plane/TextTranslation/models-translate.tsp index 9f1fe1ebce34..06ce98438f1d 100644 --- a/specification/translation/data-plane/TextTranslation/models-translate.tsp +++ b/specification/translation/data-plane/TextTranslation/models-translate.tsp @@ -317,6 +317,15 @@ model TranslatedTextItem { @doc("The detectedLanguage property is only present in the result object when language auto-detection is requested.") detectedLanguage?: DetectedLanguage; + @added(APIVersion.v2025_05_01_preview) + @doc(""" + Input text in the default script of the source language. The text property is present only when + the input is expressed in a script that's not the usual script for the language. For example, + if the input were Arabic written in Latin script, then text would be the same Arabic text + converted into Arab script. + """) + text?: string; + @doc(""" An array of translation results. The size of the array matches the number of target languages specified through the to query parameter. @@ -434,6 +443,7 @@ model SentenceBoundaries { transSentLen: int32[]; } +@removed(APIVersion.v2025_05_01_preview) @doc("Input text in the default script of the source language. ") model SourceText { @doc(""" diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json index 384a967fb1e6..875931dd67b6 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json @@ -522,19 +522,6 @@ "translations" ] }, - "SourceText": { - "type": "object", - "description": "Input text in the default script of the source language. ", - "properties": { - "text": { - "type": "string", - "description": "Input text in the default script of the source language." - } - }, - "required": [ - "text" - ] - }, "TargetDictionaryLanguage": { "type": "object", "description": "Properties of the target dictionary language", @@ -815,6 +802,10 @@ "$ref": "#/definitions/DetectedLanguage", "description": "The detectedLanguage property is only present in the result object when language auto-detection is requested." }, + "text": { + "type": "string", + "description": "Input text in the default script of the source language. The text property is present only when \nthe input is expressed in a script that's not the usual script for the language. For example, \nif the input were Arabic written in Latin script, then text would be the same Arabic text \nconverted into Arab script." + }, "translations": { "type": "array", "description": "An array of translation results. The size of the array matches the number of target \nlanguages specified through the to query parameter.", From 1f3e06751ee095f8c7cdd8dcc77b5ff10769692b Mon Sep 17 00:00:00 2001 From: Jiarui Guo Date: Thu, 18 Sep 2025 15:29:20 -0700 Subject: [PATCH 110/119] remove transliteration & source text in results --- .../TextTranslation/models-translate.tsp | 16 ---------------- .../preview/2025-05-01-preview/openapi.json | 8 -------- 2 files changed, 24 deletions(-) diff --git a/specification/translation/data-plane/TextTranslation/models-translate.tsp b/specification/translation/data-plane/TextTranslation/models-translate.tsp index 06ce98438f1d..0ade655b9509 100644 --- a/specification/translation/data-plane/TextTranslation/models-translate.tsp +++ b/specification/translation/data-plane/TextTranslation/models-translate.tsp @@ -317,15 +317,6 @@ model TranslatedTextItem { @doc("The detectedLanguage property is only present in the result object when language auto-detection is requested.") detectedLanguage?: DetectedLanguage; - @added(APIVersion.v2025_05_01_preview) - @doc(""" - Input text in the default script of the source language. The text property is present only when - the input is expressed in a script that's not the usual script for the language. For example, - if the input were Arabic written in Latin script, then text would be the same Arabic text - converted into Arab script. - """) - text?: string; - @doc(""" An array of translation results. The size of the array matches the number of target languages specified through the to query parameter. @@ -387,17 +378,10 @@ model TranslationText { @doc("A string giving the translated text.") text: string; - @renamedFrom(APIVersion.v2025_05_01_preview, "transliteration") @removed(APIVersion.v2025_05_01_preview) @doc(""" An object giving the translated text in the script specified by the toScript parameter. """) - transliterationV3?: TransliteratedText; - - @added(APIVersion.v2025_05_01_preview) - @doc(""" - An object giving the translated text in the script specified by the target's script parameter. - """) transliteration?: TransliteratedText; @removed(APIVersion.v2025_05_01_preview) diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json index 875931dd67b6..46632c2948ef 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json @@ -802,10 +802,6 @@ "$ref": "#/definitions/DetectedLanguage", "description": "The detectedLanguage property is only present in the result object when language auto-detection is requested." }, - "text": { - "type": "string", - "description": "Input text in the default script of the source language. The text property is present only when \nthe input is expressed in a script that's not the usual script for the language. For example, \nif the input were Arabic written in Latin script, then text would be the same Arabic text \nconverted into Arab script." - }, "translations": { "type": "array", "description": "An array of translation results. The size of the array matches the number of target \nlanguages specified through the to query parameter.", @@ -893,10 +889,6 @@ "text": { "type": "string", "description": "A string giving the translated text." - }, - "transliteration": { - "$ref": "#/definitions/TransliteratedText", - "description": "An object giving the translated text in the script specified by the target's script parameter." } }, "required": [ From 41390874d3a11d1a3f964f8459ef6e0986905d01 Mon Sep 17 00:00:00 2001 From: Jiarui Guo Date: Mon, 22 Sep 2025 14:34:48 -0700 Subject: [PATCH 111/119] errorDetails code int32 -> string --- .../data-plane/TextTranslation/models-shared.tsp | 8 +++++++- .../preview/2025-05-01-preview/openapi.json | 5 ++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/specification/translation/data-plane/TextTranslation/models-shared.tsp b/specification/translation/data-plane/TextTranslation/models-shared.tsp index 7c5e1ddefb33..e56ddbc2d7ee 100644 --- a/specification/translation/data-plane/TextTranslation/models-shared.tsp +++ b/specification/translation/data-plane/TextTranslation/models-shared.tsp @@ -78,8 +78,14 @@ model ErrorResponse { @doc("Error details as returned by Translator Service.") model ErrorDetails { + @removed(APIVersion.v2025_05_01_preview) + @renamedFrom(APIVersion.v2025_05_01_preview, "code") @doc("Number identifier of the error.") - code: int32; + codeV3: int32; + + @added(APIVersion.v2025_05_01_preview) + @doc("String identifier of the error.") + code: string; @doc("Human readable error description.") message: string; diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json index 46632c2948ef..a0f8545e73df 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json @@ -300,9 +300,8 @@ "description": "Error details as returned by Translator Service.", "properties": { "code": { - "type": "integer", - "format": "int32", - "description": "Number identifier of the error." + "type": "string", + "description": "String identifier of the error." }, "message": { "type": "string", From 27e15cb6c306da49b221f60aebf57e137fb997cb Mon Sep 17 00:00:00 2001 From: Jiarui Guo Date: Mon, 22 Sep 2025 15:20:25 -0700 Subject: [PATCH 112/119] translate result body updatet --- .../TextTranslation/models-translate.tsp | 31 ++++++++++++++++++- .../preview/2025-05-01-preview/openapi.json | 13 +++----- .../data-plane/TextTranslation/routes.tsp | 2 +- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/specification/translation/data-plane/TextTranslation/models-translate.tsp b/specification/translation/data-plane/TextTranslation/models-translate.tsp index 0ade655b9509..93849fcca152 100644 --- a/specification/translation/data-plane/TextTranslation/models-translate.tsp +++ b/specification/translation/data-plane/TextTranslation/models-translate.tsp @@ -252,7 +252,9 @@ model ReferenceSentencePair { } @doc("Response for the translation API.") -model TranslationResult { +@renamedFrom(APIVersion.v2025_05_01_preview, "TranslationResult") +@removed(APIVersion.v2025_05_01_preview) +model TranslationResultV3 { ...CommonResultHeaders; @bodyRoot @@ -278,6 +280,33 @@ model TranslationResult { meteredUsage: int32; } +@doc("Response for the translation API.") +@added(APIVersion.v2025_05_01_preview) +model TranslationResult { + ...CommonResultHeaders; + + @doc("Array of the translated text elements in the response body.") + values: TranslatedTextItem[]; + + @header("x-mt-system") + @doc(""" + Specifies the system type that was used for translation for each 'to' language requested for translation. + The value is a comma-separated list of strings. Each string indicates a type: + + * Custom - Request includes a custom system and at least one custom system was used during translation. + * Team - All other requests + """) + mtSystem: string; + + @header("x-metered-usage") + @doc(""" + Specifies consumption (the number of characters for which the user will be charged) for the translation + job request. For example, if the word "Hello" is translated from English (en) to French (fr), + this field will return the value '5'. + """) + meteredUsage: int32; +} + @doc("Translation text type") union TextType { string, diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json index a0f8545e73df..fc066109d25b 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json @@ -145,12 +145,9 @@ ], "responses": { "200": { - "description": "Response for the translation API.", + "description": "The request has succeeded.", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/TranslatedTextItem" - } + "$ref": "#/definitions/TranslationResult" }, "headers": { "X-RequestId": { @@ -840,16 +837,16 @@ "type": "object", "description": "Response for the translation API.", "properties": { - "result": { + "values": { "type": "array", - "description": "Array of the translated text elements.", + "description": "Array of the translated text elements in the response body.", "items": { "$ref": "#/definitions/TranslatedTextItem" } } }, "required": [ - "result" + "values" ] }, "TranslationText": { diff --git a/specification/translation/data-plane/TextTranslation/routes.tsp b/specification/translation/data-plane/TextTranslation/routes.tsp index c9a7d8c6a791..d5374f8d8387 100644 --- a/specification/translation/data-plane/TextTranslation/routes.tsp +++ b/specification/translation/data-plane/TextTranslation/routes.tsp @@ -58,7 +58,7 @@ op getSupportedLanguages is CustomGetOperation< op translateV3 is CustomOperation< InputTextItem[], TranslateParameters, - TranslationResult, + TranslationResultV3, ErrorResponse >; From ee78e6814c0e2b5bdb8ad79545b19740ebec7715 Mon Sep 17 00:00:00 2001 From: Jiarui Guo Date: Mon, 22 Sep 2025 15:30:03 -0700 Subject: [PATCH 113/119] transliterate response --- .../TextTranslation/models-translate.tsp | 2 +- .../TextTranslation/models-transliterate.tsp | 14 +++++++++++++- .../preview/2025-05-01-preview/openapi.json | 13 +++++-------- .../data-plane/TextTranslation/routes.tsp | 17 +++++++++++++++++ 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/specification/translation/data-plane/TextTranslation/models-translate.tsp b/specification/translation/data-plane/TextTranslation/models-translate.tsp index 93849fcca152..6b1ddbe29680 100644 --- a/specification/translation/data-plane/TextTranslation/models-translate.tsp +++ b/specification/translation/data-plane/TextTranslation/models-translate.tsp @@ -285,7 +285,7 @@ model TranslationResultV3 { model TranslationResult { ...CommonResultHeaders; - @doc("Array of the translated text elements in the response body.") + @doc("Array of the translated text elements.") values: TranslatedTextItem[]; @header("x-mt-system") diff --git a/specification/translation/data-plane/TextTranslation/models-transliterate.tsp b/specification/translation/data-plane/TextTranslation/models-transliterate.tsp index a54e676a23a7..dcd8b0626b5c 100644 --- a/specification/translation/data-plane/TextTranslation/models-transliterate.tsp +++ b/specification/translation/data-plane/TextTranslation/models-transliterate.tsp @@ -4,6 +4,7 @@ import "./models-shared.tsp"; using TypeSpec.Http; using TypeSpec.Rest; +using TypeSpec.Versioning; using Azure.Core; namespace TextTranslation; @@ -36,7 +37,9 @@ model TransliterateParameters { } @doc("Response for the transliteration API.") -model TransliterateResult { +@renamedFrom(APIVersion.v2025_05_01_preview, "TransliterateResult") +@removed(APIVersion.v2025_05_01_preview) +model TransliterateResultV3 { ...CommonResultHeaders; @bodyRoot @@ -44,6 +47,15 @@ model TransliterateResult { result: TransliteratedText[]; } +@doc("Response for the transliteration API.") +@added(APIVersion.v2025_05_01_preview) +model TransliterateResult { + ...CommonResultHeaders; + + @doc("Array of transliterated texts") + values: TransliteratedText[]; +} + @doc("Transliterated text element.") model TransliteratedText { @doc("A string which is the result of converting the input string to the output script.") diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json index fc066109d25b..bfce709ae631 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json @@ -234,12 +234,9 @@ ], "responses": { "200": { - "description": "Response for the transliteration API.", + "description": "The request has succeeded.", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/TransliteratedText" - } + "$ref": "#/definitions/TransliterateResult" }, "headers": { "X-RequestId": { @@ -839,7 +836,7 @@ "properties": { "values": { "type": "array", - "description": "Array of the translated text elements in the response body.", + "description": "Array of the translated text elements.", "items": { "$ref": "#/definitions/TranslatedTextItem" } @@ -917,7 +914,7 @@ "type": "object", "description": "Response for the transliteration API.", "properties": { - "result": { + "values": { "type": "array", "description": "Array of transliterated texts", "items": { @@ -926,7 +923,7 @@ } }, "required": [ - "result" + "values" ] }, "TransliteratedText": { diff --git a/specification/translation/data-plane/TextTranslation/routes.tsp b/specification/translation/data-plane/TextTranslation/routes.tsp index d5374f8d8387..8c61e26cd1d7 100644 --- a/specification/translation/data-plane/TextTranslation/routes.tsp +++ b/specification/translation/data-plane/TextTranslation/routes.tsp @@ -78,9 +78,26 @@ op translate is CustomOperation< #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." @post +@sharedRoute +@route("transliterate") +@summary("Transliterate Text") +@doc("Transliterate Text") +@renamedFrom(APIVersion.v2025_05_01_preview, "transliterate") +@removed(APIVersion.v2025_05_01_preview) +op transliterateV3 is CustomOperation< + InputTextItem[], + TransliterateParameters, + TransliterateResultV3, + ErrorResponse +>; + +#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." +@post +@sharedRoute @route("transliterate") @summary("Transliterate Text") @doc("Transliterate Text") +@added(APIVersion.v2025_05_01_preview) op transliterate is CustomOperation< InputTextItem[], TransliterateParameters, From 823dad38236c2c8bddab14efadaec44d63c8849a Mon Sep 17 00:00:00 2001 From: Jiarui Guo Date: Mon, 22 Sep 2025 15:46:34 -0700 Subject: [PATCH 114/119] translate body --- .../TextTranslation/models-shared.tsp | 37 ------------ .../TextTranslation/models-translate.tsp | 16 +++-- .../preview/2025-05-01-preview/openapi.json | 59 +++---------------- .../data-plane/TextTranslation/routes.tsp | 2 +- 4 files changed, 20 insertions(+), 94 deletions(-) diff --git a/specification/translation/data-plane/TextTranslation/models-shared.tsp b/specification/translation/data-plane/TextTranslation/models-shared.tsp index e56ddbc2d7ee..f9ba22020fc4 100644 --- a/specification/translation/data-plane/TextTranslation/models-shared.tsp +++ b/specification/translation/data-plane/TextTranslation/models-shared.tsp @@ -22,43 +22,6 @@ model InputTextItem { text: string; } -@doc("Element containing the text for translation.") -@added(APIVersion.v2025_05_01_preview) -model TranslateBody { - @doc("Text to translate.") - text: string; - - @added(APIVersion.v2025_05_01_preview) - @doc(""" - Specifies the script of the input text. - """) - script?: string; - - @added(APIVersion.v2025_05_01_preview) - @doc(""" - Specifies the language of the input text. Find which languages are available to translate by - looking up supported languages using the translation scope. If the language parameter isn't - specified, automatic language detection is applied to determine the source language. - - You must use the language parameter rather than autodetection when using the dynamic dictionary feature. - Note: the dynamic dictionary feature is case-sensitive. - """) - language?: string; - - @added(APIVersion.v2025_05_01_preview) - @doc(""" - Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, - complete element. Possible values are: plain (default) or html. - """) - textType?: TextType = "Plain"; - - @added(APIVersion.v2025_05_01_preview) - @doc(""" - Translation target parameters. - """) - targets: TranslateTarget[]; -} - alias CommonResultHeaders = { @header("X-RequestId") @doc(""" diff --git a/specification/translation/data-plane/TextTranslation/models-translate.tsp b/specification/translation/data-plane/TextTranslation/models-translate.tsp index 6b1ddbe29680..a26f1d185875 100644 --- a/specification/translation/data-plane/TextTranslation/models-translate.tsp +++ b/specification/translation/data-plane/TextTranslation/models-translate.tsp @@ -205,12 +205,17 @@ model TranslateTarget { referenceTextPairs?: ReferenceSentencePair[]; } -@doc("Request body parameters for the translate API.") +@doc("Request body for the translate API.") @added(APIVersion.v2025_05_01_preview) -model TranslateBodyDetails { - @doc(""" - Specifies the text string to be translated in the translate API. - """) +model TranslateBody { + @doc("Array of the input text elements to translate.") + inputs: TranslateInputItem[]; +} + +@doc("Element containing the text for translation.") +@added(APIVersion.v2025_05_01_preview) +model TranslateInputItem { + @doc("Text to translate.") text: string; @doc(""" @@ -234,7 +239,6 @@ model TranslateBodyDetails { """) textType?: TextType = "Plain"; - @added(APIVersion.v2025_05_01_preview) @doc(""" Translation target parameters. """) diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json index bfce709ae631..508591a9bbde 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json @@ -136,10 +136,7 @@ "description": "Defines the content of the request", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/TranslateBody" - } + "$ref": "#/definitions/TranslateBody" } } ], @@ -569,65 +566,27 @@ }, "TranslateBody": { "type": "object", - "description": "Element containing the text for translation.", + "description": "Request body for the translate API.", "properties": { - "text": { - "type": "string", - "description": "Text to translate." - }, - "script": { - "type": "string", - "description": "Specifies the script of the input text." - }, - "language": { - "type": "string", - "description": "Specifies the language of the input text. Find which languages are available to translate by \nlooking up supported languages using the translation scope. If the language parameter isn't \nspecified, automatic language detection is applied to determine the source language.\n\nYou must use the language parameter rather than autodetection when using the dynamic dictionary feature. \nNote: the dynamic dictionary feature is case-sensitive." - }, - "textType": { - "type": "string", - "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", - "default": "Plain", - "enum": [ - "Plain", - "Html" - ], - "x-ms-enum": { - "name": "TextType", - "modelAsString": true, - "values": [ - { - "name": "Plain", - "value": "Plain", - "description": "Plain text." - }, - { - "name": "Html", - "value": "Html", - "description": "HTML-encoded text." - } - ] - } - }, - "targets": { + "inputs": { "type": "array", - "description": "Translation target parameters.", + "description": "Array of the input text elements to translate.", "items": { - "$ref": "#/definitions/TranslateTarget" + "$ref": "#/definitions/TranslateInputItem" } } }, "required": [ - "text", - "targets" + "inputs" ] }, - "TranslateBodyDetails": { + "TranslateInputItem": { "type": "object", - "description": "Request body parameters for the translate API.", + "description": "Element containing the text for translation.", "properties": { "text": { "type": "string", - "description": "Specifies the text string to be translated in the translate API." + "description": "Text to translate." }, "script": { "type": "string", diff --git a/specification/translation/data-plane/TextTranslation/routes.tsp b/specification/translation/data-plane/TextTranslation/routes.tsp index 8c61e26cd1d7..7c387f8dbadb 100644 --- a/specification/translation/data-plane/TextTranslation/routes.tsp +++ b/specification/translation/data-plane/TextTranslation/routes.tsp @@ -70,7 +70,7 @@ op translateV3 is CustomOperation< @route("translate") @added(APIVersion.v2025_05_01_preview) op translate is CustomOperation< - TranslateBody[], + TranslateBody, TranslateParameters, TranslationResult, ErrorResponse From 85f0869d23b49a1cf5ee641e3c47079002510eeb Mon Sep 17 00:00:00 2001 From: Jiarui Guo Date: Mon, 22 Sep 2025 15:49:02 -0700 Subject: [PATCH 115/119] transliterate request body --- .../TextTranslation/models-transliterate.tsp | 7 +++++++ .../preview/2025-05-01-preview/openapi.json | 21 +++++++++++++++---- .../data-plane/TextTranslation/routes.tsp | 2 +- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/specification/translation/data-plane/TextTranslation/models-transliterate.tsp b/specification/translation/data-plane/TextTranslation/models-transliterate.tsp index dcd8b0626b5c..fc790298ce7a 100644 --- a/specification/translation/data-plane/TextTranslation/models-transliterate.tsp +++ b/specification/translation/data-plane/TextTranslation/models-transliterate.tsp @@ -36,6 +36,13 @@ model TransliterateParameters { toScript: string; } +@doc("Request body for the transliterate API.") +@added(APIVersion.v2025_05_01_preview) +model TransliterateBody { + @doc("Array of the input text elements to transliterate.") + inputs: InputTextItem[]; +} + @doc("Response for the transliteration API.") @renamedFrom(APIVersion.v2025_05_01_preview, "TransliterateResult") @removed(APIVersion.v2025_05_01_preview) diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json index 508591a9bbde..d74f6fef8caa 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json @@ -222,10 +222,7 @@ "description": "Defines the content of the request", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/InputTextItem" - } + "$ref": "#/definitions/TransliterateBody" } } ], @@ -869,6 +866,22 @@ } ] }, + "TransliterateBody": { + "type": "object", + "description": "Request body for the transliterate API.", + "properties": { + "inputs": { + "type": "array", + "description": "Array of the input text elements to transliterate.", + "items": { + "$ref": "#/definitions/InputTextItem" + } + } + }, + "required": [ + "inputs" + ] + }, "TransliterateResult": { "type": "object", "description": "Response for the transliteration API.", diff --git a/specification/translation/data-plane/TextTranslation/routes.tsp b/specification/translation/data-plane/TextTranslation/routes.tsp index 7c387f8dbadb..175a0bb07979 100644 --- a/specification/translation/data-plane/TextTranslation/routes.tsp +++ b/specification/translation/data-plane/TextTranslation/routes.tsp @@ -99,7 +99,7 @@ op transliterateV3 is CustomOperation< @doc("Transliterate Text") @added(APIVersion.v2025_05_01_preview) op transliterate is CustomOperation< - InputTextItem[], + TransliterateBody, TransliterateParameters, TransliterateResult, ErrorResponse From c9d47dca7ba3392e09f661dc88bcc0f1384d4d2f Mon Sep 17 00:00:00 2001 From: Jiarui Guo Date: Mon, 22 Sep 2025 15:59:57 -0700 Subject: [PATCH 116/119] update examples --- .../Translate_MaximumSet_Gen.json | 88 ++++++++++--------- .../Translate_MinimumSet_Gen.json | 48 +++++----- .../Transliterate_MaximumSet_Gen.json | 26 +++--- .../Transliterate_MinimumSet_Gen.json | 26 +++--- .../examples/Translate_MaximumSet_Gen.json | 88 ++++++++++--------- .../examples/Translate_MinimumSet_Gen.json | 48 +++++----- .../Transliterate_MaximumSet_Gen.json | 26 +++--- .../Transliterate_MinimumSet_Gen.json | 26 +++--- 8 files changed, 204 insertions(+), 172 deletions(-) diff --git a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json index a943a2954ecd..7b38077ddb3c 100644 --- a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json @@ -4,55 +4,59 @@ "parameters": { "X-ClientTraceId": "ndbkaatzsnoetqkiehappoza", "api-version": "2025-05-01-preview", - "body": [ - { - "text": "This is a test.", - "script": "Latn", - "language": "en", - "textType": "Plain", - "targets": [ - { - "language": "cs", - "script": "Latn", - "profanityAction": "NoAction", - "profanityMarker": "Asterisk", - "deploymentName": "gpt-4o-mini", - "allowFallback": true, - "grade": "basic", - "tone": "formal", - "gender": "neutral", - "adaptiveDatasetId": "21000", - "referenceTextPairs": [ - { - "source": "Please test this out.", - "target": "Vyzkoušejte si to." - } - ] - } - ] - } - ] - }, - "responses": { - "200": { - "body": [ + "body": { + "inputs": [ { - "detectedLanguage": { - "language": "en", - "score": 1.0 - }, - "translations": [ + "text": "This is a test.", + "script": "Latn", + "language": "en", + "textType": "Plain", + "targets": [ { "language": "cs", - "instructionTokens": 302, - "sourceTokens": 5, - "responseTokens": 9, - "targetTokens": 5, - "text": "Toto je test." + "script": "Latn", + "profanityAction": "NoAction", + "profanityMarker": "Asterisk", + "deploymentName": "gpt-4o-mini", + "allowFallback": true, + "grade": "basic", + "tone": "formal", + "gender": "neutral", + "adaptiveDatasetId": "21000", + "referenceTextPairs": [ + { + "source": "Please test this out.", + "target": "Vyzkoušejte si to." + } + ] } ] } ] } + }, + "responses": { + "200": { + "body": { + "values": [ + { + "detectedLanguage": { + "language": "en", + "score": 1.0 + }, + "translations": [ + { + "language": "cs", + "instructionTokens": 302, + "sourceTokens": 5, + "responseTokens": 9, + "targetTokens": 5, + "text": "Toto je test." + } + ] + } + ] + } + } } } diff --git a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json index 88003e501e4b..bb47ff923094 100644 --- a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json @@ -3,34 +3,38 @@ "operationId": "Translate", "parameters": { "api-version": "2025-05-01-preview", - "body": [ - { - "text": "This is a test.", - "targets": [ - { - "language": "cs" - } - ] - } - ] - }, - "responses": { - "200": { - "body": [ + "body": { + "inputs": [ { - "detectedLanguage": { - "language": "en", - "score": 0.12345 - }, - "translations": [ + "text": "This is a test.", + "targets": [ { - "language": "cs", - "sourceCharacters": 15, - "text": "Tohle je test." + "language": "cs" } ] } ] } + }, + "responses": { + "200": { + "body": { + "values": [ + { + "detectedLanguage": { + "language": "en", + "score": 0.12345 + }, + "translations": [ + { + "language": "cs", + "sourceCharacters": 15, + "text": "Tohle je test." + } + ] + } + ] + } + } } } diff --git a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MaximumSet_Gen.json b/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MaximumSet_Gen.json index 2c0351db37bc..62daee113b9c 100644 --- a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MaximumSet_Gen.json @@ -7,20 +7,24 @@ "fromScript": "Hans", "toScript": "Latn", "api-version": "2025-05-01-preview", - "body": [ - { - "text": "这是个测试。" - } - ] - }, - "responses": { - "200": { - "body": [ + "body": { + "inputs": [ { - "text": "zhè shì gè cè shì。", - "script": "Latn" + "text": "这是个测试。" } ] } + }, + "responses": { + "200": { + "body": { + "values": [ + { + "text": "zhè shì gè cè shì。", + "script": "Latn" + } + ] + } + } } } diff --git a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MinimumSet_Gen.json b/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MinimumSet_Gen.json index 3ae984cdc33c..807ba676df7c 100644 --- a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MinimumSet_Gen.json @@ -6,20 +6,24 @@ "fromScript": "Hans", "toScript": "Latn", "api-version": "2025-05-01-preview", - "body": [ - { - "text": "这是个测试。" - } - ] - }, - "responses": { - "200": { - "body": [ + "body": { + "inputs": [ { - "text": "zhè shì gè cè shì。", - "script": "Latn" + "text": "这是个测试。" } ] } + }, + "responses": { + "200": { + "body": { + "values": [ + { + "text": "zhè shì gè cè shì。", + "script": "Latn" + } + ] + } + } } } diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json index a943a2954ecd..7b38077ddb3c 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json @@ -4,55 +4,59 @@ "parameters": { "X-ClientTraceId": "ndbkaatzsnoetqkiehappoza", "api-version": "2025-05-01-preview", - "body": [ - { - "text": "This is a test.", - "script": "Latn", - "language": "en", - "textType": "Plain", - "targets": [ - { - "language": "cs", - "script": "Latn", - "profanityAction": "NoAction", - "profanityMarker": "Asterisk", - "deploymentName": "gpt-4o-mini", - "allowFallback": true, - "grade": "basic", - "tone": "formal", - "gender": "neutral", - "adaptiveDatasetId": "21000", - "referenceTextPairs": [ - { - "source": "Please test this out.", - "target": "Vyzkoušejte si to." - } - ] - } - ] - } - ] - }, - "responses": { - "200": { - "body": [ + "body": { + "inputs": [ { - "detectedLanguage": { - "language": "en", - "score": 1.0 - }, - "translations": [ + "text": "This is a test.", + "script": "Latn", + "language": "en", + "textType": "Plain", + "targets": [ { "language": "cs", - "instructionTokens": 302, - "sourceTokens": 5, - "responseTokens": 9, - "targetTokens": 5, - "text": "Toto je test." + "script": "Latn", + "profanityAction": "NoAction", + "profanityMarker": "Asterisk", + "deploymentName": "gpt-4o-mini", + "allowFallback": true, + "grade": "basic", + "tone": "formal", + "gender": "neutral", + "adaptiveDatasetId": "21000", + "referenceTextPairs": [ + { + "source": "Please test this out.", + "target": "Vyzkoušejte si to." + } + ] } ] } ] } + }, + "responses": { + "200": { + "body": { + "values": [ + { + "detectedLanguage": { + "language": "en", + "score": 1.0 + }, + "translations": [ + { + "language": "cs", + "instructionTokens": 302, + "sourceTokens": 5, + "responseTokens": 9, + "targetTokens": 5, + "text": "Toto je test." + } + ] + } + ] + } + } } } diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json index 88003e501e4b..bb47ff923094 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json @@ -3,34 +3,38 @@ "operationId": "Translate", "parameters": { "api-version": "2025-05-01-preview", - "body": [ - { - "text": "This is a test.", - "targets": [ - { - "language": "cs" - } - ] - } - ] - }, - "responses": { - "200": { - "body": [ + "body": { + "inputs": [ { - "detectedLanguage": { - "language": "en", - "score": 0.12345 - }, - "translations": [ + "text": "This is a test.", + "targets": [ { - "language": "cs", - "sourceCharacters": 15, - "text": "Tohle je test." + "language": "cs" } ] } ] } + }, + "responses": { + "200": { + "body": { + "values": [ + { + "detectedLanguage": { + "language": "en", + "score": 0.12345 + }, + "translations": [ + { + "language": "cs", + "sourceCharacters": 15, + "text": "Tohle je test." + } + ] + } + ] + } + } } } diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json index 2c0351db37bc..62daee113b9c 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json @@ -7,20 +7,24 @@ "fromScript": "Hans", "toScript": "Latn", "api-version": "2025-05-01-preview", - "body": [ - { - "text": "这是个测试。" - } - ] - }, - "responses": { - "200": { - "body": [ + "body": { + "inputs": [ { - "text": "zhè shì gè cè shì。", - "script": "Latn" + "text": "这是个测试。" } ] } + }, + "responses": { + "200": { + "body": { + "values": [ + { + "text": "zhè shì gè cè shì。", + "script": "Latn" + } + ] + } + } } } diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json index 3ae984cdc33c..807ba676df7c 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json @@ -6,20 +6,24 @@ "fromScript": "Hans", "toScript": "Latn", "api-version": "2025-05-01-preview", - "body": [ - { - "text": "这是个测试。" - } - ] - }, - "responses": { - "200": { - "body": [ + "body": { + "inputs": [ { - "text": "zhè shì gè cè shì。", - "script": "Latn" + "text": "这是个测试。" } ] } + }, + "responses": { + "200": { + "body": { + "values": [ + { + "text": "zhè shì gè cè shì。", + "script": "Latn" + } + ] + } + } } } From 9e8a276b3046694d4714401ed20eb57e1035e1c9 Mon Sep 17 00:00:00 2001 From: Jiarui Guo Date: Tue, 23 Sep 2025 14:41:40 -0700 Subject: [PATCH 117/119] rename response values -> value --- .../data-plane/TextTranslation/models-translate.tsp | 2 +- .../data-plane/TextTranslation/models-transliterate.tsp | 2 +- .../preview/2025-05-01-preview/openapi.json | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/specification/translation/data-plane/TextTranslation/models-translate.tsp b/specification/translation/data-plane/TextTranslation/models-translate.tsp index a26f1d185875..cf3cf1495551 100644 --- a/specification/translation/data-plane/TextTranslation/models-translate.tsp +++ b/specification/translation/data-plane/TextTranslation/models-translate.tsp @@ -290,7 +290,7 @@ model TranslationResult { ...CommonResultHeaders; @doc("Array of the translated text elements.") - values: TranslatedTextItem[]; + value: TranslatedTextItem[]; @header("x-mt-system") @doc(""" diff --git a/specification/translation/data-plane/TextTranslation/models-transliterate.tsp b/specification/translation/data-plane/TextTranslation/models-transliterate.tsp index fc790298ce7a..4c0dcff813c4 100644 --- a/specification/translation/data-plane/TextTranslation/models-transliterate.tsp +++ b/specification/translation/data-plane/TextTranslation/models-transliterate.tsp @@ -60,7 +60,7 @@ model TransliterateResult { ...CommonResultHeaders; @doc("Array of transliterated texts") - values: TransliteratedText[]; + value: TransliteratedText[]; } @doc("Transliterated text element.") diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json index d74f6fef8caa..05ed42dc5060 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json @@ -790,7 +790,7 @@ "type": "object", "description": "Response for the translation API.", "properties": { - "values": { + "value": { "type": "array", "description": "Array of the translated text elements.", "items": { @@ -799,7 +799,7 @@ } }, "required": [ - "values" + "value" ] }, "TranslationText": { @@ -886,7 +886,7 @@ "type": "object", "description": "Response for the transliteration API.", "properties": { - "values": { + "value": { "type": "array", "description": "Array of transliterated texts", "items": { @@ -895,7 +895,7 @@ } }, "required": [ - "values" + "value" ] }, "TransliteratedText": { From 92b6275e0c700be5f549db4b7dbeae04af42f216 Mon Sep 17 00:00:00 2001 From: Jiarui Guo Date: Tue, 23 Sep 2025 14:53:22 -0700 Subject: [PATCH 118/119] examples update values -> value --- .../examples/2025-05-01-preview/Translate_MaximumSet_Gen.json | 2 +- .../examples/2025-05-01-preview/Translate_MinimumSet_Gen.json | 2 +- .../2025-05-01-preview/Transliterate_MaximumSet_Gen.json | 2 +- .../2025-05-01-preview/Transliterate_MinimumSet_Gen.json | 2 +- .../2025-05-01-preview/examples/Translate_MaximumSet_Gen.json | 2 +- .../2025-05-01-preview/examples/Translate_MinimumSet_Gen.json | 2 +- .../examples/Transliterate_MaximumSet_Gen.json | 2 +- .../examples/Transliterate_MinimumSet_Gen.json | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json index 7b38077ddb3c..3fc869f91b0f 100644 --- a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json @@ -38,7 +38,7 @@ "responses": { "200": { "body": { - "values": [ + "value": [ { "detectedLanguage": { "language": "en", diff --git a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json index bb47ff923094..a42a0d1f6d6b 100644 --- a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json @@ -19,7 +19,7 @@ "responses": { "200": { "body": { - "values": [ + "value": [ { "detectedLanguage": { "language": "en", diff --git a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MaximumSet_Gen.json b/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MaximumSet_Gen.json index 62daee113b9c..bb3852ea66b0 100644 --- a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MaximumSet_Gen.json @@ -18,7 +18,7 @@ "responses": { "200": { "body": { - "values": [ + "value": [ { "text": "zhè shì gè cè shì。", "script": "Latn" diff --git a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MinimumSet_Gen.json b/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MinimumSet_Gen.json index 807ba676df7c..4b5ba1613064 100644 --- a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MinimumSet_Gen.json @@ -17,7 +17,7 @@ "responses": { "200": { "body": { - "values": [ + "value": [ { "text": "zhè shì gè cè shì。", "script": "Latn" diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json index 7b38077ddb3c..3fc869f91b0f 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json @@ -38,7 +38,7 @@ "responses": { "200": { "body": { - "values": [ + "value": [ { "detectedLanguage": { "language": "en", diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json index bb47ff923094..a42a0d1f6d6b 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json @@ -19,7 +19,7 @@ "responses": { "200": { "body": { - "values": [ + "value": [ { "detectedLanguage": { "language": "en", diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json index 62daee113b9c..bb3852ea66b0 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json @@ -18,7 +18,7 @@ "responses": { "200": { "body": { - "values": [ + "value": [ { "text": "zhè shì gè cè shì。", "script": "Latn" diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json index 807ba676df7c..4b5ba1613064 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json @@ -17,7 +17,7 @@ "responses": { "200": { "body": { - "values": [ + "value": [ { "text": "zhè shì gè cè shì。", "script": "Latn" From 0817d5e0a8ea3e3dbb669e5007cb88210b9d7f93 Mon Sep 17 00:00:00 2001 From: Jiarui Guo Date: Wed, 15 Oct 2025 09:08:19 -0700 Subject: [PATCH 119/119] 2025-05-01-preview -> 2025-10-01-preview --- .../GetSupportedLanguages_MaximumSet_Gen.json | 2 +- .../GetSupportedLanguages_MinimumSet_Gen.json | 2 +- .../Translate_MaximumSet_Gen.json | 2 +- .../Translate_MinimumSet_Gen.json | 2 +- .../Transliterate_MaximumSet_Gen.json | 2 +- .../Transliterate_MinimumSet_Gen.json | 2 +- .../data-plane/TextTranslation/main.tsp | 4 +- .../TextTranslation/models-breaksentence.tsp | 6 +- .../TextTranslation/models-dictionary.tsp | 20 +++--- .../TextTranslation/models-shared.tsp | 6 +- .../TextTranslation/models-translate.tsp | 66 +++++++++---------- .../TextTranslation/models-transliterate.tsp | 8 +-- .../GetSupportedLanguages_MaximumSet_Gen.json | 2 +- .../GetSupportedLanguages_MinimumSet_Gen.json | 2 +- .../examples}/Translate_MaximumSet_Gen.json | 2 +- .../examples}/Translate_MinimumSet_Gen.json | 2 +- .../Transliterate_MaximumSet_Gen.json | 2 +- .../Transliterate_MinimumSet_Gen.json | 2 +- .../openapi.json | 2 +- .../data-plane/TextTranslation/readme.md | 16 ++--- .../data-plane/TextTranslation/routes.tsp | 18 ++--- 21 files changed, 85 insertions(+), 85 deletions(-) rename specification/translation/data-plane/TextTranslation/examples/{2025-05-01-preview => 2025-10-01-preview}/GetSupportedLanguages_MaximumSet_Gen.json (98%) rename specification/translation/data-plane/TextTranslation/examples/{2025-05-01-preview => 2025-10-01-preview}/GetSupportedLanguages_MinimumSet_Gen.json (86%) rename specification/translation/data-plane/TextTranslation/{preview/2025-05-01-preview/examples => examples/2025-10-01-preview}/Translate_MaximumSet_Gen.json (97%) rename specification/translation/data-plane/TextTranslation/{preview/2025-05-01-preview/examples => examples/2025-10-01-preview}/Translate_MinimumSet_Gen.json (94%) rename specification/translation/data-plane/TextTranslation/examples/{2025-05-01-preview => 2025-10-01-preview}/Transliterate_MaximumSet_Gen.json (92%) rename specification/translation/data-plane/TextTranslation/examples/{2025-05-01-preview => 2025-10-01-preview}/Transliterate_MinimumSet_Gen.json (92%) rename specification/translation/data-plane/TextTranslation/preview/{2025-05-01-preview => 2025-10-01-preview}/examples/GetSupportedLanguages_MaximumSet_Gen.json (98%) rename specification/translation/data-plane/TextTranslation/preview/{2025-05-01-preview => 2025-10-01-preview}/examples/GetSupportedLanguages_MinimumSet_Gen.json (86%) rename specification/translation/data-plane/TextTranslation/{examples/2025-05-01-preview => preview/2025-10-01-preview/examples}/Translate_MaximumSet_Gen.json (97%) rename specification/translation/data-plane/TextTranslation/{examples/2025-05-01-preview => preview/2025-10-01-preview/examples}/Translate_MinimumSet_Gen.json (94%) rename specification/translation/data-plane/TextTranslation/preview/{2025-05-01-preview => 2025-10-01-preview}/examples/Transliterate_MaximumSet_Gen.json (92%) rename specification/translation/data-plane/TextTranslation/preview/{2025-05-01-preview => 2025-10-01-preview}/examples/Transliterate_MinimumSet_Gen.json (92%) rename specification/translation/data-plane/TextTranslation/preview/{2025-05-01-preview => 2025-10-01-preview}/openapi.json (99%) diff --git a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MaximumSet_Gen.json b/specification/translation/data-plane/TextTranslation/examples/2025-10-01-preview/GetSupportedLanguages_MaximumSet_Gen.json similarity index 98% rename from specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MaximumSet_Gen.json rename to specification/translation/data-plane/TextTranslation/examples/2025-10-01-preview/GetSupportedLanguages_MaximumSet_Gen.json index a766b8f0f5c4..6f8272101b23 100644 --- a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MaximumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/examples/2025-10-01-preview/GetSupportedLanguages_MaximumSet_Gen.json @@ -6,7 +6,7 @@ "scope": "translation,transliteration,dictionary", "Accept-Language": "en", "If-None-Match": "fpnhruttllvc", - "api-version": "2025-05-01-preview" + "api-version": "2025-10-01-preview" }, "responses": { "200": { diff --git a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MinimumSet_Gen.json b/specification/translation/data-plane/TextTranslation/examples/2025-10-01-preview/GetSupportedLanguages_MinimumSet_Gen.json similarity index 86% rename from specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MinimumSet_Gen.json rename to specification/translation/data-plane/TextTranslation/examples/2025-10-01-preview/GetSupportedLanguages_MinimumSet_Gen.json index 896d99d2697d..2d8fd62fd176 100644 --- a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/GetSupportedLanguages_MinimumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/examples/2025-10-01-preview/GetSupportedLanguages_MinimumSet_Gen.json @@ -2,7 +2,7 @@ "title": "Gets the set of languages currently supported by other operations of the Translator with minimum properties.", "operationId": "GetSupportedLanguages", "parameters": { - "api-version": "2025-05-01-preview" + "api-version": "2025-10-01-preview" }, "responses": { "200": { diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/TextTranslation/examples/2025-10-01-preview/Translate_MaximumSet_Gen.json similarity index 97% rename from specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json rename to specification/translation/data-plane/TextTranslation/examples/2025-10-01-preview/Translate_MaximumSet_Gen.json index 3fc869f91b0f..0d9060d8ea04 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/examples/2025-10-01-preview/Translate_MaximumSet_Gen.json @@ -3,7 +3,7 @@ "operationId": "Translate", "parameters": { "X-ClientTraceId": "ndbkaatzsnoetqkiehappoza", - "api-version": "2025-05-01-preview", + "api-version": "2025-10-01-preview", "body": { "inputs": [ { diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/TextTranslation/examples/2025-10-01-preview/Translate_MinimumSet_Gen.json similarity index 94% rename from specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json rename to specification/translation/data-plane/TextTranslation/examples/2025-10-01-preview/Translate_MinimumSet_Gen.json index a42a0d1f6d6b..ce1b820b1f5f 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Translate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/examples/2025-10-01-preview/Translate_MinimumSet_Gen.json @@ -2,7 +2,7 @@ "title": "Translate Text with minimum properties", "operationId": "Translate", "parameters": { - "api-version": "2025-05-01-preview", + "api-version": "2025-10-01-preview", "body": { "inputs": [ { diff --git a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MaximumSet_Gen.json b/specification/translation/data-plane/TextTranslation/examples/2025-10-01-preview/Transliterate_MaximumSet_Gen.json similarity index 92% rename from specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MaximumSet_Gen.json rename to specification/translation/data-plane/TextTranslation/examples/2025-10-01-preview/Transliterate_MaximumSet_Gen.json index bb3852ea66b0..7be9e729071f 100644 --- a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/examples/2025-10-01-preview/Transliterate_MaximumSet_Gen.json @@ -6,7 +6,7 @@ "language": "zh-Hans", "fromScript": "Hans", "toScript": "Latn", - "api-version": "2025-05-01-preview", + "api-version": "2025-10-01-preview", "body": { "inputs": [ { diff --git a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MinimumSet_Gen.json b/specification/translation/data-plane/TextTranslation/examples/2025-10-01-preview/Transliterate_MinimumSet_Gen.json similarity index 92% rename from specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MinimumSet_Gen.json rename to specification/translation/data-plane/TextTranslation/examples/2025-10-01-preview/Transliterate_MinimumSet_Gen.json index 4b5ba1613064..b957d5852e0b 100644 --- a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Transliterate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/examples/2025-10-01-preview/Transliterate_MinimumSet_Gen.json @@ -5,7 +5,7 @@ "language": "zh-Hans", "fromScript": "Hans", "toScript": "Latn", - "api-version": "2025-05-01-preview", + "api-version": "2025-10-01-preview", "body": { "inputs": [ { diff --git a/specification/translation/data-plane/TextTranslation/main.tsp b/specification/translation/data-plane/TextTranslation/main.tsp index 6781c417d002..2614c8bccbb9 100644 --- a/specification/translation/data-plane/TextTranslation/main.tsp +++ b/specification/translation/data-plane/TextTranslation/main.tsp @@ -42,6 +42,6 @@ enum APIVersion { @doc("Version 3.0") v3_0: "3.0", - @doc("Version 2025-05-01") - v2025_05_01_preview: "2025-05-01-preview", + @doc("Version 2025-10-01") + v2025_10_01_preview: "2025-10-01-preview", } diff --git a/specification/translation/data-plane/TextTranslation/models-breaksentence.tsp b/specification/translation/data-plane/TextTranslation/models-breaksentence.tsp index e2b04fe5d140..f1dd5284077f 100644 --- a/specification/translation/data-plane/TextTranslation/models-breaksentence.tsp +++ b/specification/translation/data-plane/TextTranslation/models-breaksentence.tsp @@ -11,7 +11,7 @@ using Azure.Core; namespace TextTranslation; @doc("Request parameters for the break sentence API.") -@removed(APIVersion.v2025_05_01_preview) +@removed(APIVersion.v2025_10_01_preview) model BreakSentenceParameters { ...CommonParameters; @@ -31,7 +31,7 @@ model BreakSentenceParameters { } @doc("Response for the Break SEntence API.") -@removed(APIVersion.v2025_05_01_preview) +@removed(APIVersion.v2025_10_01_preview) model BreakSentenceResult { ...CommonResultHeaders; @@ -41,7 +41,7 @@ model BreakSentenceResult { } @doc("Item containing break sentence result.") -@removed(APIVersion.v2025_05_01_preview) +@removed(APIVersion.v2025_10_01_preview) model BreakSentenceItem { @doc("The detectedLanguage property is only present in the result object when language auto-detection is requested.") detectedLanguage?: DetectedLanguage; diff --git a/specification/translation/data-plane/TextTranslation/models-dictionary.tsp b/specification/translation/data-plane/TextTranslation/models-dictionary.tsp index 2cb25268da8b..bafc64d50ffa 100644 --- a/specification/translation/data-plane/TextTranslation/models-dictionary.tsp +++ b/specification/translation/data-plane/TextTranslation/models-dictionary.tsp @@ -9,7 +9,7 @@ using Azure.Core; namespace TextTranslation; -@removed(APIVersion.v2025_05_01_preview) +@removed(APIVersion.v2025_10_01_preview) @doc("Request parameters for the dictionary lookup API.") model DictionaryLookupParameters { ...CommonParameters; @@ -29,7 +29,7 @@ model DictionaryLookupParameters { to: string; } -@removed(APIVersion.v2025_05_01_preview) +@removed(APIVersion.v2025_10_01_preview) @doc("Request parameters for the dictionary examples API.") model DictionaryExamplesParameters { ...CommonParameters; @@ -49,7 +49,7 @@ model DictionaryExamplesParameters { to: string; } -@removed(APIVersion.v2025_05_01_preview) +@removed(APIVersion.v2025_10_01_preview) @doc("Response for the dictionary lookup API.") model DictionaryLookupResult { ...CommonResultHeaders; @@ -59,7 +59,7 @@ model DictionaryLookupResult { result: DictionaryLookupItem[]; } -@removed(APIVersion.v2025_05_01_preview) +@removed(APIVersion.v2025_10_01_preview) @doc("Response for the dictionary examples API.") model DictionaryExamplesResult { ...CommonResultHeaders; @@ -70,7 +70,7 @@ model DictionaryExamplesResult { } @doc("Element containing the text with translation.") -@removed(APIVersion.v2025_05_01_preview) +@removed(APIVersion.v2025_10_01_preview) model DictionaryExampleTextItem extends InputTextItem { @doc(""" A string specifying the translated text previously returned by the Dictionary lookup operation. @@ -80,7 +80,7 @@ model DictionaryExampleTextItem extends InputTextItem { translation: string; } -@removed(APIVersion.v2025_05_01_preview) +@removed(APIVersion.v2025_10_01_preview) @doc("Dictionary Lookup Element") model DictionaryLookupItem { @doc(""" @@ -103,7 +103,7 @@ model DictionaryLookupItem { translations: DictionaryTranslation[]; } -@removed(APIVersion.v2025_05_01_preview) +@removed(APIVersion.v2025_10_01_preview) @doc("Translation source term.") model DictionaryTranslation { @doc(""" @@ -150,7 +150,7 @@ model DictionaryTranslation { backTranslations: BackTranslation[]; } -@removed(APIVersion.v2025_05_01_preview) +@removed(APIVersion.v2025_10_01_preview) @doc("Back Translation") model BackTranslation { @doc(""" @@ -183,7 +183,7 @@ model BackTranslation { frequencyCount: int32; } -@removed(APIVersion.v2025_05_01_preview) +@removed(APIVersion.v2025_10_01_preview) @doc("Dictionary Example element") model DictionaryExampleItem { @doc(""" @@ -204,7 +204,7 @@ model DictionaryExampleItem { examples: DictionaryExample[]; } -@removed(APIVersion.v2025_05_01_preview) +@removed(APIVersion.v2025_10_01_preview) @doc("Dictionary Example") model DictionaryExample { @doc(""" diff --git a/specification/translation/data-plane/TextTranslation/models-shared.tsp b/specification/translation/data-plane/TextTranslation/models-shared.tsp index f9ba22020fc4..107e4a75b04f 100644 --- a/specification/translation/data-plane/TextTranslation/models-shared.tsp +++ b/specification/translation/data-plane/TextTranslation/models-shared.tsp @@ -41,12 +41,12 @@ model ErrorResponse { @doc("Error details as returned by Translator Service.") model ErrorDetails { - @removed(APIVersion.v2025_05_01_preview) - @renamedFrom(APIVersion.v2025_05_01_preview, "code") + @removed(APIVersion.v2025_10_01_preview) + @renamedFrom(APIVersion.v2025_10_01_preview, "code") @doc("Number identifier of the error.") codeV3: int32; - @added(APIVersion.v2025_05_01_preview) + @added(APIVersion.v2025_10_01_preview) @doc("String identifier of the error.") code: string; diff --git a/specification/translation/data-plane/TextTranslation/models-translate.tsp b/specification/translation/data-plane/TextTranslation/models-translate.tsp index cf3cf1495551..9f47ded25e64 100644 --- a/specification/translation/data-plane/TextTranslation/models-translate.tsp +++ b/specification/translation/data-plane/TextTranslation/models-translate.tsp @@ -15,7 +15,7 @@ model TranslateParameters { ...CommonParameters; #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Existing Spec" - @removed(APIVersion.v2025_05_01_preview) + @removed(APIVersion.v2025_10_01_preview) @query(#{ explode: true }) @doc(""" Specifies the language of the output text. The target language must be one of the supported languages included @@ -25,7 +25,7 @@ model TranslateParameters { """) to: string[]; - @removed(APIVersion.v2025_05_01_preview) + @removed(APIVersion.v2025_10_01_preview) @query @doc(""" Specifies the language of the input text. Find which languages are available to translate from by @@ -37,7 +37,7 @@ model TranslateParameters { """) from?: string; - @removed(APIVersion.v2025_05_01_preview) + @removed(APIVersion.v2025_10_01_preview) @query @doc(""" Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, @@ -45,7 +45,7 @@ model TranslateParameters { """) textType?: TextType = "Plain"; - @removed(APIVersion.v2025_05_01_preview) + @removed(APIVersion.v2025_10_01_preview) @query @doc(""" A string specifying the category (domain) of the translation. This parameter is used to get translations @@ -54,7 +54,7 @@ model TranslateParameters { """) category?: string = "general"; - @removed(APIVersion.v2025_05_01_preview) + @removed(APIVersion.v2025_10_01_preview) @query @doc(""" Specifies how profanities should be treated in translations. @@ -62,7 +62,7 @@ model TranslateParameters { """) profanityAction?: ProfanityAction = ProfanityAction.NoAction; - @removed(APIVersion.v2025_05_01_preview) + @removed(APIVersion.v2025_10_01_preview) @query @doc(""" Specifies how profanities should be marked in translations. @@ -70,7 +70,7 @@ model TranslateParameters { """) profanityMarker?: ProfanityMarker = ProfanityMarker.Asterisk; - @removed(APIVersion.v2025_05_01_preview) + @removed(APIVersion.v2025_10_01_preview) @query @doc(""" Specifies whether to include alignment projection from source text to translated text. @@ -78,7 +78,7 @@ model TranslateParameters { """) includeAlignment?: boolean = false; - @removed(APIVersion.v2025_05_01_preview) + @removed(APIVersion.v2025_10_01_preview) @query @doc(""" Specifies whether to include sentence boundaries for the input text and the translated text. @@ -86,7 +86,7 @@ model TranslateParameters { """) includeSentenceLength?: boolean = false; - @removed(APIVersion.v2025_05_01_preview) + @removed(APIVersion.v2025_10_01_preview) @query @doc(""" Specifies a fallback language if the language of the input text can't be identified. @@ -95,21 +95,21 @@ model TranslateParameters { """) suggestedFrom?: string; - @removed(APIVersion.v2025_05_01_preview) + @removed(APIVersion.v2025_10_01_preview) @query @doc(""" Specifies the script of the input text. """) fromScript?: string; - @removed(APIVersion.v2025_05_01_preview) + @removed(APIVersion.v2025_10_01_preview) @query @doc(""" Specifies the script of the translated text. """) toScript?: string; - @removed(APIVersion.v2025_05_01_preview) + @removed(APIVersion.v2025_10_01_preview) @query @doc(""" Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. @@ -125,7 +125,7 @@ model TranslateParameters { } @doc("Translate targets parameters") -@added(APIVersion.v2025_05_01_preview) +@added(APIVersion.v2025_10_01_preview) model TranslateTarget { @doc(""" Specifies the language of the output text. The target language must be one of the supported languages included @@ -206,14 +206,14 @@ model TranslateTarget { } @doc("Request body for the translate API.") -@added(APIVersion.v2025_05_01_preview) +@added(APIVersion.v2025_10_01_preview) model TranslateBody { @doc("Array of the input text elements to translate.") inputs: TranslateInputItem[]; } @doc("Element containing the text for translation.") -@added(APIVersion.v2025_05_01_preview) +@added(APIVersion.v2025_10_01_preview) model TranslateInputItem { @doc("Text to translate.") text: string; @@ -246,7 +246,7 @@ model TranslateInputItem { } @doc("Reference sentence pair.") -@added(APIVersion.v2025_05_01_preview) +@added(APIVersion.v2025_10_01_preview) model ReferenceSentencePair { @doc("Source reference sentence.") source: string; @@ -256,8 +256,8 @@ model ReferenceSentencePair { } @doc("Response for the translation API.") -@renamedFrom(APIVersion.v2025_05_01_preview, "TranslationResult") -@removed(APIVersion.v2025_05_01_preview) +@renamedFrom(APIVersion.v2025_10_01_preview, "TranslationResult") +@removed(APIVersion.v2025_10_01_preview) model TranslationResultV3 { ...CommonResultHeaders; @@ -285,7 +285,7 @@ model TranslationResultV3 { } @doc("Response for the translation API.") -@added(APIVersion.v2025_05_01_preview) +@added(APIVersion.v2025_10_01_preview) model TranslationResult { ...CommonResultHeaders; @@ -356,7 +356,7 @@ model TranslatedTextItem { """) translations: TranslationText[]; - @removed(APIVersion.v2025_05_01_preview) + @removed(APIVersion.v2025_10_01_preview) @doc(""" Input text in the default script of the source language. sourceText property is present only when the input is expressed in a script that's not the usual script for the language. For example, @@ -380,57 +380,57 @@ model DetectedLanguage { @doc("Translation result") model TranslationText { - @removed(APIVersion.v2025_05_01_preview) + @removed(APIVersion.v2025_10_01_preview) @doc("A string representing the language code of the target language.") to: string; - @added(APIVersion.v2025_05_01_preview) + @added(APIVersion.v2025_10_01_preview) @doc("A string representing the language code of the target language.") language: string; - @added(APIVersion.v2025_05_01_preview) + @added(APIVersion.v2025_10_01_preview) @doc("An interger indicating the number of characters in the source text string") sourceCharacters?: int32; - @added(APIVersion.v2025_05_01_preview) + @added(APIVersion.v2025_10_01_preview) @doc("An interger indicating the number of tokens used in generating the translated text") instructionTokens?: int32; - @added(APIVersion.v2025_05_01_preview) + @added(APIVersion.v2025_10_01_preview) @doc("An interger indicating the number of tokens used in the source sentence") sourceTokens?: int32; - @added(APIVersion.v2025_05_01_preview) + @added(APIVersion.v2025_10_01_preview) @doc("An interger indicating the number of tokens used in the translation response") responseTokens?: int32; - @added(APIVersion.v2025_05_01_preview) + @added(APIVersion.v2025_10_01_preview) @doc("An interger indicating the number of tokens used in the target sentence") targetTokens?: int32; @doc("A string giving the translated text.") text: string; - @removed(APIVersion.v2025_05_01_preview) + @removed(APIVersion.v2025_10_01_preview) @doc(""" An object giving the translated text in the script specified by the toScript parameter. """) transliteration?: TransliteratedText; - @removed(APIVersion.v2025_05_01_preview) + @removed(APIVersion.v2025_10_01_preview) @doc(""" Alignment information. """) alignment?: TranslatedTextAlignment; - @removed(APIVersion.v2025_05_01_preview) + @removed(APIVersion.v2025_10_01_preview) @doc(""" Sentence boundaries in the input and output texts. """) sentLen?: SentenceBoundaries; } -@removed(APIVersion.v2025_05_01_preview) +@removed(APIVersion.v2025_10_01_preview) @doc("Alignment information object.") model TranslatedTextAlignment { @doc(""" @@ -444,7 +444,7 @@ model TranslatedTextAlignment { proj: string; } -@removed(APIVersion.v2025_05_01_preview) +@removed(APIVersion.v2025_10_01_preview) @doc("An object returning sentence boundaries in the input and output texts.") model SentenceBoundaries { @doc(""" @@ -460,7 +460,7 @@ model SentenceBoundaries { transSentLen: int32[]; } -@removed(APIVersion.v2025_05_01_preview) +@removed(APIVersion.v2025_10_01_preview) @doc("Input text in the default script of the source language. ") model SourceText { @doc(""" diff --git a/specification/translation/data-plane/TextTranslation/models-transliterate.tsp b/specification/translation/data-plane/TextTranslation/models-transliterate.tsp index 4c0dcff813c4..3fd9d4fec5a3 100644 --- a/specification/translation/data-plane/TextTranslation/models-transliterate.tsp +++ b/specification/translation/data-plane/TextTranslation/models-transliterate.tsp @@ -37,15 +37,15 @@ model TransliterateParameters { } @doc("Request body for the transliterate API.") -@added(APIVersion.v2025_05_01_preview) +@added(APIVersion.v2025_10_01_preview) model TransliterateBody { @doc("Array of the input text elements to transliterate.") inputs: InputTextItem[]; } @doc("Response for the transliteration API.") -@renamedFrom(APIVersion.v2025_05_01_preview, "TransliterateResult") -@removed(APIVersion.v2025_05_01_preview) +@renamedFrom(APIVersion.v2025_10_01_preview, "TransliterateResult") +@removed(APIVersion.v2025_10_01_preview) model TransliterateResultV3 { ...CommonResultHeaders; @@ -55,7 +55,7 @@ model TransliterateResultV3 { } @doc("Response for the transliteration API.") -@added(APIVersion.v2025_05_01_preview) +@added(APIVersion.v2025_10_01_preview) model TransliterateResult { ...CommonResultHeaders; diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MaximumSet_Gen.json b/specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/examples/GetSupportedLanguages_MaximumSet_Gen.json similarity index 98% rename from specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MaximumSet_Gen.json rename to specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/examples/GetSupportedLanguages_MaximumSet_Gen.json index a766b8f0f5c4..6f8272101b23 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MaximumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/examples/GetSupportedLanguages_MaximumSet_Gen.json @@ -6,7 +6,7 @@ "scope": "translation,transliteration,dictionary", "Accept-Language": "en", "If-None-Match": "fpnhruttllvc", - "api-version": "2025-05-01-preview" + "api-version": "2025-10-01-preview" }, "responses": { "200": { diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MinimumSet_Gen.json b/specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/examples/GetSupportedLanguages_MinimumSet_Gen.json similarity index 86% rename from specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MinimumSet_Gen.json rename to specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/examples/GetSupportedLanguages_MinimumSet_Gen.json index 896d99d2697d..2d8fd62fd176 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/GetSupportedLanguages_MinimumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/examples/GetSupportedLanguages_MinimumSet_Gen.json @@ -2,7 +2,7 @@ "title": "Gets the set of languages currently supported by other operations of the Translator with minimum properties.", "operationId": "GetSupportedLanguages", "parameters": { - "api-version": "2025-05-01-preview" + "api-version": "2025-10-01-preview" }, "responses": { "200": { diff --git a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json b/specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/examples/Translate_MaximumSet_Gen.json similarity index 97% rename from specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json rename to specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/examples/Translate_MaximumSet_Gen.json index 3fc869f91b0f..0d9060d8ea04 100644 --- a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/examples/Translate_MaximumSet_Gen.json @@ -3,7 +3,7 @@ "operationId": "Translate", "parameters": { "X-ClientTraceId": "ndbkaatzsnoetqkiehappoza", - "api-version": "2025-05-01-preview", + "api-version": "2025-10-01-preview", "body": { "inputs": [ { diff --git a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/examples/Translate_MinimumSet_Gen.json similarity index 94% rename from specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json rename to specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/examples/Translate_MinimumSet_Gen.json index a42a0d1f6d6b..ce1b820b1f5f 100644 --- a/specification/translation/data-plane/TextTranslation/examples/2025-05-01-preview/Translate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/examples/Translate_MinimumSet_Gen.json @@ -2,7 +2,7 @@ "title": "Translate Text with minimum properties", "operationId": "Translate", "parameters": { - "api-version": "2025-05-01-preview", + "api-version": "2025-10-01-preview", "body": { "inputs": [ { diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json b/specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/examples/Transliterate_MaximumSet_Gen.json similarity index 92% rename from specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json rename to specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/examples/Transliterate_MaximumSet_Gen.json index bb3852ea66b0..7be9e729071f 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MaximumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/examples/Transliterate_MaximumSet_Gen.json @@ -6,7 +6,7 @@ "language": "zh-Hans", "fromScript": "Hans", "toScript": "Latn", - "api-version": "2025-05-01-preview", + "api-version": "2025-10-01-preview", "body": { "inputs": [ { diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json b/specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/examples/Transliterate_MinimumSet_Gen.json similarity index 92% rename from specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json rename to specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/examples/Transliterate_MinimumSet_Gen.json index 4b5ba1613064..b957d5852e0b 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/examples/Transliterate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/examples/Transliterate_MinimumSet_Gen.json @@ -5,7 +5,7 @@ "language": "zh-Hans", "fromScript": "Hans", "toScript": "Latn", - "api-version": "2025-05-01-preview", + "api-version": "2025-10-01-preview", "body": { "inputs": [ { diff --git a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json b/specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/openapi.json similarity index 99% rename from specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json rename to specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/openapi.json index 05ed42dc5060..9fa50612847b 100644 --- a/specification/translation/data-plane/TextTranslation/preview/2025-05-01-preview/openapi.json +++ b/specification/translation/data-plane/TextTranslation/preview/2025-10-01-preview/openapi.json @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "title": "Text Translation", - "version": "2025-05-01-preview", + "version": "2025-10-01-preview", "description": "Text translation is a cloud-based REST API feature of the Translator service that uses neural\nmachine translation technology to enable quick and accurate source-to-target text translation\nin real time across all supported languages.\n\nThe following methods are supported by the Text Translation feature:\n\nLanguages. Returns a list of languages supported by Translate, Transliterate, and Dictionary Lookup operations.\n\nTranslate. Renders single source-language text to multiple target-language texts with a single request.\n\nTransliterate. Converts characters or letters of a source language to the corresponding characters or letters of a target language.\n\nDetect. Returns the source code language code and a boolean variable denoting whether the detected language is supported for text translation and transliteration.", "x-typespec-generated": [ { diff --git a/specification/translation/data-plane/TextTranslation/readme.md b/specification/translation/data-plane/TextTranslation/readme.md index bd80aeb1d712..020bae8a2c56 100644 --- a/specification/translation/data-plane/TextTranslation/readme.md +++ b/specification/translation/data-plane/TextTranslation/readme.md @@ -11,10 +11,10 @@ To see additional help and options, run: > `autorest --help` --- -The current release is `package-2025-05-01-preview`. +The current release is `package-2025-10-01-preview`. ``` yaml -tag: package-2025-05-01-preview +tag: package-2025-10-01-preview add-credentials: true openapi-type: data-plane ``` @@ -29,14 +29,14 @@ These settings apply only when `--tag=release_3_0` is specified on the command l input-file: stable/3.0/openapi.json ``` -### Release 2025-05-01-preview +### Release 2025-10-01-preview -These settings apply only when `--tag=package-2025-05-01-preview` is specified on the command line. +These settings apply only when `--tag=package-2025-10-01-preview` is specified on the command line. -``` yaml $(tag) == 'package-2025-05-01-preview' -version: package-2025-05-01-preview +``` yaml $(tag) == 'package-2025-10-01-preview' +version: package-2025-10-01-preview input-file: - - preview/2025-05-01-preview/openapi.json + - preview/2025-10-01-preview/openapi.json ``` ## Multi-API/Profile support for AutoRest v3 generators @@ -52,7 +52,7 @@ require: $(this-folder)/../../../../profiles/readme.md # all the input files across all versions input-file: - $(this-folder)/stable/3.0/openapi.json - - $(this-folder)/preview/2025-05-01-preview/openapi.json + - $(this-folder)/preview/2025-10-01-preview/openapi.json ``` If there are files that should not be in the `all-api-versions` set, diff --git a/specification/translation/data-plane/TextTranslation/routes.tsp b/specification/translation/data-plane/TextTranslation/routes.tsp index 175a0bb07979..f677d46cb80a 100644 --- a/specification/translation/data-plane/TextTranslation/routes.tsp +++ b/specification/translation/data-plane/TextTranslation/routes.tsp @@ -53,8 +53,8 @@ op getSupportedLanguages is CustomGetOperation< @doc("Translate Text") @route("translate") @sharedRoute -@renamedFrom(APIVersion.v2025_05_01_preview, "translate") -@removed(APIVersion.v2025_05_01_preview) +@renamedFrom(APIVersion.v2025_10_01_preview, "translate") +@removed(APIVersion.v2025_10_01_preview) op translateV3 is CustomOperation< InputTextItem[], TranslateParameters, @@ -68,7 +68,7 @@ op translateV3 is CustomOperation< @summary("Translate Text") @doc("Translate Text") @route("translate") -@added(APIVersion.v2025_05_01_preview) +@added(APIVersion.v2025_10_01_preview) op translate is CustomOperation< TranslateBody, TranslateParameters, @@ -82,8 +82,8 @@ op translate is CustomOperation< @route("transliterate") @summary("Transliterate Text") @doc("Transliterate Text") -@renamedFrom(APIVersion.v2025_05_01_preview, "transliterate") -@removed(APIVersion.v2025_05_01_preview) +@renamedFrom(APIVersion.v2025_10_01_preview, "transliterate") +@removed(APIVersion.v2025_10_01_preview) op transliterateV3 is CustomOperation< InputTextItem[], TransliterateParameters, @@ -97,7 +97,7 @@ op transliterateV3 is CustomOperation< @route("transliterate") @summary("Transliterate Text") @doc("Transliterate Text") -@added(APIVersion.v2025_05_01_preview) +@added(APIVersion.v2025_10_01_preview) op transliterate is CustomOperation< TransliterateBody, TransliterateParameters, @@ -106,7 +106,7 @@ op transliterate is CustomOperation< >; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." -@removed(APIVersion.v2025_05_01_preview) +@removed(APIVersion.v2025_10_01_preview) @post @route("breaksentence") @summary("Find Sentence Boundaries") @@ -119,7 +119,7 @@ op findSentenceBoundaries is CustomOperation< >; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." -@removed(APIVersion.v2025_05_01_preview) +@removed(APIVersion.v2025_10_01_preview) @post @route("dictionary/lookup") @summary("Lookup Dictionary Entries") @@ -136,7 +136,7 @@ op lookupDictionaryEntries is CustomOperation< @route("dictionary/examples") @summary("Lookup Dictionary Examples") @doc("Lookup Dictionary Examples") -@removed(APIVersion.v2025_05_01_preview) +@removed(APIVersion.v2025_10_01_preview) op lookupDictionaryExamples is CustomOperation< DictionaryExampleTextItem[], DictionaryExamplesParameters,