Hello Andrew Richardson (W),
Thanks for troubleshooting on this and i understand your frustration on this.
Based on the Azure SDK documentation for Document Intelligence, the AnalyzeBatchDocumentsRequest
class does not support the output_content_format
parameter. This is confirmed by the following details:
- The
begin_analyze_batch_documents
method in theDocumentIntelligenceClient
class accepts anAnalyzeBatchDocumentsRequest
object, but theoutput_content_format
parameter is not listed as a valid argument. - The
output_content_format
parameter is supported in thebegin_analyze_document
method, which suggests that you should use this method instead for specifying the output format.
Here is an example of how to use the begin_analyze_document
method with the output_content_format
parameter:
from azure.ai.documentintelligence import DocumentIntelligenceClient
from azure.core.credentials import AzureKeyCredential
# Define the request
request = {
"result_container_url": result_container_sas_url,
"azure_blob_source": {
"container_url": batch_training_data_container_sas_url
}
}
# Make the request
poller = client.begin_analyze_document(
model_id="<your-model-id>",
analyze_request=request,
output_content_format="pdf"
)
# Get the result
result = poller.result()
# Save the result as a PDF
with open("output.pdf", "wb") as f:
f.write(result)
For more detailed information, you can refer to the official Microsoft documentation on the DocumentIntelligenceClient
class and its methods.
I hope this helps! Let me know if you have any other questions.
If the reply was helpful, please don't forget to upvote and/or accept as answer, this can be beneficial to other community members.
Thanks