Skip to content

Commit b7a1cbb

Browse files
committed
Merge branch 'main' of https://github.com/MicrosoftDocs/azure-docs-pr into faqPorts
2 parents 5458aa6 + 6ba0e42 commit b7a1cbb

File tree

891 files changed

+4108
-2778
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

891 files changed

+4108
-2778
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,12 @@ DocumentIntelligenceClient client = new DocumentIntelligenceClient(new Uri(endpo
209209
//sample document
210210
Uri fileUri = new Uri ("https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/sample-layout.pdf");
211211

212-
Operation<AnalyzeResult> operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", fileUri);
212+
AnalyzeDocumentContent content = new AnalyzeDocumentContent()
213+
{
214+
UrlSource= fileUri
215+
};
216+
217+
Operation<AnalyzeResult> operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", content);
213218

214219
AnalyzeResult result = operation.Value;
215220

@@ -641,7 +646,12 @@ DocumentIntelligenceClient client = new DocumentIntelligenceClient(new Uri(endpo
641646
642647
Uri invoiceUri = new Uri ("https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/sample-invoice.pdf");
643648

644-
Operation<AnalyzeResult> operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-invoice", invoiceUri);
649+
AnalyzeDocumentContent content = new AnalyzeDocumentContent()
650+
{
651+
UrlSource = invoiceUri
652+
};
653+
654+
Operation<AnalyzeResult> operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-invoice", content);
645655

646656
AnalyzeResult result = operation.Value;
647657

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

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: laujan
66
manager: nitinme
77
ms.service: azure-ai-document-intelligence
88
ms.topic: include
9-
ms.date: 03/25/2024
9+
ms.date: 05/01/2024
1010
ms.author: lajanuar
1111
---
1212
<!-- markdownlint-disable MD025 -->
@@ -284,18 +284,25 @@ public class DocIntelligence {
284284

285285
public static void main(String[] args) {
286286

287-
// create your `DocumentAnalysisClient` instance and `AzureKeyCredential` variable
287+
// create your `DocumentIntelligenceClient` instance and `AzureKeyCredential` variable
288288
DocumentIntelligenceClient client = new DocumentIntelligenceClientBuilder()
289289
.credential(new AzureKeyCredential(key))
290290
.endpoint(endpoint)
291291
.buildClient();
292292

293293
// sample document
294-
String documentUrl = "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/sample-layout.pdf";
295294
String modelId = "prebuilt-layout";
295+
String documentUrl = "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/sample-layout.pdf";
296296

297-
SyncPoller <AnalyzeResultOperation, AnalyzeResultOperation> analyzeLayoutResultPoller =
298-
client.beginAnalyzeDocument(modelId, documentUrl);
297+
SyncPoller <AnalyzeResultOperation, AnalyzeResultOperation> analyzeLayoutPoller =
298+
client.beginAnalyzeDocument(modelId,
299+
null,
300+
null,
301+
null,
302+
null,
303+
null,
304+
null,
305+
new AnalyzeDocumentRequest().setUrlSource(documentUrl));
299306

300307
AnalyzeResult analyzeLayoutResult = analyzeLayoutPoller.getFinalResult().getAnalyzeResult();
301308

@@ -658,25 +665,27 @@ public class DocIntelligence {
658665

659666
public static void main(String[] args) {
660667

661-
// create your `DocumentAnalysisClient` instance and `AzureKeyCredential` variable
662-
DocumentIntelligenceClient client = new DocumentIntelligenceClientBuilder()
663-
.credential(new AzureKeyCredential(key))
664-
.endpoint(endpoint)
665-
.buildClient();
666-
667668
// sample document
668669
String modelId = "prebuilt-invoice";
669670
String invoiceUrl = "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/sample-invoice.pdf";
670671

671672
public static void main(final String[] args) throws IOException {
673+
672674
// Instantiate a client that will be used to call the service.
673675
DocumentIntelligenceClient client = new DocumentIntelligenceClientBuilder()
674-
.credential(new AzureKeyCredential("{key}"))
675-
.endpoint("https://{endpoint}.cognitiveservices.azure.com/")
676+
.credential(new AzureKeyCredential(key))
677+
.endpoint(endpoint)
676678
.buildClient();
677679

678-
SyncPoller < OperationResult, AnalyzeResult > analyzeLayoutResultPoller =
679-
client.beginAnalyzeDocument(modelId, invoiceUrl);
680+
SyncPoller<AnalyzeResultOperation, AnalyzeResultOperation > analyzeInvoicesPoller =
681+
client.beginAnalyzeDocument(modelId,
682+
null,
683+
null,
684+
null,
685+
null,
686+
null,
687+
null,
688+
new AnalyzeDocumentRequest().setUrlSource(invoiceUrl));
680689

681690
AnalyzeResult analyzeInvoiceResult = analyzeInvoicesPoller.getFinalResult().getAnalyzeResult();
682691

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

Lines changed: 60 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: laujan
66
manager: nitinme
77
ms.service: azure-ai-document-intelligence
88
ms.topic: include
9-
ms.date: 03/25/2024
9+
ms.date: 05/02/2024
1010
ms.author: lajanuar
1111
---
1212
<!-- markdownlint-disable MD025 -->
@@ -146,47 +146,44 @@ Extract text, selection marks, text styles, table structures, and bounding regio
146146
:::moniker range="doc-intel-4.0.0"
147147

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

152151
// set `<your-key>` and `<your-endpoint>` variables with the values from the Azure portal.
153152
const key = "<your-key";
154153
const endpoint = "<your-endpoint>";
155154

156155
// sample document
157-
const formUrl = "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/sample-layout.pdf"
156+
const formUrl = "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/sample-layout.pdf"
158157

159-
async function main() {
160-
const client = DocumentIntelligenceClient(endpoint, new AzureKeyCredential(key));
158+
async function main() {
159+
const client = DocumentIntelligenceClient(endpoint, {key:key},);
161160

162-
const poller = await client.beginAnalyzeDocument("prebuilt-layout", formUrl);
163161

164-
const {
165-
pages,
166-
tables
167-
} = await poller.pollUntilDone();
162+
const initialResponse = await client
163+
.path("/documentModels/{modelId}:analyze", "prebuilt-layout")
164+
.post({
165+
contentType: "application/json",
166+
body: {
167+
urlSource: formUrl
168+
},
169+
});
168170

169-
if (pages.length <= 0) {
170-
console.log("No pages were extracted from the document.");
171-
} else {
172-
console.log("Pages:");
173-
for (const page of pages) {
174-
console.log("- Page", page.pageNumber, `(unit: ${page.unit})`);
175-
console.log(` ${page.width}x${page.height}, angle: ${page.angle}`);
176-
console.log(` ${page.lines.length} lines, ${page.words.length} words`);
177-
}
178-
}
171+
const poller = await getLongRunningPoller(client, initialResponse);
172+
const analyzeResult = (await poller.pollUntilDone()).body.analyzeResult;
179173

180-
if (tables.length <= 0) {
181-
console.log("No tables were extracted from the document.");
182-
} else {
183-
console.log("Tables:");
184-
for (const table of tables) {
185-
console.log(
186-
`- Extracted table: ${table.columnCount} columns, ${table.rowCount} rows (${table.cells.length} cells)`
187-
);
188-
}
174+
const documents = analyzeResult?.documents;
175+
176+
const document = documents && documents[0];
177+
if (!document) {
178+
throw new Error("Expected at least one document in the result.");
189179
}
180+
181+
console.log(
182+
"Extracted document:",
183+
document.docType,
184+
`(confidence: ${document.confidence || "<undefined>"})`,
185+
);
186+
console.log("Fields:", document.fields);
190187
}
191188

192189
main().catch((error) => {
@@ -312,8 +309,7 @@ In this example, we analyze an invoice using the **prebuilt-invoice** model.
312309

313310
```javascript
314311

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

318314
// set `<your-key>` and `<your-endpoint>` variables with the values from the Azure portal.
319315
const key = "<your-key>";
@@ -323,32 +319,44 @@ const { AzureKeyCredential } = require("@azure/core-auth");
323319
invoiceUrl = "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/sample-invoice.pdf"
324320

325321
async function main() {
326-
const client = DocumentIntelligenceClient(endpoint, new AzureKeyCredential(key));
327322

328-
const poller = await client.beginAnalyzeDocument("prebuilt-invoice", invoiceUrl);
329-
if (pages.length <= 0) {
330-
console.log("No pages were extracted from the document.");
331-
} else {
332-
console.log("Pages:");
333-
for (const page of pages) {
334-
console.log("- Page", page.pageNumber, `(unit: ${page.unit})`);
335-
console.log(` ${page.width}x${page.height}, angle: ${page.angle}`);
336-
console.log(` ${page.lines.length} lines, ${page.words.length} words`);
337-
}
338-
}
323+
const client = DocumentIntelligenceClient(endpoint, {key: key},
324+
);
339325

340-
if (tables.length <= 0) {
341-
console.log("No tables were extracted from the document.");
326+
const initialResponse = await client
327+
.path("/documentModels/{modelId}:analyze", "prebuilt-invoice")
328+
.post({
329+
contentType: "application/json",
330+
body: {
331+
// The Document Intelligence service will access the URL to the invoice image and extract data from it
332+
urlSource: invoiceUrl,
333+
},
334+
});
335+
336+
337+
const poller = await getLongRunningPoller(client, initialResponse);
338+
339+
poller.onProgress((state) => console.log("Operation:", state.result, state.status));
340+
const analyzeResult = (await poller.pollUntilDone()).body.analyzeResult;
341+
342+
const documents = analyzeResult?.documents;
343+
344+
const result = documents && documents[0];
345+
if (result) {
346+
console.log(result.fields);
342347
} else {
343-
console.log("Tables:");
344-
for (const table of tables) {
345-
console.log(
346-
`- Extracted table: ${table.columnCount} columns, ${table.rowCount} rows (${table.cells.length} cells)`
347-
);
348-
}
348+
throw new Error("Expected at least one invoice in the result.");
349349
}
350+
351+
console.log(
352+
"Extracted invoice:",
353+
document.docType,
354+
`(confidence: ${document.confidence || "<undefined>"})`,
355+
);
356+
console.log("Fields:", document.fields);
350357
}
351358

359+
352360
main().catch((error) => {
353361
console.error("An error occurred:", error);
354362
process.exit(1);

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: laujan
66
manager: nitinme
77
ms.service: azure-ai-document-intelligence
88
ms.topic: include
9-
ms.date: 03/25/2024
9+
ms.date: 05/01/2024
1010
ms.author: lajanuar
1111
---
1212
<!-- markdownlint-disable MD025 -->
@@ -135,6 +135,7 @@ import os
135135
from azure.core.credentials import AzureKeyCredential
136136
from azure.ai.documentintelligence import DocumentIntelligenceClient
137137
from azure.ai.documentintelligence.models import AnalyzeResult
138+
from azure.ai.documentintelligence.models import AnalyzeDocumentRequest
138139

139140
# set `<your-endpoint>` and `<your-key>` variables with the values from the Azure portal
140141
endpoint = "<your-endpoint>"
@@ -168,12 +169,8 @@ def analyze_layout():
168169
)
169170

170171
poller = document_intelligence_client.begin_analyze_document(
171-
"prebuilt-layout", formUrl
172-
)
173-
174-
analyze_request = AnalyzeDocumentRequest(
175-
url_source=formUrl
176-
)
172+
"prebuilt-layout", AnalyzeDocumentRequest(url_source=formUrl
173+
))
177174

178175
result: AnalyzeResult = poller.result()
179176

@@ -548,6 +545,9 @@ Analyze and extract common fields from specific document types using a prebuilt
548545
import os
549546
from azure.core.credentials import AzureKeyCredential
550547
from azure.ai.documentintelligence import DocumentIntelligenceClient
548+
from azure.ai.documentintelligence.models import AnalyzeResult
549+
from azure.ai.documentintelligence.models import AnalyzeDocumentRequest
550+
551551

552552

553553
# set `<your-endpoint>` and `<your-key>` variables with the values from the Azure portal
@@ -564,7 +564,7 @@ def analyze_invoice():
564564
)
565565

566566
poller = document_intelligence_client.begin_analyze_document(
567-
"prebuilt-invoice", invoiceUrl
567+
"prebuilt-invoice", AnalyzeDocumentRequest(url_source=invoiceUrl
568568
)
569569
invoices = poller.result()
570570

articles/ai-services/openai/api-version-deprecation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: cognitive-services
55
manager: nitinme
66
ms.service: azure-ai-openai
77
ms.topic: conceptual
8-
ms.date: 03/28/2024
8+
ms.date: 05/02/2024
99
author: mrbullwinkle
1010
ms.author: mbullwin
1111
recommendations: false
@@ -14,14 +14,14 @@ ms.custom:
1414

1515
# Azure OpenAI API preview lifecycle
1616

17-
This article is to help you understand the support lifecycle for the Azure OpenAI API previews. New preview APIs target a monthly release cadence. After July 1, 2024, the latest three preview APIs will remain supported while older APIs will no longer be supported unless support is explictly indicated.
17+
This article is to help you understand the support lifecycle for the Azure OpenAI API previews. New preview APIs target a monthly release cadence. After July 1, 2024, the latest three preview APIs will remain supported while older APIs will no longer be supported unless support is explicitly indicated.
1818

1919
> [!NOTE]
2020
> The `2023-06-01-preview` API will remain supported at this time, as `DALL-E 2` is only available in this API version. `DALL-E 3` is supported in the latest API releases. The `2023-10-01-preview` API will also remain supported at this time.
2121
2222
## Latest preview API release
2323

24-
Azure OpenAI API version [2024-03-01-preview](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-03-01-preview/inference.json)
24+
Azure OpenAI API version [2024-04-01-preview](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-04-01-preview/inference.json)
2525
is currently the latest preview release.
2626

2727
This version contains support for all the latest Azure OpenAI features including:

articles/ai-services/openai/concepts/model-retirements.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ titleSuffix: Azure OpenAI
44
description: Learn about the model deprecations and retirements in Azure OpenAI.
55
ms.service: azure-ai-openai
66
ms.topic: conceptual
7-
ms.date: 04/24/2024
7+
ms.date: 05/01/2024
88
ms.custom:
99
manager: nitinme
1010
author: mrbullwinkle
@@ -66,15 +66,17 @@ These models are currently available for use in Azure OpenAI Service.
6666
| `gpt-35-turbo` | 0125 | No earlier than Feb 22, 2025 |
6767
| `gpt-4`<br>`gpt-4-32k` | 0314 | No earlier than July 13, 2024 |
6868
| `gpt-4`<br>`gpt-4-32k` | 0613 | No earlier than Sep 30, 2024 |
69-
| `gpt-4` | 1106-preview | To be upgraded to a stable version with date to be announced |
70-
| `gpt-4` | 0125-preview | To be upgraded to a stable version with date to be announced |
71-
| `gpt-4` | vision-preview | To be upgraded to a stable version with date to be announced |
69+
| `gpt-4` | 1106-preview | To be upgraded to `gpt-4` Version: `turbo-2024-04-09`, starting on June 10, 2024, or later **<sup>1</sup>** |
70+
| `gpt-4` | 0125-preview |To be upgraded to `gpt-4` Version: `turbo-2024-04-09`, starting on June 10, 2024, or later **<sup>1</sup>** |
71+
| `gpt-4` | vision-preview | To be upgraded to `gpt-4` Version: `turbo-2024-04-09`, starting on June 10, 2024, or later **<sup>1</sup>** |
7272
| `gpt-3.5-turbo-instruct` | 0914 | No earlier than Sep 14, 2025 |
7373
| `text-embedding-ada-002` | 2 | No earlier than April 3, 2025 |
7474
| `text-embedding-ada-002` | 1 | No earlier than April 3, 2025 |
7575
| `text-embedding-3-small` | | No earlier than Feb 2, 2025 |
7676
| `text-embedding-3-large` | | No earlier than Feb 2, 2025 |
7777

78+
**<sup>1</sup>** We will notify all customers with these preview deployments at least two weeks before the start of the upgrades. We will publish an upgrade schedule detailing the order of regions and model versions that we will follow during the upgrades, and link to that schedule from here.
79+
7880

7981
## Deprecated models
8082

0 commit comments

Comments
 (0)