microsoft/skills

azure-ai-document-intelligence-ts

用 TypeScript REST SDK 轮询文档分析,并安全读取字段

  • SKILL.md 已保存
  • 中文用法已整理
  • 安装与运行未实测
先判断是否解决你的问题

azure-ai-document-intelligence-ts 是什么?

这个 Skill 面向 TypeScript/Node 工程,通过 REST client 调 Document Intelligence。覆盖 URL 或本地文件分析、预建模型、分页和自定义模型构建。REST client 通过路径函数发请求;长操作需要检查初始响应并轮询。

中文说明由本站依据来源整理;英文原文保留在页面下方。

按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 azure-ai-document-intelligence-ts,然后按本页使用示例提供材料。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 azure-ai-document-intelligence-ts

请在 Codex 的当前工作环境中安装并检查 azure-ai-document-intelligence-ts 这个 Skill。

项目身份:microsoft/skills / azure-ai-document-intelligence-ts
来源:https://github.com/microsoft/skills/blob/f03ec5392f7a0f3aca12af47477e92f1edf7b44c/.github/plugins/azure-sdk-typescript/skills/azure-ai-document-intelligence-ts/SKILL.md
已定位的源文件:.github/plugins/azure-sdk-typescript/skills/azure-ai-document-intelligence-ts/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
准备输入,再按步骤执行

装好以后,具体怎么用?

准备哪些材料

  • 安装 @azure-rest/ai-document-intelligence 与 @azure/identity,配置 endpoint 和可用身份。
  • client 是 DocumentIntelligence(endpoint, credential) 工厂,不用 new。
  • 本地文件转 base64Source;远程 URL 必须能被 Azure 服务访问;构建模型还需训练容器 SAS。

实际使用顺序

  1. 先以 prebuilt-layout 或目标预建模型发起 /documentModels/{modelId}:analyze。
  2. 检查初始响应 isUnexpected;成功后用 getLongRunningPoller 等待完成,读取 analyzeResult。
  3. 提取票据时从 documents[0].fields 读取字段前先判空;列表项和置信度也需按实际数据结构处理。
  4. 仅在必要时使用 /documentModels:build 或 /documentClassifiers:build;构建也是长操作,必须检查响应、轮询并记录新模型ID。
使用示例

从一个具体任务开始

本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。

安装并识别 Skill 后发送

复制一个具体任务

请基于 azure-ai-document-intelligence-ts 为我的 Node 工程写一个分析本地测试PDF版面的示例:文件读取为base64、调用REST路径、isUnexpected校验、pollUntilDone后读取页数表格数。先写代码,不访问Azure。
预期结果

得到本地文件分析流程草案;代码未执行,不存在分析结果。

使用前先看这些限制

使用条件与边界

  • 服务需取得文档内容,上传前确认数据处理和保留要求。
  • 本地文件示例和URL示例请求体不同,不能把base64Source与urlSource互换。
  • 构建或分类器示例修改 Azure 资源,不是只读分析步骤。
针对这个 Skill 的疑问

常见问题

提交成功为什么还没有结果?

分析是长时间运行操作;初始 POST 成功只代表接受任务,应继续通过 poller 等到终态。

客户端对象要用 new 吗?

不需要。此 REST 包导出的是函数,直接传入 endpoint 和 credential 获得客户端。

需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-16T12:36:35.145Z
中文使用说明
已针对下方源文件版本整理用途、用法和常见问题
安装与任务测试
本站未执行安装或任务测试
来源复核
本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料

.github/plugins/azure-sdk-typescript/skills/azure-ai-document-intelligence-ts/SKILL.md · 抓取时间 2026-11-16T12:36:35.145Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

Extract text, tables, and structured data from documents using Azure Document Intelligence (@azure-rest/ai-document-intelligence). Use when processing invoices, receipts, IDs, forms, or building custom document models.

查看源文件章节 / Source sections
  • 原文:Azure Document Intelligence REST SDK for TypeScript
  • 安装 / Installation
  • 原文:Environment Variables
  • 原文:Authentication
  • 原文:DefaultAzureCredential
  • 原文:API Key
  • 原文:Analyze Document (URL)
  • 原文:Analyze Document (Local File)
  • 原文:Prebuilt Models
  • 原文:Extract Invoice Fields
  • 原文:Extract Receipt Fields
  • 原文:List Document Models
  • 原文:Build Custom Model
  • 原文:Build Document Classifier
  • 原文:Classify Document
  • 原文:Get Service Info
  • 原文:Polling Pattern
  • 原文:Key Types
  • 原文:Best Practices
原文:Azure Document Intelligence REST SDK for TypeScript

Extract text, tables, and structured data from documents using prebuilt and custom models.

安装 / Installation

```bash npm install @azure-rest/ai-document-intelligence @azure/identity ```

原文:Environment Variables

```bash DOCUMENT_INTELLIGENCE_ENDPOINT=https://<resource>.cognitiveservices.azure.com DOCUMENT_INTELLIGENCE_API_KEY=<api-key> AZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production ```

原文:Authentication

**Important**: This is a REST client. `DocumentIntelligence` is a **function**, not a class.

原文:DefaultAzureCredential

```typescript import DocumentIntelligence from "@azure-rest/ai-document-intelligence"; import { DefaultAzureCredential, ManagedIdentityCredential } from "@azure/identity"; // Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential> const credential = new DefaultAzureCredential({requiredEnvVars: ["AZURE_TOKEN_CREDENTIALS"]}); // Or use a specific credential directly in production: // See https://learn.microsoft.com/javascript/api/overview/azure/identity-readme?view=azure-node-latest#credential-classes // const credential = new ManagedIdentityCredential(); const client = DocumentIntelligence( process.env.DOCUMENT_INTELLIGENCE_ENDPOINT!, credential ); ```

原文:API Key

```typescript import DocumentIntelligence from "@azure-rest/ai-document-intelligence"; const client = DocumentIntelligence( process.env.DOCUMENT_INTELLIGENCE_ENDPOINT!, { key: process.env.DOCUMENT_INTELLIGENCE_API_KEY! } ); ```

文件 SHA256:170b437bc1a60e84a9258f1f1a0d452ab4faf043c46cc97286bb5ca3939509e7

仓库许可证记录:MIT;skill-declaration-captured-not-interpreted,查看来源。

SKILL.md原文description · 2026-11-16T12:36:35.145Z

Extract text, tables, and structured data from documents using Azure Document Intelligence (@azure-rest/ai-document-intelligence). Use when processing invoices, receipts, IDs, forms, or building custom document models.

查看历史简介来源

历史收录数据

来源仓库microsoft/skills
Skill源路径.github/plugins/azure-sdk-typescript/skills/azure-ai-document-intelligence-ts/SKILL.md

安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源