DocumentAnalysisClient
and ClassifyDocumentOptions
are inconsistent over different client SDKs
#30040
Open
3 of 6 tasks
Labels
Client
This issue points to a problem in the data-plane of the library.
Cognitive - Form Recognizer
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Service Attention
Workflow: This issue is responsible by Azure service team.
Describe the bug
The documentation and implementation are unclear for
DocumentAnalysisClient
andClassifyDocumentOptions
.When working in a TypeScript environment on NodeJS, it seems impossible to pass the
pages
query parameter to thebeginClassifyDocument(FromUrl)
function. However, when looking into the latest docs for the Python SDK, this is mentioned to be possible (https://learn.microsoft.com/en-us/python/api/azure-ai-formrecognizer/azure.ai.formrecognizer.documentanalysisclient?view=azure-python#azure-ai-formrecognizer-documentanalysisclient-begin-classify-document-from-url). At the same time, none of these options are mentioned in the JS docs, or even in the REST specification (https://learn.microsoft.com/en-us/rest/api/aiservices/document-classifiers/classify-document?view=rest-aiservices-v4.0%20(2024-02-29-preview)&tabs=HTTP).This seems very weird, as the UI within Azure Document Intelligence Studio offers the possibility to define a range of pages to be analysed/classified when testing the models. This made me look into the network tab, and indeed a
pages
query parameter is passed to the classify endpoint (POST /documentintelligence/documentClassifiers/{modelid}:analyze
). For now, I'm using this in my code with success, but it would be nice to know what is happening here and if this parameter will be completely deprecated in the future. In our situation, we classify documents based on the first page only, which works fine and fast. The solution can be found below and works (for now).To Reproduce
Steps to reproduce the behavior:
pages
parameter via JS SDK; it will not be used in the underlying call to the analyze endpoint and is not recognized by the TS type ofClassifyDocumentOptions
Expected behavior
Consistent behaviour and implementation across SDKs and REST endpoints
Additional context
The solution we worked out:
The text was updated successfully, but these errors were encountered: