Skip to content

Commit

Permalink
Document Intelligence 2024-07-31-preview (#30088)
Browse files Browse the repository at this point in the history
* Add DocumentIntelligence 2024-07-31-preview.

* Fix validation.
  • Loading branch information
bojunehsu authored Aug 6, 2024
1 parent 38865af commit ec2a81e
Show file tree
Hide file tree
Showing 73 changed files with 21,953 additions and 77 deletions.
25 changes: 20 additions & 5 deletions specification/ai/DocumentIntelligence/client.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using DocumentIntelligence;

@TypeSpec.Versioning.useDependency(Azure.Core.Versions.v1_0_Preview_2)
@TypeSpec.Versioning.useDependency(
DocumentIntelligence.Versions.v2024_02_29_preview
DocumentIntelligence.Versions.v2024_07_31_preview
)
namespace ClientCustomizations;

Expand All @@ -20,6 +20,13 @@ namespace ClientCustomizations;
interface DocumentIntelligenceClient {
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
analyzeDocument is DocumentModels.analyzeDocument;
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
analyzeBatchDocuments is DocumentModels.analyzeBatchDocuments;
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
getAnalyzeResultPdf is DocumentModels.getAnalyzeResultPdf;
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
getAnalyzeResultFigure is DocumentModels.getAnalyzeResultFigure;

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
classifyDocument is DocumentClassifiers.classifyDocument;
}
Expand Down Expand Up @@ -48,12 +55,24 @@ interface DocumentIntelligenceAdministrationClient {

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
buildClassifier is DocumentClassifiers.buildClassifier;
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
authorizeClassifierCopy is DocumentClassifiers.authorizeClassifierCopy;
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
copyClassifierTo is DocumentClassifiers.copyClassifierTo;
getClassifier is DocumentClassifiers.getClassifier;
listClassifiers is DocumentClassifiers.listClassifiers;
deleteClassifier is DocumentClassifiers.deleteClassifier;
}

@@clientName(AnalyzeBatchDocumentsRequest,
"AnalyzeBatchDocumentsContent",
"csharp"
);
@@clientName(AnalyzeDocumentRequest, "AnalyzeDocumentContent", "csharp");
@@clientName(AuthorizeClassifierCopyRequest,
"AuthorizeClassifierCopyContent",
"csharp"
);
@@clientName(AuthorizeCopyRequest, "AuthorizeCopyContent", "csharp");
@@clientName(BuildDocumentClassifierRequest,
"BuildDocumentClassifierContent",
Expand Down Expand Up @@ -92,7 +111,6 @@ interface DocumentIntelligenceAdministrationClient {
@@clientName(FontWeight, "DocumentFontWeight", "csharp");
@@clientName(OperationDetails.createdDateTime, "CreatedOn", "csharp");
@@clientName(OperationDetails.lastUpdatedDateTime, "LastUpdatedOn", "csharp");
@@clientName(QuotaDetails.quotaResetDateTime, "QuotaResetsOn", "csharp");

@@usage(DocumentAnalysisFeature, Usage.output, "csharp");
@@usage(LengthUnit, Usage.output, "csharp");
Expand All @@ -118,8 +136,6 @@ interface DocumentIntelligenceAdministrationClient {
@@usage(DocumentTable, Usage.output, "csharp");
@@usage(DocumentTableCell, Usage.output, "csharp");
@@usage(DocumentFigure, Usage.output, "csharp");
@@usage(DocumentList, Usage.output, "csharp");
@@usage(DocumentListItem, Usage.output, "csharp");
@@usage(DocumentSection, Usage.output, "csharp");
@@usage(DocumentCaption, Usage.output, "csharp");
@@usage(DocumentFootnote, Usage.output, "csharp");
Expand All @@ -133,7 +149,6 @@ interface DocumentIntelligenceAdministrationClient {
@@usage(AddressValue, Usage.output, "csharp");
@@usage(BuildDocumentModelRequest, Usage.input, "csharp");
@@usage(ComposeDocumentModelRequest, Usage.input, "csharp");
@@usage(ComponentDocumentModelDetails, Usage.input, "csharp");
@@usage(CopyAuthorization, Usage.input | Usage.output, "csharp");

@@clientName(AnalyzeDocumentRequest.base64Source, "bytesSource", "python");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"operationId": "DocumentModels_AnalyzeBatchDocuments",
"title": "Analyze Batch Documents",
"parameters": {
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
"api-version": "2024-07-31-preview",
"modelId": "customModel",
"pages": "1-5",
"locale": "en-US",
"stringIndexType": "textElements",
"analyzeBatchRequest": {
"azureBlobSource": {
"containerUrl": "https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken",
"prefix": "trainingDocs/"
},
"resultContainerUrl": "https://myStorageAccount.blob.core.windows.net/myOutputContainer?mySasToken",
"resultPrefix": "trainingDocsResult/",
"overwriteExisting": true
}
},
"responses": {
"202": {
"headers": {
"Operation-Location": "https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentModels/customModel/analyzeBatchResults/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2024-02-29-preview"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"operationId": "DocumentModels_AnalyzeDocument",
"title": "Analyze Document from Base64",
"parameters": {
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
"api-version": "2024-07-31-preview",
"modelId": "prebuilt-layout",
"pages": "1-2,4",
"locale": "en-US",
"stringIndexType": "textElements",
"analyzeRequest": {
"base64Source": "e2Jhc2U2NEVuY29kZWRQZGZ9"
}
},
"responses": {
"202": {
"headers": {
"Operation-Location": "https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentModels/prebuilt-layout/analyzeResults/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2024-07-31-preview"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"operationId": "DocumentModels_AnalyzeDocumentFromStream",
"title": "Analyze Document from Url",
"parameters": {
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
"api-version": "2024-07-31-preview",
"modelId": "customModel",
"pages": "1-2,4",
"locale": "en-US",
"stringIndexType": "textElements",
"input": "{binaryFile}"
},
"responses": {
"202": {
"headers": {
"Operation-Location": "https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentModels/customModel/analyzeResults/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2024-07-31-preview"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"operationId": "DocumentModels_AnalyzeDocument",
"title": "Analyze Document from Url",
"parameters": {
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
"api-version": "2024-07-31-preview",
"modelId": "customModel",
"pages": "1-2,4",
"locale": "en-US",
"stringIndexType": "textElements",
"analyzeRequest": {
"urlSource": "http://host.com/doc.pdf"
}
},
"responses": {
"202": {
"headers": {
"Operation-Location": "https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentModels/customModel/analyzeResults/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2024-07-31-preview"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"operationId": "DocumentClassifiers_AuthorizeClassifierCopy",
"title": "Authorize Copy of Document Classifier",
"parameters": {
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
"api-version": "2024-07-31-preview",
"authorizeCopyRequest": {
"classifierId": "targetClassifier",
"description": "Target classifier description"
}
},
"responses": {
"200": {
"body": {
"targetResourceId": "/subscriptions/targetSub/resourceGroups/targetRG/providers/Microsoft.CognitiveServices/accounts/targetService",
"targetResourceRegion": "targetResourceRegion",
"targetClassifierId": "targetClassifier",
"targetClassifierLocation": "https://targetEndpoint.cognitiveservices.azure.com/documentintelligence/documentClassifiers/targetClassifier",
"accessToken": "accessToken",
"expirationDateTime": "2021-09-23T09:12:54.552Z"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"operationId": "DocumentModels_AuthorizeModelCopy",
"title": "Authorize Copy of Document Model",
"parameters": {
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
"api-version": "2024-07-31-preview",
"authorizeCopyRequest": {
"modelId": "targetModel",
"description": "Target model description"
}
},
"responses": {
"200": {
"body": {
"targetResourceId": "/subscriptions/targetSub/resourceGroups/targetRG/providers/Microsoft.CognitiveServices/accounts/targetService",
"targetResourceRegion": "targetResourceRegion",
"targetModelId": "targetModel",
"targetModelLocation": "https://targetEndpoint.cognitiveservices.azure.com/documentintelligence/documentModels/targetModel",
"accessToken": "accessToken",
"expirationDateTime": "2021-09-23T09:12:54.552Z"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"operationId": "DocumentClassifiers_BuildClassifier",
"title": "Build Document Classifier",
"parameters": {
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
"api-version": "2024-07-31-preview",
"buildRequest": {
"classifierId": "myClassifier",
"description": "Classifier description",
"docTypes": {
"formA": {
"azureBlobSource": {
"containerUrl": "https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken",
"prefix": "formADocs/"
}
},
"formB": {
"azureBlobFileListSource": {
"containerUrl": "https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken",
"fileList": "formB.jsonl"
}
}
}
}
},
"responses": {
"202": {
"headers": {
"Operation-Location": "https://myendpoint.cognitiveservices.azure.com/documentintelligence/operations/b704bb00-d130-4f3f-a1d8-ca96de3eabb4?api-version=2024-07-31-preview"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"operationId": "DocumentModels_BuildModel",
"title": "Build Document Model",
"parameters": {
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
"api-version": "2024-07-31-preview",
"buildRequest": {
"modelId": "myCustomModel",
"description": "Custom model description",
"buildMode": "template",
"azureBlobSource": {
"containerUrl": "https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken",
"prefix": "trainingDocs/"
},
"tags": {
"createdBy": "myUserId"
}
}
},
"responses": {
"202": {
"headers": {
"Operation-Location": "https://myendpoint.cognitiveservices.azure.com/documentintelligence/operations/b704bb00-d130-4f3f-a1d8-ca96de3eabb4?api-version=2024-07-31-preview"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"operationId": "DocumentClassifiers_ClassifyDocumentFromStream",
"title": "Classify Document from Url",
"parameters": {
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
"api-version": "2024-07-31-preview",
"classifierId": "classifierId",
"stringIndexType": "textElements",
"input": "{binaryFile}"
},
"responses": {
"202": {
"headers": {
"Operation-Location": "https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentClassifiers/customClassifier/analyzeResults/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2024-07-31-preview"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"operationId": "DocumentClassifiers_ClassifyDocument",
"title": "Classify Document from Url",
"parameters": {
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
"api-version": "2024-07-31-preview",
"classifierId": "classifierId",
"stringIndexType": "textElements",
"classifyRequest": {
"urlSource": "http://host.com/doc.pdf"
}
},
"responses": {
"202": {
"headers": {
"Operation-Location": "https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentClassifiers/customClassifier/analyzeResults/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2024-07-31-preview"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"operationId": "DocumentModels_ComposeModel",
"title": "Compose Document Model",
"parameters": {
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
"api-version": "2024-07-31-preview",
"composeRequest": {
"modelId": "composedModel",
"description": "Composed model description",
"classifierId": "customClassifier",
"docTypes": {
"formA": {
"modelId": "model1"
},
"formB": {
"modelId": "model2"
}
}
}
},
"responses": {
"202": {
"headers": {
"Operation-Location": "https://myendpoint.cognitiveservices.azure.com/documentintelligence/operations/b704bb00-d130-4f3f-a1d8-ca96de3eabb4?api-version=2024-07-31-preview"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"operationId": "DocumentClassifiers_CopyClassifierTo",
"title": "Copy Document Classifier To",
"parameters": {
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
"api-version": "2024-07-31-preview",
"classifierId": "sourceClassifier",
"copyToRequest": {
"targetResourceId": "/subscriptions/targetSub/resourceGroups/targetRG/providers/Microsoft.CognitiveServices/accounts/targetService",
"targetResourceRegion": "targetResourceRegion",
"targetClassifierId": "targetClassifier",
"targetClassifierLocation": "https://targetEndpoint.cognitiveservices.azure.com/documentintelligence/documentClassifiers/targetClassifier",
"accessToken": "accessToken",
"expirationDateTime": "2021-09-23T09:12:54.552Z"
}
},
"responses": {
"202": {
"headers": {
"Operation-Location": "https://myendpoint.cognitiveservices.azure.com/documentintelligence/operations/b704bb00-d130-4f3f-a1d8-ca96de3eabb4?api-version=2024-07-31-preview"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"operationId": "DocumentModels_CopyModelTo",
"title": "Copy Document Model To",
"parameters": {
"endpoint": "https://myendpoint.cognitiveservices.azure.com",
"api-version": "2024-07-31-preview",
"modelId": "sourceModel",
"copyToRequest": {
"targetResourceId": "/subscriptions/targetSub/resourceGroups/targetRG/providers/Microsoft.CognitiveServices/accounts/targetService",
"targetResourceRegion": "targetResourceRegion",
"targetModelId": "targetModel",
"targetModelLocation": "https://targetEndpoint.cognitiveservices.azure.com/documentintelligence/documentModels/targetModel",
"accessToken": "accessToken",
"expirationDateTime": "2021-09-23T09:12:54.552Z"
}
},
"responses": {
"202": {
"headers": {
"Operation-Location": "https://myendpoint.cognitiveservices.azure.com/documentintelligence/operations/b704bb00-d130-4f3f-a1d8-ca96de3eabb4?api-version=2024-07-31-preview"
}
}
}
}
Loading

0 comments on commit ec2a81e

Please sign in to comment.