Skip to content

Commit e6c73ac

Browse files
bojunehsuHarshaNallurukinelski
authored andcommitted
Document Intelligence 2023-10-31-preview (#26650)
* Add DocumentIntelligence 2023-10-31-preview as update to FormRecognizer 2023-07-31 * Update cSpell. * Update cSpell. * Update tspconfig.yaml * .NET changes * Revert ".NET changes" This reverts commit 85270d5. * .NET changes * Updated .NET config * Revert "Updated .NET config" This reverts commit c7e9715. --------- Co-authored-by: Harsha Nalluru <[email protected]> Co-authored-by: Caio Saldanha <[email protected]>
1 parent 9fa4227 commit e6c73ac

File tree

60 files changed

+22249
-0
lines changed

Some content is hidden

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

60 files changed

+22249
-0
lines changed

cSpell.json

+14
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,20 @@
884884
"rrggbb"
885885
]
886886
},
887+
{
888+
"filename": "**/specification/ai/data-plane/DocumentIntelligence/**/DocumentIntelligence.json",
889+
"words": [
890+
"documentintelligence",
891+
"heif",
892+
"spreadsheetml",
893+
"presentationml",
894+
"barcodes",
895+
"UPCA",
896+
"UPCE",
897+
"Codabar",
898+
"rrggbb"
899+
]
900+
},
887901
{
888902
"filename": "**/specification/machinelearningservices/data-plane/Microsoft.MachineLearningServices/preview/2019-*/modelManagement.json",
889903
"words": [
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
import "@azure-tools/typespec-client-generator-core";
2+
import "@typespec/rest";
3+
import "@typespec/http";
4+
import "@typespec/versioning";
5+
import "./main.tsp";
6+
7+
using Azure.ClientGenerator.Core;
8+
using DocumentIntelligence;
9+
10+
@TypeSpec.Versioning.useDependency(Azure.Core.Versions.v1_0_Preview_2)
11+
//@TypeSpec.Versioning.useDependency(DocumentIntelligence.Versions.v2023_07_31)
12+
@TypeSpec.Versioning.useDependency(
13+
DocumentIntelligence.Versions.v2023_10_31_preview
14+
)
15+
namespace ClientCustomizations;
16+
17+
@client({
18+
name: "DocumentAnalysisClient",
19+
service: DocumentIntelligence,
20+
})
21+
interface DocumentAnalysisClient {
22+
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
23+
analyzeDocument is DocumentModels.analyzeDocument;
24+
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
25+
classifyDocument is DocumentClassifiers.classifyDocument;
26+
}
27+
28+
@client({
29+
name: "DocumentModelAdministrationClient",
30+
service: DocumentIntelligence,
31+
})
32+
interface DocumentModelAdministrationClient {
33+
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
34+
buildDocumentModel is DocumentModels.buildModel;
35+
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
36+
composeModel is DocumentModels.composeModel;
37+
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
38+
authorizeModelCopy is DocumentModels.authorizeModelCopy;
39+
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
40+
copyModelTo is DocumentModels.copyModelTo;
41+
getModel is DocumentModels.getModel;
42+
listModels is DocumentModels.listModels;
43+
deleteModel is DocumentModels.deleteModel;
44+
45+
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
46+
getResourceInfo is MiscellaneousOperations.getResourceInfo;
47+
getOperation is MiscellaneousOperations.getOperation;
48+
listOperations is MiscellaneousOperations.listOperations;
49+
50+
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
51+
buildClassifier is DocumentClassifiers.buildClassifier;
52+
getClassifier is DocumentClassifiers.getClassifier;
53+
listClassifiers is DocumentClassifiers.listClassifiers;
54+
deleteClassifier is DocumentClassifiers.deleteClassifier;
55+
}
56+
57+
@@usage(DocumentAnalysisFeature, Usage.output, "csharp");
58+
@@usage(LengthUnit, Usage.output, "csharp");
59+
@@usage(DocumentSelectionMarkState, Usage.output, "csharp");
60+
@@usage(DocumentBarcodeKind, Usage.output, "csharp");
61+
@@usage(DocumentFormulaKind, Usage.output, "csharp");
62+
@@usage(ParagraphRole, Usage.output, "csharp");
63+
@@usage(DocumentTableCellKind, Usage.output, "csharp");
64+
@@usage(FontStyle, Usage.output, "csharp");
65+
@@usage(FontWeight, Usage.output, "csharp");
66+
@@usage(DocumentFieldType, Usage.output, "csharp");
67+
@@usage(DocumentSignatureType, Usage.output, "csharp");
68+
@@usage(AnalyzeResult, Usage.output, "csharp");
69+
@@usage(DocumentPage, Usage.output, "csharp");
70+
@@usage(DocumentSpan, Usage.output, "csharp");
71+
@@usage(DocumentWord, Usage.output, "csharp");
72+
@@usage(DocumentSelectionMark, Usage.output, "csharp");
73+
@@usage(DocumentLine, Usage.output, "csharp");
74+
@@usage(DocumentBarcode, Usage.output, "csharp");
75+
@@usage(DocumentFormula, Usage.output, "csharp");
76+
@@usage(DocumentParagraph, Usage.output, "csharp");
77+
@@usage(BoundingRegion, Usage.output, "csharp");
78+
@@usage(DocumentTable, Usage.output, "csharp");
79+
@@usage(DocumentTableCell, Usage.output, "csharp");
80+
@@usage(DocumentFigure, Usage.output, "csharp");
81+
@@usage(DocumentList, Usage.output, "csharp");
82+
@@usage(DocumentListItem, Usage.output, "csharp");
83+
@@usage(DocumentSection, Usage.output, "csharp");
84+
@@usage(DocumentCaption, Usage.output, "csharp");
85+
@@usage(DocumentFootnote, Usage.output, "csharp");
86+
@@usage(DocumentKeyValuePair, Usage.output, "csharp");
87+
@@usage(DocumentKeyValueElement, Usage.output, "csharp");
88+
@@usage(DocumentStyle, Usage.output, "csharp");
89+
@@usage(DocumentLanguage, Usage.output, "csharp");
90+
@@usage(Document, Usage.output, "csharp");
91+
@@usage(DocumentField, Usage.output, "csharp");
92+
@@usage(CurrencyValue, Usage.output, "csharp");
93+
@@usage(AddressValue, Usage.output, "csharp");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"operationId": "DocumentModels_AnalyzeDocument",
3+
"title": "Analyze Document from Base64",
4+
"parameters": {
5+
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
6+
"api-version": "2023-10-31-preview",
7+
"modelId": "prebuilt-layout",
8+
"pages": "1-2,4",
9+
"locale": "en-US",
10+
"stringIndexType": "textElements",
11+
"analyzeRequest": {
12+
"base64Source": "e2Jhc2U2NEVuY29kZWRQZGZ9"
13+
}
14+
},
15+
"responses": {
16+
"202": {
17+
"headers": {
18+
"Operation-Location": "https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentModels/prebuilt-layout/analyzeResults/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2023-10-31-preview"
19+
}
20+
}
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"operationId": "DocumentModels_AnalyzeDocumentFromStream",
3+
"title": "Analyze Document from Url",
4+
"parameters": {
5+
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
6+
"api-version": "2023-10-31-preview",
7+
"modelId": "customModel",
8+
"pages": "1-2,4",
9+
"locale": "en-US",
10+
"stringIndexType": "textElements",
11+
"input": "{binaryFile}"
12+
},
13+
"responses": {
14+
"202": {
15+
"headers": {
16+
"Operation-Location": "https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentModels/customModel/analyzeResults/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2023-10-31-preview"
17+
}
18+
}
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"operationId": "DocumentModels_AnalyzeDocument",
3+
"title": "Analyze Document from Url",
4+
"parameters": {
5+
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
6+
"api-version": "2023-10-31-preview",
7+
"modelId": "customModel",
8+
"pages": "1-2,4",
9+
"locale": "en-US",
10+
"stringIndexType": "textElements",
11+
"analyzeRequest": {
12+
"urlSource": "http://host.com/doc.pdf"
13+
}
14+
},
15+
"responses": {
16+
"202": {
17+
"headers": {
18+
"Operation-Location": "https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentModels/customModel/analyzeResults/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2023-10-31-preview"
19+
}
20+
}
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"operationId": "DocumentModels_AuthorizeModelCopy",
3+
"title": "Authorize Copy of Document Model",
4+
"parameters": {
5+
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
6+
"api-version": "2023-10-31-preview",
7+
"authorizeCopyRequest": {
8+
"modelId": "targetModel",
9+
"description": "Target model description"
10+
}
11+
},
12+
"responses": {
13+
"200": {
14+
"body": {
15+
"targetResourceId": "/subscriptions/targetSub/resourceGroups/targetRG/providers/Microsoft.CognitiveServices/accounts/targetService",
16+
"targetResourceRegion": "targetResourceRegion",
17+
"targetModelId": "targetModel",
18+
"targetModelLocation": "https://targetEndpoint.cognitiveservices.azure.com/documentintelligence/documentModels/targetModel",
19+
"accessToken": "accessToken",
20+
"expirationDateTime": "2021-09-23T09:12:54.552Z"
21+
}
22+
}
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"operationId": "DocumentClassifiers_BuildClassifier",
3+
"title": "Build Document Classifier",
4+
"parameters": {
5+
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
6+
"api-version": "2023-10-31-preview",
7+
"buildRequest": {
8+
"classifierId": "myClassifier",
9+
"description": "Classifier description",
10+
"docTypes": {
11+
"formA": {
12+
"azureBlobSource": {
13+
"containerUrl": "https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken",
14+
"prefix": "formADocs/"
15+
}
16+
},
17+
"formB": {
18+
"azureBlobFileListSource": {
19+
"containerUrl": "https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken",
20+
"fileList": "formB.jsonl"
21+
}
22+
}
23+
}
24+
}
25+
},
26+
"responses": {
27+
"202": {
28+
"headers": {
29+
"Operation-Location": "https://myendpoint.cognitiveservices.azure.com/documentintelligence/operations/b704bb00-d130-4f3f-a1d8-ca96de3eabb4?api-version=2023-10-31-preview"
30+
}
31+
}
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"operationId": "DocumentModels_BuildModel",
3+
"title": "Build Document Model",
4+
"parameters": {
5+
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
6+
"api-version": "2023-10-31-preview",
7+
"buildRequest": {
8+
"modelId": "myCustomModel",
9+
"description": "Custom model description",
10+
"buildMode": "template",
11+
"azureBlobSource": {
12+
"containerUrl": "https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken",
13+
"prefix": "trainingDocs/"
14+
},
15+
"tags": {
16+
"createdBy": "myUserId"
17+
}
18+
}
19+
},
20+
"responses": {
21+
"202": {
22+
"headers": {
23+
"Operation-Location": "https://myendpoint.cognitiveservices.azure.com/documentintelligence/operations/b704bb00-d130-4f3f-a1d8-ca96de3eabb4?api-version=2023-10-31-preview"
24+
}
25+
}
26+
}
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"operationId": "DocumentClassifiers_ClassifyDocumentFromStream",
3+
"title": "Classify Document from Url",
4+
"parameters": {
5+
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
6+
"api-version": "2023-10-31-preview",
7+
"classifierId": "classifierId",
8+
"stringIndexType": "textElements",
9+
"input": "{binaryFile}"
10+
},
11+
"responses": {
12+
"202": {
13+
"headers": {
14+
"Operation-Location": "https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentClassifiers/customClassifier/analyzeResults/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2023-10-31-preview"
15+
}
16+
}
17+
}
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"operationId": "DocumentClassifiers_ClassifyDocument",
3+
"title": "Classify Document from Url",
4+
"parameters": {
5+
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
6+
"api-version": "2023-10-31-preview",
7+
"classifierId": "classifierId",
8+
"stringIndexType": "textElements",
9+
"classifyRequest": {
10+
"urlSource": "http://host.com/doc.pdf"
11+
}
12+
},
13+
"responses": {
14+
"202": {
15+
"headers": {
16+
"Operation-Location": "https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentClassifiers/customClassifier/analyzeResults/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2023-10-31-preview"
17+
}
18+
}
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"operationId": "DocumentModels_ComposeModel",
3+
"title": "Compose Document Model",
4+
"parameters": {
5+
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
6+
"api-version": "2023-10-31-preview",
7+
"composeRequest": {
8+
"modelId": "composedModel",
9+
"description": "Composed model description",
10+
"componentModels": [
11+
{
12+
"modelId": "model1"
13+
},
14+
{
15+
"modelId": "model2"
16+
}
17+
]
18+
}
19+
},
20+
"responses": {
21+
"202": {
22+
"headers": {
23+
"Operation-Location": "https://myendpoint.cognitiveservices.azure.com/documentintelligence/operations/b704bb00-d130-4f3f-a1d8-ca96de3eabb4?api-version=2023-10-31-preview"
24+
}
25+
}
26+
}
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"operationId": "DocumentModels_CopyModelTo",
3+
"title": "Copy Document Model To",
4+
"parameters": {
5+
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
6+
"api-version": "2023-10-31-preview",
7+
"modelId": "sourceModel",
8+
"copyToRequest": {
9+
"targetResourceId": "/subscriptions/targetSub/resourceGroups/targetRG/providers/Microsoft.CognitiveServices/accounts/targetService",
10+
"targetResourceRegion": "targetResourceRegion",
11+
"targetModelId": "targetModel",
12+
"targetModelLocation": "https://targetEndpoint.cognitiveservices.azure.com/documentintelligence/documentModels/targetModel",
13+
"accessToken": "accessToken",
14+
"expirationDateTime": "2021-09-23T09:12:54.552Z"
15+
}
16+
},
17+
"responses": {
18+
"202": {
19+
"headers": {
20+
"Operation-Location": "https://myendpoint.cognitiveservices.azure.com/documentintelligence/operations/b704bb00-d130-4f3f-a1d8-ca96de3eabb4?api-version=2023-10-31-preview"
21+
}
22+
}
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"operationId": "DocumentClassifiers_DeleteClassifier",
3+
"title": "Delete Document Classifier",
4+
"parameters": {
5+
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
6+
"api-version": "2023-10-31-preview",
7+
"classifierId": "myClassifier"
8+
},
9+
"responses": {
10+
"204": {}
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"operationId": "DocumentModels_DeleteModel",
3+
"title": "Delete Document Model",
4+
"parameters": {
5+
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
6+
"api-version": "2023-10-31-preview",
7+
"modelId": "myCustomModel"
8+
},
9+
"responses": {
10+
"204": {}
11+
}
12+
}

0 commit comments

Comments
 (0)