Setting the file. One moment.
Subchapter 3.6
references/sdk/azure-ai-document-intelligence-ts.mdMarkdown2 KBView on GitHub
Condensed from azure-ai-document-intelligence-ts. Full patterns (custom models, classifiers, batch polling) in the plugin skill if installed.
npm install @azure-rest/ai-document-intelligence @azure/identityAuth:
DefaultAzureCredentialis for local development. See auth-best-practices.md for production patterns.
import DocumentIntelligence, { isUnexpected, getLongRunningPoller, AnalyzeOperationOutput } from "@azure-rest/ai-document-intelligence";
const client = DocumentIntelligence(endpoint, new DefaultAzureCredential());DocumentIntelligence is a function, not a classclient.path("/documentModels/{modelId}:analyze", "prebuilt-layout").post({...})getLongRunningPoller(client, initialResponse) then poller.pollUntilDone()base64Source in body, not as binary streamimport { paginate } from "@azure-rest/ai-document-intelligence"getLongRunningPoller() — document analysis is async, always pollisUnexpected() — type guard for proper error handlingpaginate() helper for listing models