Skip to content

Commit f7d5a0b

Browse files
[Document Intelligence] Update changelog to include service changes (Azure#27874)
As requested by La Januari, updating the changelog for `1.0.0-beta.1` version to also convey the service updates and breaking changes as we move from - "2023-07-31" service API version(and older versions) to "2023-10-31-preview" service API version - And from `@azure/ai-form-recognizer` to `@azure-rest/ai-document-intelligence` - And the rebranding --------- Co-authored-by: Paul Hsu <[email protected]>
1 parent cc969de commit f7d5a0b

File tree

7 files changed

+523
-34
lines changed

7 files changed

+523
-34
lines changed

sdk/documentintelligence/ai-document-intelligence-rest/CHANGELOG.md

Lines changed: 97 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,100 @@
1414

1515
### Features Added
1616

17-
This marks the first preview of `@azure-rest/ai-document-intelligence` Rest Level Client Library for the Azure AI Document Intelligence service (formerly known as Form Recognizer).
18-
Please refer to the [Readme](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/documentintelligence/ai-document-intelligence-rest/README.md) and samples for more details.
17+
This marks the first preview of `@azure-rest/ai-document-intelligence` Rest Level Client Library for the Azure AI Document Intelligence service (formerly known as Form Recognizer), targeting service API version `"2023-10-31-preview"`.
18+
19+
_**Note: Form Recognizer has been rebranded to Document Intelligence.**_
20+
21+
- Updates all REST API operation paths from `{endpoint}/formrecognizer` to `{endpoint}/documentintelligence`. SDK would handle this change automatically, users would not have to do additional work to support this.
22+
- `@azure-rest/ai-document-intelligence` is the new package, replacing `@azure/ai-form-recognizer` package. The new package supports a Rest Level Client, which is part of the new generation of Azure SDKs to simplify the development experience. The new package is not compatible with the previous `@azure/ai-form-recognizer` package without necessary changes to your code.
23+
- **Breaking Changes (with the `@azure/ai-form-recognizer` SDK)** - API shapes have been designed from scratch to support the new Rest Level Client for the Document Intelligence service. Please refer to the [Readme](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/documentintelligence/ai-document-intelligence-rest/README.md) and [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/documentintelligence/ai-document-intelligence-rest/samples) for more understanding.
24+
25+
### `"2023-10-31-preview"` Service API version
26+
27+
The new `"2023-10-31-preview"` service version comes with some new features and a few breaking changes when compared to the API versions supported by the `@azure/ai-form-recognizer` library.
28+
29+
**New Features**
30+
31+
- **Markdown content format**
32+
33+
Supports output with Markdown content format along with the default plain _text_. For now, this is only supported for "prebuilt-layout". Markdown content format is deemed a more friendly format for LLM consumption in a chat or automation use scenario.
34+
35+
Service follows the GFM spec ([GitHub Flavored Markdown](https://github.github.com/gfm/)) for the Markdown format. Also introduces a new _contentFormat_ property with value "text" or "markdown" to indicate the result content format.
36+
37+
```ts
38+
import DocumentIntelligence from "@azure-rest/ai-document-intelligence";
39+
const client = DocumentIntelligence(process.env["DOCUMENT_INTELLIGENCE_ENDPOINT"], {
40+
key: process.env["DOCUMENT_INTELLIGENCE_API_KEY"],
41+
});
42+
43+
const initialResponse = await client
44+
.path("/documentModels/{modelId}:analyze", "prebuilt-layout")
45+
.post({
46+
contentType: "application/json",
47+
body: {
48+
urlSource:
49+
"https://raw.githubusercontent.com/Azure/azure-sdk-for-js/6704eff082aaaf2d97c1371a28461f512f8d748a/sdk/formrecognizer/ai-form-recognizer/assets/forms/Invoice_1.pdf",
50+
},
51+
queryParameters: { outputContentFormat: "markdown" }, // <-- new query parameter
52+
});
53+
```
54+
55+
- **Query Fields**
56+
57+
When this feature flag is specified, the service will further extract the values of the fields specified via the queryFields query parameter to supplement any existing fields defined by the model as fallback.
58+
59+
```ts
60+
await client.path("/documentModels/{modelId}:analyze", "prebuilt-layout").post({
61+
contentType: "application/json",
62+
body: { urlSource: "..." },
63+
queryParameters: {
64+
features: ["queryFields"],
65+
queryFields: ["NumberOfGuests", "StoreNumber"],
66+
}, // <-- new query parameter
67+
});
68+
```
69+
70+
- **Split Options**
71+
72+
In the previous API versions supported by the older `@azure/ai-form-recognizer` library, document splitting and classification operation (`"/documentClassifiers/{classifierId}:analyze"`) always tried to split the input file into multiple documents.
73+
74+
To enable a wider set of scenarios, service introduces a "split" query parameter with the new "2023-10-31-preview" service version. The following values are supported:
75+
76+
- `split: "auto"`
77+
78+
Let service determine where to split.
79+
80+
- `split: "none"`
81+
82+
The entire file is treated as a single document. No splitting is performed.
83+
84+
- `split: "perPage"`
85+
86+
Each page is treated as a separate document. Each empty page is kept as its own document.
87+
88+
**Breaking Changes**
89+
90+
- **prebuilt-receipt** - Currency related fields have been updated. Currency symbol ("$") and code ("USD") are returned along with the amount as shown below.
91+
92+
```json
93+
{
94+
"content": "$123.45",
95+
"confidence": 0.995,
96+
"type": "currency",
97+
"valueCurrency": {
98+
"amount": 123.45,
99+
"currencySymbol": "$",
100+
"currencyCode": "USD"
101+
},
102+
...
103+
}
104+
```
105+
106+
**Retirements/Deprecations**
107+
108+
- `"prebuilt-businessCard"` model is retired.
109+
- `"prebuilt-document"` model is retired, this model is essentially `"prebuilt-layout"` with `features: ["keyValuePairs"]` specified. _(This is only supported as an optional feature for "prebuilt-layout" and "prebuilt-invoice".)_
110+
111+
If you wish to still use these models, please rely on the older `@azure/ai-form-recognizer` library through the older service API versions.
112+
113+
If you were using the old `@azure/ai-form-recognizer` package, please refer [MIGRATION_GUIDE.MD](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/documentintelligence/ai-document-intelligence-rest/MIGRATION-FR_v4-DI_v1.md) for more details.

0 commit comments

Comments
 (0)