Skip to content

Commit cb800cd

Browse files
committed
update code
1 parent f79a71d commit cb800cd

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

articles/ai-services/document-intelligence/how-to-guides/includes/v4-0/javascript-sdk.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: laujan
55
manager: nitinme
66
ms.service: azure-ai-document-intelligence
77
ms.topic: include
8-
ms.date: 03/28/2024
8+
ms.date: 04/16/2024
99
ms.author: lajanuar
1010
ms.custom:
1111
- devx-track-csharp
@@ -106,7 +106,8 @@ Open the `index.js` file in Visual Studio Code or your favorite IDE and select o
106106
## Use the Read model
107107

108108
```javascript
109-
const { AzureKeyCredential, DocumentIntelligence } = require("@azure-rest/ai-document-intelligence");
109+
const { DocumentIntelligenceClient } = require("@azure-rest/ai-document-intelligence");
110+
const { AzureKeyCredential } = require("@azure/core-auth");
110111

111112
//use your `key` and `endpoint` environment variables
112113
const key = process.env['DI_KEY'];
@@ -202,7 +203,8 @@ Visit the Azure samples repository on GitHub and view the [`read` model output](
202203
## Use the Layout model
203204

204205
```javascript
205-
const { AzureKeyCredential, DocumentIntelligence } = require("@azure-rest/ai-document-intelligence");
206+
const { DocumentIntelligenceClient } = require("@azure-rest/ai-document-intelligence");
207+
const { AzureKeyCredential } = require("@azure/core-auth");
206208

207209
//use your `key` and `endpoint` environment variables
208210
const key = process.env['DI_KEY'];
@@ -272,7 +274,8 @@ Visit the Azure samples repository on GitHub and view the [layout model output](
272274
## Use the General document model
273275

274276
```javascript
275-
const { AzureKeyCredential, DocumentIntelligence } = require("@azure-rest/ai-document-intelligence");
277+
const { DocumentIntelligenceClient } = require("@azure-rest/ai-document-intelligence");
278+
const { AzureKeyCredential } = require("@azure/core-auth");
276279

277280
//use your `key` and `endpoint` environment variables
278281
const key = process.env['DI_KEY'];
@@ -318,7 +321,8 @@ Visit the Azure samples repository on GitHub and view the [general document mode
318321
## Use the W-2 tax model
319322

320323
```javascript
321-
const { AzureKeyCredential, DocumentIntelligence } = require("@azure-rest/ai-document-intelligence");
324+
const { DocumentIntelligenceClient } = require("@azure-rest/ai-document-intelligence");
325+
const { AzureKeyCredential } = require("@azure/core-auth");
322326

323327
//use your `key` and `endpoint` environment variables
324328
const key = process.env['DI_KEY'];
@@ -397,7 +401,8 @@ Visit the Azure samples repository on GitHub and view the [W-2 tax model output]
397401
## Use the Invoice model
398402

399403
```javascript
400-
const { AzureKeyCredential, DocumentIntelligence } = require("@azure-rest/ai-document-intelligence");
404+
const { DocumentIntelligenceClient } = require("@azure-rest/ai-document-intelligence");
405+
const { AzureKeyCredential } = require("@azure/core-auth");
401406

402407
//use your `key` and `endpoint` environment variables
403408
const key = process.env['DI_KEY'];
@@ -459,7 +464,8 @@ Visit the Azure samples repository on GitHub and view the [invoice model output]
459464
## Use the Receipt model
460465
461466
```javascript
462-
const { AzureKeyCredential, DocumentIntelligence } = require("@azure-rest/ai-document-intelligence");
467+
const { DocumentIntelligenceClient } = require("@azure-rest/ai-document-intelligence");
468+
const { AzureKeyCredential } = require("@azure/core-auth");
463469

464470
//use your `key` and `endpoint` environment variables
465471
const key = process.env['DI_KEY'];
@@ -518,7 +524,8 @@ Visit the Azure samples repository on GitHub and view the [receipt model output]
518524
## Use the ID document model
519525
520526
```javascript
521-
const { AzureKeyCredential, DocumentIntelligence } = require("@azure-rest/ai-document-intelligence");
527+
const { DocumentIntelligenceClient } = require("@azure-rest/ai-document-intelligence");
528+
const { AzureKeyCredential } = require("@azure/core-auth");
522529

523530
//use your `key` and `endpoint` environment variables
524531
const key = process.env['DI_KEY'];

articles/ai-services/document-intelligence/quickstarts/includes/javascript-sdk.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ In this quickstart, use the following features to analyze and extract data and v
7373
4. Install the `ai-document-intelligence` client library and `azure/identity` npm packages:
7474

7575
```console
76-
npm i @azure-rest/[email protected]
76+
npm i @azure-rest/[email protected] @azure/identity
7777

7878
```
7979

@@ -146,10 +146,11 @@ Extract text, selection marks, text styles, table structures, and bounding regio
146146
:::moniker range="doc-intel-4.0.0"
147147

148148
```javascript
149-
const { AzureKeyCredential, DocumentIntelligenceClient } = require("@azure-rest/ai-document-intelligence");
149+
const { DocumentIntelligenceClient } = require("@azure-rest/ai-document-intelligence");
150+
const { AzureKeyCredential } = require("@azure/core-auth");
150151

151152
// set `<your-key>` and `<your-endpoint>` variables with the values from the Azure portal.
152-
const key = "<your-key>";
153+
const key = "<your-key";
153154
const endpoint = "<your-endpoint>";
154155

155156
// sample document
@@ -311,7 +312,8 @@ In this example, we analyze an invoice using the **prebuilt-invoice** model.
311312

312313
```javascript
313314

314-
const { AzureKeyCredential, DocumentIntelligenceClient } = require("@azure-rest/ai-document-intelligence");
315+
const { DocumentIntelligenceClient } = require("@azure-rest/ai-document-intelligence");
316+
const { AzureKeyCredential } = require("@azure/core-auth");
315317

316318
// set `<your-key>` and `<your-endpoint>` variables with the values from the Azure portal.
317319
const key = "<your-key>";

0 commit comments

Comments
 (0)