Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Document Intelligence] Release 1.0.0 GA #31746

Merged
merged 66 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 65 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
ea09a11
remove polling step - batch analyze test
HarshaNalluru Nov 7, 2024
2489b60
regenerate
HarshaNalluru Nov 13, 2024
16747cb
lock file
HarshaNalluru Nov 13, 2024
34ec758
api report and fix build
HarshaNalluru Nov 13, 2024
8d43ed3
package.json
HarshaNalluru Nov 13, 2024
9ce8855
Merge branch 'main' of https://github.com/azure/azure-sdk-for-js into…
HarshaNalluru Nov 13, 2024
cb39f84
update readme and lock file
HarshaNalluru Nov 13, 2024
a1a4159
batch analysis sample
HarshaNalluru Nov 13, 2024
44b24cc
regenerate with public repo typespec
HarshaNalluru Nov 14, 2024
de4ddf4
Api report
HarshaNalluru Nov 14, 2024
5288c1e
readme update
HarshaNalluru Nov 14, 2024
d602a3b
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-js into…
HarshaNalluru Dec 13, 2024
aa17951
update tsp-location
HarshaNalluru Dec 13, 2024
fc6a6bf
lock file
HarshaNalluru Dec 13, 2024
bd8b115
package.json
HarshaNalluru Dec 13, 2024
5bd16ca
export parseOperationIdFromResponse
HarshaNalluru Dec 13, 2024
fbd0df6
regen
HarshaNalluru Dec 13, 2024
efc7abe
linter fixes and formatting
HarshaNalluru Dec 13, 2024
d78d08e
lock file
HarshaNalluru Dec 13, 2024
85fdac1
api report
HarshaNalluru Dec 13, 2024
08b4bc8
update tests
HarshaNalluru Dec 13, 2024
d0048e6
fix tests and builds
HarshaNalluru Dec 13, 2024
e6e61a7
format
HarshaNalluru Dec 13, 2024
c2234e5
changelog
HarshaNalluru Dec 13, 2024
8df6fcd
assets
HarshaNalluru Dec 13, 2024
a166087
changelog
HarshaNalluru Dec 13, 2024
cd86bdd
readme update
HarshaNalluru Dec 13, 2024
7aec167
batch example
HarshaNalluru Dec 13, 2024
c25961b
remoe unneeded dependency
HarshaNalluru Dec 13, 2024
9475beb
core-rest-pipeline api report
HarshaNalluru Dec 13, 2024
5be7d3c
Merge branch 'main' of https://github.com/azure/azure-sdk-for-js into…
HarshaNalluru Dec 13, 2024
a9ccc6d
operationId -> resultId
HarshaNalluru Dec 13, 2024
1a47541
Merge branch 'main' of https://github.com/azure/azure-sdk-for-js into…
HarshaNalluru Dec 13, 2024
fae0eee
Merge branch 'main' of https://github.com/azure/azure-sdk-for-js into…
HarshaNalluru Dec 13, 2024
5d32e5e
lock file
HarshaNalluru Dec 13, 2024
f256864
lock file
HarshaNalluru Dec 13, 2024
02ff9bd
api report
HarshaNalluru Dec 13, 2024
157c463
Merge remote-tracking branch 'origin/main' into harshan/proto-batch-a…
deyaaeldeen Dec 14, 2024
019302c
sanitize only when in record mode
deyaaeldeen Dec 14, 2024
1ffca5e
add node specific tests to node folder
deyaaeldeen Dec 14, 2024
b9704a7
fix up import paths
deyaaeldeen Dec 14, 2024
a7c3eea
skip browser tests since there are not any
deyaaeldeen Dec 14, 2024
307cb03
update api extractor config
deyaaeldeen Dec 14, 2024
5eee98f
Merge remote-tracking branch 'origin/main' into harshan/proto-batch-a…
deyaaeldeen Dec 14, 2024
fd3fe1b
configure tshy
deyaaeldeen Dec 14, 2024
8e049d0
bring back the browser tsconfig file
deyaaeldeen Dec 14, 2024
6be5dc4
date
HarshaNalluru Dec 16, 2024
b7b541c
Update sdk/documentintelligence/ai-document-intelligence-rest/CHANGEL…
HarshaNalluru Dec 16, 2024
e59692a
streamToUint8Array example
HarshaNalluru Dec 16, 2024
76fef23
Update sdk/documentintelligence/ai-document-intelligence-rest/CHANGEL…
HarshaNalluru Dec 16, 2024
b3244bf
Update sdk/documentintelligence/ai-document-intelligence-rest/CHANGEL…
HarshaNalluru Dec 16, 2024
b83d419
Update sdk/documentintelligence/ai-document-intelligence-rest/CHANGEL…
HarshaNalluru Dec 16, 2024
06260ca
Update sdk/documentintelligence/ai-document-intelligence-rest/CHANGEL…
HarshaNalluru Dec 16, 2024
9d7ad3a
Update sdk/documentintelligence/ai-document-intelligence-rest/CHANGEL…
HarshaNalluru Dec 16, 2024
ac373fd
Apply suggestions from code review
HarshaNalluru Dec 16, 2024
8fe1eba
changelog and readme updates
HarshaNalluru Dec 16, 2024
15629cd
address poller related feedback - keep only v2 poller and remove the …
HarshaNalluru Dec 16, 2024
787034e
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-js into…
HarshaNalluru Dec 16, 2024
dd555e1
samples update
HarshaNalluru Dec 16, 2024
bac6a39
changelog and readme
HarshaNalluru Dec 16, 2024
70415e6
Merge branch 'harshan/proto-batch-analyze' of https://github.com/Azur…
HarshaNalluru Dec 16, 2024
46bd9dd
reporting api versions
HarshaNalluru Dec 17, 2024
ecfb2ac
Merge branch 'harshan/proto-batch-analyze' of https://github.com/azur…
HarshaNalluru Dec 17, 2024
40d69a6
lock file
HarshaNalluru Dec 17, 2024
068ecbe
Merge branch 'harshan/proto-batch-analyze' of https://github.com/Azur…
HarshaNalluru Dec 17, 2024
29a3bce
link does not exist
HarshaNalluru Dec 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 52 additions & 6 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

119 changes: 103 additions & 16 deletions sdk/documentintelligence/ai-document-intelligence-rest/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,114 @@
# Release History

## 1.0.0 (Unreleased)
## 1.0.0 (2024-12-16)

### Features Added
HarshaNalluru marked this conversation as resolved.
Show resolved Hide resolved

- Exports method `streamToUint8Array` to support converting a `NodeJS.ReadableStream` to a `Uint8Array`. This is necessary to read the pdf and png responses from the results of an analysis.
```js
- Adds `streamToUint8Array`, a convenience function that buffers a `NodeJS.ReadableStream` in a `Uint8Array`. It can be used to read the pdf and png responses from the results of an analysis.

```ts
import DocumentIntelligence from "@azure-rest/ai-document-intelligence";
import { streamToUint8Array } from "@azure-rest/ai-document-intelligence";

const client = DocumentIntelligence("<DOCUMENT_INTELLIGENCE_ENDPOINT>", {
key: "<DOCUMENT_INTELLIGENCE_API_KEY>",
});

// Do analysis on you document and get the resultId, figureId

// Example for the figures api that provides an image output
const output = await client
.path(
"/documentModels/{modelId}/analyzeResults/{resultId}/figures/{figureId}",
"prebuilt-layout",
operationId,
figureId,
)
.get()
.asNodeStream();

if (output.status !== "200" || !output.body) {
throw new Error("The response was unexpected.");
}
const output = await client
.path(
"/documentModels/{modelId}/analyzeResults/{resultId}/figures/{figureId}",
"prebuilt-layout",
resultId,
figureId
)
.get()
.asNodeStream(); // output.body would be NodeJS.ReadableStream

if (output.status !== "200" || !output.body) {
throw new Error("The response was unexpected, expected NodeJS.ReadableStream in the body.");
}
HarshaNalluru marked this conversation as resolved.
Show resolved Hide resolved

const imageData = await streamToUint8Array(output.body);
fs.promises.writeFile(`./figures/${figureId}.png`, imageData); // Or you can consume the NodeJS.ReadableStream directly
```

- Adds `parseResultIdFromResponse`, a convenience function that extracts the `operationId` from the batch analysis response.

```js
// Example
const initialResponse = await client
.path("/documentModels/{modelId}:analyzeBatch", "prebuilt-layout")
.post({
contentType: "application/json",
body: {
azureBlobSource: {
containerUrl: batchTrainingFilesContainerUrl(),
},
resultContainerUrl: batchTrainingFilesResultContainerUrl(),
resultPrefix: "result",
},
});

if (isUnexpected(initialResponse)) {
throw initialResponse.body.error;
}
const batchResultId = parseResultIdFromResponse(initialResponse);

const response = await client
.path(
"/documentModels/{modelId}/analyzeBatchResults/{resultId}",
"prebuilt-layout",
batchResultId
)
.get();
```

- Changes the following interfaces as follows:

- `AnalyzeBatchDocumentsBodyParam`:
- Updates `body` to be required.
- `AnalyzeBatchOperationOutput`:
- Adds `resultId`.
- `AnalyzeDocumentBodyParam`:
- Changes `body` from optional to required.
- `DocumentClassifierDetailsOutput`:
- Adds `modifiedDateTime`.
- `DocumentModelDetailsOutput`:
- Adds `modifiedDateTime`.

- Introduces new interfaces to define query parameters for document analysis requests, allowing customizable `style` and `explode` options:
- **AnalyzeBatchDocumentsFeaturesQueryParam**: Accepts DocumentAnalysisFeature[] values.
- **AnalyzeBatchDocumentsOutputQueryParam**: Accepts AnalyzeOutputOption[] values.
- **AnalyzeBatchDocumentsQueryFieldsQueryParam**: Accepts string[] values.
- **AnalyzeDocumentFeaturesQueryParam**: Accepts DocumentAnalysisFeature[] values.
- **AnalyzeDocumentFromStreamFeaturesQueryParam**: Accepts DocumentAnalysisFeature[] values.

### Breaking Changes

- Removes the `poller.getOperationId()` for a given polling operation. Use `parseResultIdFromResponse` to extract the `operationId` directly.
- `getLongRunningPoller` function is not async anymore, do not `await` on it.

### Other Changes

The following types are renamed

- `CopyAuthorization` to `ModelCopyAuthorization`
- `ErrorResponseOutput` to `DocumentIntelligenceErrorResponseOutput`
- `ErrorModelOutput` to `DocumentIntelligenceErrorOutput`
- `InnerErrorOutput` to `DocumentIntelligenceInnerErrorOutput`
- `WarningOutput` to `DocumentIntelligenceWarningOutput`
- `ContentFormat` to `DocumentContentFormat`
- `ContentFormatOutput` to `DocumentContentFormatOutput`
- `OperationDetailsOutputParent` to `DocumentIntelligenceOperationDetailsOutputParent`
- `OperationDetailsOutput` to `DocumentIntelligenceOperationDetailsOutput`
- `OperationStatusOutput` to `DocumentIntelligenceOperationStatusOutput`
- `ResourceDetailsOutput` to `DocumentIntelligenceResourceDetailsOutput`
- `PagedOperationDetailsOutput` to `PagedDocumentIntelligenceOperationDetailsOutput`
- `GetResourceInfo` to `GetResourceDetails`

## 1.0.0-beta.3 (2024-08-20)

### Features Added
Expand Down
Loading
Loading