Skip to content

Commit 6832e43

Browse files
SG-MSzhangeugeniaqiaozhaJiarui Guomikeharder
authored
Update translate call to 2025-10-01-preview (Azure#33410)
* Update translate call to 2025-05-01 * Remove legacy api calls * Remove legacy api calls * Update version * Update grade description * Update typespec for translate call * Update typespec for translate call * update typespec for translate call - Fix Formatting * CHeckpoint on translate API update * Add reference sentences into set * Add reference sentences into set * Several updates to spec * sync new openapi.json * sync new openapi.json * Fix examples and api * Fix examples and api * Remove old files * Remove old files * FIx versioning * Fix examples in preview * Fix examples in preview * Fix examples in preview * Fix examples in preview * Fix examples in preview * Fix examples in preview * Fix examples * Removing defaults for tone and gender fields as per API design spec * Update targets to an array value. Rename adaptiveDatasetIds to adaptiveDatasetId and make it a string rather than an array of strings. * Adding missing go config in tspconfig.yaml * Recompiling typespec after changes * Fixing tspconfig for Document Translator as well (TSValidation CI is checking entire /translation folder) * Updating more misconfigs in Document Translator tspconfig * More updates to DT tspconfig * More updates to DT tspconfig * More updates to Text tspconfig * Add back in compliant v3 API * Add back in compliant v3 API * Reduce parameters in 2025-05-1 version" * Fix whitespace issue * Revert stable version number to v3.0 * Reverting version 3.0 to v3.0 * Reverting version 3.0 to v3.0 * Reverting version 3.0 to v3.0 * Add GO SDK instructions * Add GO SDK instructions * Add GO SDK instructions * Add GO SDK instructions * Remove readme/openapi instructions * TUrn off autorest again * TUrn off autorest again * Remove readme/openapi instructions * Add autorest emitter * Remove OpenAPI SDK generation * Fix v3 api to remove breaking change * Fix v3 api to remove breaking change * Fix v3 api to remove breaking change * Unify v3 and 2025_05_01 body model * Unify v3 and 2025_05_01 body model * Unify v3 and 2025_05_01 body model * Unify v3 and 2025_05_01 body model * Fix examples * Fix examples * Fix examples * Fix examples * Adding swagger-to-sdk block * Remove 3.0 * add 3.0 * Remove Go * Remove go sdk * More cleanup * More cleanup * More cleanup * More cleanup * More cleanup * More cleanup * More cleanup * More cleanup * More cleanup * More cleanup * Fix versioning * Fix versioning * Fix versioning * Fix versioning * Fix versioning * Fix 3.0 examples * Fix 3.0 examples * Update target.language * Update target.language * Update target.language * Remove SourceText. Rename DeploymentName * Remove SourceText. Rename DeploymentName * Remove SourceText. Rename DeploymentName * updating comment * Remove deprecated @fixed decorators from typespec * Remove deprecated @fixed decorators from typespec * Remove deprecated @fixed decorators from typespec * Change To into Language. Add SourceCharacters * Update a couple more parameters. * Update a couple more parameters. * Update a couple more parameters. * Remove readme.md for text translation * Add readme.md back in * remove 3.0 * update openapi.json ref in readme * unchange translation tspconfigs * translation tspconfig format * unremove transliteration * keep v3 and v4 transliteration docs * -sourceText +text * remove transliteration & source text in results * errorDetails code int32 -> string * translate result body updatet * transliterate response * translate body * transliterate request body * update examples * rename response values -> value * examples update values -> value * 2025-05-01-preview -> 2025-10-01-preview --------- Co-authored-by: Eugenia <euzhang@microsoft.com> Co-authored-by: Eugenia <zhangeugenia@users.noreply.github.com> Co-authored-by: Qiaoqiao Zhang <qiaozha@microsoft.com> Co-authored-by: Jiarui Guo <jiarguo@microsoft.com> Co-authored-by: Mike Harder <mharder@microsoft.com>
1 parent 7a91827 commit 6832e43

22 files changed

+1829
-36
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"title": "Gets the set of languages currently supported by other operations of the Translator.",
3+
"operationId": "GetSupportedLanguages",
4+
"parameters": {
5+
"X-ClientTraceId": "kayfnugjec",
6+
"scope": "translation,transliteration,dictionary",
7+
"Accept-Language": "en",
8+
"If-None-Match": "fpnhruttllvc",
9+
"api-version": "2025-10-01-preview"
10+
},
11+
"responses": {
12+
"200": {
13+
"body": {
14+
"translation": {
15+
"en": {
16+
"name": "English",
17+
"nativeName": "English",
18+
"dir": "ltr"
19+
},
20+
"es": {
21+
"name": "Spanish",
22+
"nativeName": "Español",
23+
"dir": "ltr"
24+
}
25+
},
26+
"transliteration": {
27+
"ar": {
28+
"name": "Arabic",
29+
"nativeName": "العربية",
30+
"scripts": [
31+
{
32+
"code": "Arab",
33+
"name": "Arabic",
34+
"nativeName": "العربية",
35+
"dir": "rtl",
36+
"toScripts": [
37+
{
38+
"code": "Latn",
39+
"name": "Latin",
40+
"nativeName": "اللاتينية",
41+
"dir": "ltr"
42+
}
43+
]
44+
},
45+
{
46+
"code": "Latn",
47+
"name": "Latin",
48+
"nativeName": "اللاتينية",
49+
"dir": "ltr",
50+
"toScripts": [
51+
{
52+
"code": "Arab",
53+
"name": "Arabic",
54+
"nativeName": "العربية",
55+
"dir": "rtl"
56+
}
57+
]
58+
}
59+
]
60+
}
61+
},
62+
"dictionary": {
63+
"cs": {
64+
"name": "Czech",
65+
"nativeName": "Čeština",
66+
"dir": "ltr",
67+
"translations": [
68+
{
69+
"name": "English",
70+
"nativeName": "English",
71+
"dir": "ltr",
72+
"code": "en"
73+
}
74+
]
75+
}
76+
}
77+
}
78+
}
79+
}
80+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"title": "Gets the set of languages currently supported by other operations of the Translator with minimum properties.",
3+
"operationId": "GetSupportedLanguages",
4+
"parameters": {
5+
"api-version": "2025-10-01-preview"
6+
},
7+
"responses": {
8+
"200": {
9+
"body": {}
10+
}
11+
}
12+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"title": "Translate Text",
3+
"operationId": "Translate",
4+
"parameters": {
5+
"X-ClientTraceId": "ndbkaatzsnoetqkiehappoza",
6+
"api-version": "2025-10-01-preview",
7+
"body": {
8+
"inputs": [
9+
{
10+
"text": "This is a test.",
11+
"script": "Latn",
12+
"language": "en",
13+
"textType": "Plain",
14+
"targets": [
15+
{
16+
"language": "cs",
17+
"script": "Latn",
18+
"profanityAction": "NoAction",
19+
"profanityMarker": "Asterisk",
20+
"deploymentName": "gpt-4o-mini",
21+
"allowFallback": true,
22+
"grade": "basic",
23+
"tone": "formal",
24+
"gender": "neutral",
25+
"adaptiveDatasetId": "21000",
26+
"referenceTextPairs": [
27+
{
28+
"source": "Please test this out.",
29+
"target": "Vyzkoušejte si to."
30+
}
31+
]
32+
}
33+
]
34+
}
35+
]
36+
}
37+
},
38+
"responses": {
39+
"200": {
40+
"body": {
41+
"value": [
42+
{
43+
"detectedLanguage": {
44+
"language": "en",
45+
"score": 1.0
46+
},
47+
"translations": [
48+
{
49+
"language": "cs",
50+
"instructionTokens": 302,
51+
"sourceTokens": 5,
52+
"responseTokens": 9,
53+
"targetTokens": 5,
54+
"text": "Toto je test."
55+
}
56+
]
57+
}
58+
]
59+
}
60+
}
61+
}
62+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"title": "Translate Text with minimum properties",
3+
"operationId": "Translate",
4+
"parameters": {
5+
"api-version": "2025-10-01-preview",
6+
"body": {
7+
"inputs": [
8+
{
9+
"text": "This is a test.",
10+
"targets": [
11+
{
12+
"language": "cs"
13+
}
14+
]
15+
}
16+
]
17+
}
18+
},
19+
"responses": {
20+
"200": {
21+
"body": {
22+
"value": [
23+
{
24+
"detectedLanguage": {
25+
"language": "en",
26+
"score": 0.12345
27+
},
28+
"translations": [
29+
{
30+
"language": "cs",
31+
"sourceCharacters": 15,
32+
"text": "Tohle je test."
33+
}
34+
]
35+
}
36+
]
37+
}
38+
}
39+
}
40+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"title": "Transliterate Text",
3+
"operationId": "Transliterate",
4+
"parameters": {
5+
"X-ClientTraceId": "dzncrimwmvtwjnheh",
6+
"language": "zh-Hans",
7+
"fromScript": "Hans",
8+
"toScript": "Latn",
9+
"api-version": "2025-10-01-preview",
10+
"body": {
11+
"inputs": [
12+
{
13+
"text": "这是个测试。"
14+
}
15+
]
16+
}
17+
},
18+
"responses": {
19+
"200": {
20+
"body": {
21+
"value": [
22+
{
23+
"text": "zhè shì gè cè shì。",
24+
"script": "Latn"
25+
}
26+
]
27+
}
28+
}
29+
}
30+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"title": "Transliterate Text with minimum properties",
3+
"operationId": "Transliterate",
4+
"parameters": {
5+
"language": "zh-Hans",
6+
"fromScript": "Hans",
7+
"toScript": "Latn",
8+
"api-version": "2025-10-01-preview",
9+
"body": {
10+
"inputs": [
11+
{
12+
"text": "这是个测试。"
13+
}
14+
]
15+
}
16+
},
17+
"responses": {
18+
"200": {
19+
"body": {
20+
"value": [
21+
{
22+
"text": "zhè shì gè cè shì。",
23+
"script": "Latn"
24+
}
25+
]
26+
}
27+
}
28+
}
29+
}

specification/translation/data-plane/TextTranslation/main.tsp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import "@typespec/versioning";
33
import "@azure-tools/typespec-azure-core";
44
import "./routes.tsp";
55

6-
using TypeSpec.Rest;
76
using TypeSpec.Http;
8-
using Azure.Core;
97
using TypeSpec.Versioning;
108

119
#suppress "@azure-tools/typespec-azure-core/auth-required" "!!FIXME!!"
@@ -35,10 +33,6 @@ using TypeSpec.Versioning;
3533
Transliterate. Converts characters or letters of a source language to the corresponding characters or letters of a target language.
3634
3735
Detect. Returns the source code language code and a boolean variable denoting whether the detected language is supported for text translation and transliteration.
38-
39-
Dictionary lookup. Returns equivalent words for the source term in the target language.
40-
41-
Dictionary example Returns grammatical structure and context examples for the source term and target term pair.
4236
""")
4337
@versioned(APIVersion)
4438
namespace TextTranslation;
@@ -47,4 +41,7 @@ namespace TextTranslation;
4741
enum APIVersion {
4842
@doc("Version 3.0")
4943
v3_0: "3.0",
44+
45+
@doc("Version 2025-10-01")
46+
v2025_10_01_preview: "2025-10-01-preview",
5047
}

specification/translation/data-plane/TextTranslation/models-breaksentence.tsp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import "./models-translate.tsp";
55

66
using TypeSpec.Http;
77
using TypeSpec.Rest;
8+
using TypeSpec.Versioning;
89
using Azure.Core;
910

1011
namespace TextTranslation;
1112

1213
@doc("Request parameters for the break sentence API.")
14+
@removed(APIVersion.v2025_10_01_preview)
1315
model BreakSentenceParameters {
1416
...CommonParameters;
1517

@@ -29,6 +31,7 @@ model BreakSentenceParameters {
2931
}
3032

3133
@doc("Response for the Break SEntence API.")
34+
@removed(APIVersion.v2025_10_01_preview)
3235
model BreakSentenceResult {
3336
...CommonResultHeaders;
3437

@@ -38,6 +41,7 @@ model BreakSentenceResult {
3841
}
3942

4043
@doc("Item containing break sentence result.")
44+
@removed(APIVersion.v2025_10_01_preview)
4145
model BreakSentenceItem {
4246
@doc("The detectedLanguage property is only present in the result object when language auto-detection is requested.")
4347
detectedLanguage?: DetectedLanguage;

0 commit comments

Comments
 (0)