[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71S3KRQ9FZ1SATV3GEXEPX7":3,"skill-same:01M71S3KRQ9FZ1SATV3GEXEPX7":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":49,"install":50,"resources":63},"01M71S3KRQ9FZ1SATV3GEXEPX7","use-document-intelligence",null,"How to OCR a document via Azure AI Document Intelligence — when to use which prebuilt model, how to call ocr_extract, how to interpret confidence scores, error handling.","arturcrmbot\u002Fzava-control-plane","arturcrmbot","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F156445312?v=4","01M71R9QBEJ4ZSX5AXBGBYH82C","Artur Zielinski","01M71R9QCJSV19ESCAF5773TWH",1,"MIT","https:\u002F\u002Fgithub.com\u002Farturcrmbot\u002Fzava-control-plane\u002Fblob\u002Fmain\u002Fapi\u002Fserver\u002Fskills\u002Fuse-document-intelligence\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],"use document intelligence","use","document","intelligence","call","when","when to use","which","error","via","how to","azure ai","extract","model","how","ocr","error handling","azure","2026-11-10 13:02:02",false,"---\nname: use-document-intelligence\ndescription: How to OCR a document via Azure AI Document Intelligence — when to use which prebuilt model, how to call ocr_extract, how to interpret confidence scores, error handling.\nallowed-tools: ocr_extract\n---\n\nYou use Azure AI Document Intelligence (DI) for OCR + structured extraction of any document — receipts, CVs, invoices, IDs. DI runs in the cloud; one call returns structured fields with per-field confidence scores, plus tables, key-value pairs, and full text lines. Always call DI **before** reasoning over a document with vision: the structured output anchors your verdict and the confidence scores carry through to the audit trail.\n\n## Models\n\n| Model | Use for | Returns |\n|---|---|---|\n| `prebuilt-receipt` | Expense receipt PNGs\u002FJPGs | `documents[].fields.merchantName`, `total`, `transactionDate`, `items[]` |\n| `prebuilt-layout` | CVs, generic forms, anything with structure | `tables[]`, `keyValuePairs[]`, `pages[].lines` (reading order) |\n| `prebuilt-invoice` | Vendor invoices | `vendorName`, `invoiceTotal`, `lineItems`, customer fields |\n| `prebuilt-document` | Unknown structure \u002F fallback | Generic key-value pairs and tables |\n| `prebuilt-idDocument` | Passports, visas, driver licences | `firstName`, `lastName`, `dateOfBirth`, `documentNumber`, `expirationDate` |\n\n**Decision tree:**\n- Receipt-type document → `prebuilt-receipt`.\n- CV \u002F résumé \u002F form-like document → `prebuilt-layout`.\n- Vendor invoice → `prebuilt-invoice`.\n- Right-to-work proof, passport, visa → `prebuilt-idDocument`.\n- Anything else → `prebuilt-document`.\n\n## How to call\n\n```\nocr_extract(document_id=\"CLM-0042\", model=\"prebuilt-receipt\")\n→\n{\n  \"model\": \"prebuilt-receipt\",\n  \"documents\": [{\"fields\": {\n      \"merchantName\": {\"value\": \"Côte Brasserie\", \"confidence\": 0.99},\n      \"total\": {\"value\": 33.81, \"confidence\": 0.97},\n      \"transactionDate\": {\"value\": \"2026-04-01\", \"confidence\": 0.95},\n      \"items\": [...]\n  }}],\n  \"tables\": [...],\n  \"keyValuePairs\": [...],\n  \"pages\": [{\"pageNumber\": 1, \"lines\": [\"Côte Brasserie\", \"Steak frites 22.00\", ...]}],\n  \"cached\": false\n}\n```\n\n`document_id` is a domain identifier — `CLM-*` for expense claims, `C-*` for hiring candidates. The tool resolves to the local file. Don't pass paths.\n\n## Reading the response\n\n- `documents[].fields` is the structured extraction. Each field is `{value, confidence}`. Confidence is 0.0-1.0.\n- `tables[]` is rendered tables (rowCount, columnCount, cells with row\u002Fcolumn index).\n- `keyValuePairs[]` is \"Label: Value\" extractions (e.g. \"Email: alice@x.com\").\n- `pages[].lines` is the full text in reading order — use as a fallback when structured fields are missing.\n\n**Confidence policy:**\n- ≥0.9 → trustworthy, cite directly.\n- 0.7-0.9 → cite but flag as uncertain in your evidence.\n- \u003C0.7 → escalate (treat as unknown, fall back to vision attachment, or return inconclusive).\n\n## Worked example A — receipt validation\n\nYou're given `claim_id=\"CLM-0042\"`. First call:\n\n```\nocr_extract(document_id=\"CLM-0042\", model=\"prebuilt-receipt\")\n```\n\nFrom the response, extract `merchantName.value`, `total.value`, `transactionDate.value`, plus their confidences. Compare against the structured claim record (loaded via `claim_get_structured`). Cite the specific values and confidences in your evidence sentence:\n\n> \"Document Intelligence reads merchantName='NOT-Côte Brasserie' (conf 0.94); claim asserts vendor='Côte Brasserie'. Mismatch → flavour=wrong-vendor.\"\n\n## Worked example B — CV crystallisation\n\nYou're given `candidate_id=\"C-SE-USA-00\"`. First call:\n\n```\nocr_extract(document_id=\"C-SE-USA-00\", model=\"prebuilt-layout\")\n```\n\nMap the response to the canonical profile schema:\n- Work history → look in `tables[]` first (often rendered as a table); fall back to `pages[].lines` if rendered as prose.\n- Education → same — usually a table or a \"Education\" section in `pages[].lines`.\n- Skills → typically a comma-separated list under a \"Skills\" heading in `pages[].lines`, or a `keyValuePairs[]` entry with key `\"Skills\"`.\n- Contact info → `keyValuePairs[]` with keys like `\"Email\"`, `\"Phone\"`, `\"LinkedIn\"`.\n\n## When NOT to use\n\nThe tool caches by sha256 of the document bytes plus model id, so repeat calls with the same id+model return cached results for free. But don't loop on the tool — call once at the start of your skill, store the structured fields in your working memory, refer to them throughout.\n\n## Error handling\n\nA `failure` result_type with error `\"AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT is not configured\"` → environment is broken; you cannot recover. Return your skill's best-effort verdict citing this in evidence.\n\nA `failure` with error containing `\"document not found\"` → the upstream pipeline failed to put the file in place. For receipts, fall through to the existing `missing-receipt` flavour. For CVs, return your skill's \"missing input\" output with confidence 0.\n\nA `failure` with another error (timeout, 5xx) → fall back to vision-only validation. The image is also attached to your session; describe what you can see directly and lower your confidence accordingly.\n\n## Cost note\n\nEach call is a real Azure billing event ($0.0015 per receipt, $0.0015 per CV page). Cache cuts repeats. Don't loop.\n","You use Azure AI Document Intelligence (DI) for OCR + structured extraction of any document — receipts, CVs, invoices, IDs. DI runs in the cloud; one call returns structured fields with per-field confidence scores, plus tables, key-value pairs, and full text lines. Always call DI **before** reasoning over a document with vision: the structured output anchors your verdict and the confidence scores carry through to the audit trail.\n\n## Models\n\n| Model | Use for | Returns |\n|---|---|---|\n| `prebuilt-receipt` | Expense receipt PNGs\u002FJPGs | `documents[].fields.merchantName`, `total`, `transactionDate`, `items[]` |\n| `prebuilt-layout` | CVs, generic forms, anything with structure | `tables[]`, `keyValuePairs[]`, `pages[].lines` (reading order) |\n| `prebuilt-invoice` | Vendor invoices | `vendorName`, `invoiceTotal`, `lineItems`, customer fields |\n| `prebuilt-document` | Unknown structure \u002F fallback | Generic key-value pairs and tables |\n| `prebuilt-idDocument` | Passports, visas, driver licences | `firstName`, `lastName`, `dateOfBirth`, `documentNumber`, `expirationDate` |\n\n**Decision tree:**\n- Receipt-type document → `prebuilt-receipt`.\n- CV \u002F résumé \u002F form-like document → `prebuilt-layout`.\n- Vendor invoice → `prebuilt-invoice`.\n- Right-to-work proof, passport, visa → `prebuilt-idDocument`.\n- Anything else → `prebuilt-document`.\n\n## How to call\n\n```\nocr_extract(document_id=\"CLM-0042\", model=\"prebuilt-receipt\")\n→\n{\n  \"model\": \"prebuilt-receipt\",\n  \"documents\": [{\"fields\": {\n      \"merchantName\": {\"value\": \"Côte Brasserie\", \"confidence\": 0.99},\n      \"total\": {\"value\": 33.81, \"confidence\": 0.97},\n      \"transactionDate\": {\"value\": \"2026-04-01\", \"confidence\": 0.95},\n      \"items\": [...]\n  }}],\n  \"tables\": [...],\n  \"keyValuePairs\": [...],\n  \"pages\": [{\"pageNumber\": 1, \"lines\": [\"Côte Brasserie\", \"Steak frites 22.00\", ...]}],\n  \"cached\": false\n}\n```\n\n`document_id` is a domain identifier — `CLM-*` for expense claims, `C-*` for hiring candidates. The tool resolves to the local file. Don't pass paths.\n\n## Reading the response\n\n- `documents[].fields` is the structured extraction. Each field is `{value, confidence}`. Confidence is 0.0-1.0.\n- `tables[]` is rendered tables (rowCount, columnCount, cells with row\u002Fcolumn index).\n- `keyValuePairs[]` is \"Label: Value\" extractions (e.g. \"Email: alice@x.com\").\n- `pages[].lines` is the full text in reading order — use as a fallback when structured fields are missing.\n\n**Confidence policy:**\n- ≥0.9 → trustworthy, cite directly.\n- 0.7-0.9 → cite but flag as uncertain in your evidence.\n- \u003C0.7 → escalate (treat as unknown, fall back to vision attachment, or return inconclusive).\n\n## Worked example A — receipt validation\n\nYou're given `claim_id=\"CLM-0042\"`. First call:\n\n```\nocr_extract(document_id=\"CLM-0042\", model=\"prebuilt-receipt\")\n```\n\nFrom the response, extract `merchantName.value`, `total.value`, `transactionDate.value`, plus their confidences. Compare against the structured claim record (loaded via `claim_get_structured`). Cite the specific values and confidences in your evidence sentence:\n\n> \"Document Intelligence reads merchantName='NOT-Côte Brasserie' (conf 0.94); claim asserts vendor='Côte Brasserie'. Mismatch → flavour=wrong-vendor.\"\n\n## Worked example B — CV crystallisation\n\nYou're given `candidate_id=\"C-SE-USA-00\"`. First call:\n\n```\nocr_extract(document_id=\"C-SE-USA-00\", model=\"prebuilt-layout\")\n```\n\nMap the response to the canonical profile schema:\n- Work history → look in `tables[]` first (often rendered as a table); fall back to `pages[].lines` if rendered as prose.\n- Education → same — usually a table or a \"Education\" section in `pages[].lines`.\n- Skills → typically a comma-separated list under a \"Skills\" heading in `pages[].lines`, or a `keyValuePairs[]` entry with key `\"Skills\"`.\n- Contact info → `keyValuePairs[]` with keys like `\"Email\"`, `\"Phone\"`, `\"LinkedIn\"`.\n\n## When NOT to use\n\nThe tool caches by sha256 of the document bytes plus model id, so repeat calls with the same id+model return cached results for free. But don't loop on the tool — call once at the start of your skill, store the structured fields in your working memory, refer to them throughout.\n\n## Error handling\n\nA `failure` result_type with error `\"AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT is not configured\"` → environment is broken; you cannot recover. Return your skill's best-effort verdict citing this in evidence.\n\nA `failure` with error containing `\"document not found\"` → the upstream pipeline failed to put the file in place. For receipts, fall through to the existing `missing-receipt` flavour. For CVs, return your skill's \"missing input\" output with confidence 0.\n\nA `failure` with another error (timeout, 5xx) → fall back to vision-only validation. The image is also attached to your session; describe what you can see directly and lower your confidence accordingly.\n\n## Cost note\n\nEach call is a real Azure billing event ($0.0015 per receipt, $0.0015 per CV page). Cache cuts repeats. Don't loop.\n",{"name":5,"description":7,"allowed-tools":42},"ocr_extract","main","db273d7d646605c0bf0175dc9c8057b9ad2628b5","api\u002Fserver\u002Fskills\u002Fuse-document-intelligence",2,"https:\u002F\u002Fgithub.com\u002Farturcrmbot\u002Fzava-control-plane","https:\u002F\u002Fgithub.com\u002Farturcrmbot","2026-09-28 17:47:06",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add arturcrmbot\u002Fzava-control-plane --skill use-document-intelligence",{"tool":56,"command":57},"bunx","bunx skills add arturcrmbot\u002Fzava-control-plane --skill use-document-intelligence",{"tool":59,"command":60},"pnpm","pnpm dlx skills add arturcrmbot\u002Fzava-control-plane --skill use-document-intelligence","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Farturcrmbot\u002Fzava-control-plane\u002Fblob\u002Fmain\u002Fapi\u002Fserver\u002Fskills\u002Fuse-document-intelligence\u002FSKILL.md",true,[],[65,86,102,116,124,131],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":37},"01M71SJECD4KXSSJV1B0HSY4T4","proactive-customer-care","Proactively notifies and, where warranted, extends a small bounded goodwill gesture to a customer whose itinerary materially changed.","https:\u002F\u002Fgithub.com\u002Farturcrmbot\u002Fzava-control-plane\u002Fblob\u002Fmain\u002Fverticals\u002Ftravel\u002Fskills\u002Fproactive-customer-care\u002FSKILL.md",[],[72,73,74,75,76,77,78,79,80,81,82,83,84,85],"proactive","customer","proactive customer care","customer care","gesture","action","bounded","status","check","booking","operations","travel","issue","itinerary",{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":37},"01M71SJ9VHGNNTB6452H1KRZD6","payment-exception","Resolves a failed balance payment by retrying it to complete the booking, or releasing the booking's inventory when retry is not viable.","https:\u002F\u002Fgithub.com\u002Farturcrmbot\u002Fzava-control-plane\u002Fblob\u002Fmain\u002Fverticals\u002Ftravel\u002Fskills\u002Fpayment-exception\u002FSKILL.md",[],[93,94,95,96,97,81,24,98,99,79,100,101,80,82,83],"payment","payment exception","it","retry","balance","release","complete","capacity","inventory",{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":37},"01M71SJ6S6XREB0J6CCVCSFZ9E","hotel-supplier-recovery","Restores accommodation for a shortfall-hit hotel allotment by moving contracted rooms from a donor allotment with headroom, resolving the reported supplier shortfall.","https:\u002F\u002Fgithub.com\u002Farturcrmbot\u002Fzava-control-plane\u002Fblob\u002Fmain\u002Fverticals\u002Ftravel\u002Fskills\u002Fhotel-supplier-recovery\u002FSKILL.md",[],[109,110,111,112,80,82,83,113,114,115],"hotel supplier recovery","hotel","recovery","with","move","for","headroom",{"skillNo":117,"name":118,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":37},"01M71SJ4G5MPM50WZ6F66M3PNS","holiday-sales-booking","https:\u002F\u002Fgithub.com\u002Farturcrmbot\u002Fzava-control-plane\u002Fblob\u002Fmain\u002Fverticals\u002Ftravel\u002Fskills\u002Fholiday-sales-booking\u002FSKILL.md",[],[122,81,123],"holiday sales booking","sales",{"skillNo":125,"name":126,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":37},"01M71SJ2AHHWN2C4YV2RKEE947","flight-disruption-recovery","https:\u002F\u002Fgithub.com\u002Farturcrmbot\u002Fzava-control-plane\u002Fblob\u002Fmain\u002Fverticals\u002Ftravel\u002Fskills\u002Fflight-disruption-recovery\u002FSKILL.md",[],[130,111],"flight disruption recovery",{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":37},"01M71SHYPK8HNQ80C9XAWSER53","destination-operations","Dispatches a replacement resort transfer when an arrival is at risk, rebinding any travellers on the at-risk transfer to the replacement.","https:\u002F\u002Fgithub.com\u002Farturcrmbot\u002Fzava-control-plane\u002Fblob\u002Fmain\u002Fverticals\u002Ftravel\u002Fskills\u002Fdestination-operations\u002FSKILL.md",[],[138,82,139,140,80,141,83,142,24,143],"destination operations","destination","risk","dispatch","at","transfer"]