@azure/ai-translation-document_1.0.0
1.0.0 (2026-08-01)
This release migrates the package to the @azure/ai-translation-document name and a new client design. It replaces the previous @azure-rest/ai-translation-document REST-level client (RLC) package.
Features Added
- Added support for the
2026-03-01service API version. - Added
deploymentNametoTargetInputandDocumentStatusto support translating with a custom translation model. - Added
deploymentNameparameter to single document translation. - Added support for translating text within images:
translateTextWithinImageon batch and single document translation, and image-scan fields (imageCharacterDetected,imageCharged,totalImageScansSucceeded,totalImageScansFailed) onDocumentStatus.
Breaking Changes
- The package name changed from
@azure-rest/ai-translation-documentto@azure/ai-translation-document. - The REST-level client (RLC) surface (
client.path(...).post(...)) has been replaced with a modeled client surface exposingDocumentTranslationClientandSingleDocumentTranslationClient. See the README for migration examples.
Migration guide
-
Install the new package: replace
@azure-rest/ai-translation-documentwith@azure/ai-translation-document. -
Create the client: the default export factory is replaced by named clients.
- import DocumentTranslator from "@azure-rest/ai-translation-document"; - const client = DocumentTranslator(endpoint, credential); + import { DocumentTranslationClient } from "@azure/ai-translation-document"; + const client = new DocumentTranslationClient(endpoint, credential);
-
Call operations: replace the
path(...).method()pattern with typed methods.- await client.path("/document/batches").post({ body: { inputs } }); + await client.startTranslation({ inputs });
-
Single document translation: use
SingleDocumentTranslationClient.- import DocumentTranslator from "@azure-rest/ai-translation-document"; - const client = DocumentTranslator(endpoint, credential); - await client.path("/document:translate").post({ ... }); + import { SingleDocumentTranslationClient } from "@azure/ai-translation-document"; + const client = new SingleDocumentTranslationClient(endpoint, credential); + await client.translate(targetLanguage, content);
-
Responses: results are returned as typed objects and errors are thrown as
RestError, instead of checkingresponse.statuson a raw HTTP response.