Setting the file. One moment.
Subchapter 3.10
references/sdk/azure-ai-translation-ts.mdMarkdown1 KBView on GitHub
Condensed from azure-ai-translation-ts. Full patterns (document translation, batch SAS, transliterate) in the azure-ai-translation-ts plugin skill if installed.
npm install @azure-rest/ai-translation-text @azure/identityimport TextTranslationClient, { TranslatorCredential, isUnexpected } from "@azure-rest/ai-translation-text";
const credential: TranslatorCredential = { key: process.env.TRANSLATOR_SUBSCRIPTION_KEY!, region: process.env.TRANSLATOR_REGION! };
const client = TextTranslationClient(process.env.TRANSLATOR_ENDPOINT!, credential);TextTranslationClient is a function, not a classclient.path("/translate").post({ body: { inputs: [...] } })@azure-rest/ai-translation-documentlanguage parameter to auto-detectisUnexpected(response) before accessing body