Closed jainparakh closed 1 day ago
Same issue as here - https://learn.microsoft.com/en-us/answers/questions/1639700/unable-to-use-new-api-for-document-intelligence
Please fix this
Thanks for the feedback, we’ll investigate asap.
Hi @jainparakh , I've tried the layout model sample in this doc(link) but didn't see any errors. Based on the error you got, I looks the issue is from using begin_analyze_document()
. Can you provide the package name, package version and code snippet for how you're using begin_analyze_document()
? These would help us to reproduce and investigate the issue.
In general, if you're analyzing a doc from local, you can pass it directly or wrap it to a AnalyzeDocumentRequest
object.
e.g.
with open(path_to_sample_documents, "rb") as f:
poller = document_intelligence_client.begin_analyze_document(
"prebuilt-layout",
analyze_request=f, # pass it directly
content_type="application/octet-stream",
)
result = poller.result()
with open(path_to_sample_documents, "rb") as f:
poller = document_intelligence_client.begin_analyze_document(
"prebuilt-layout",
AnalyzeDocumentRequest(bytes_source=f.read()), # pass it to "AnalyzeDocumentRequest"
)
result = poller.result()
Note: we've changed the parameter name in "AnalyzeDocumentRequest" from "base64_source" to "bytes_source" since azure-ai-documentintelligence
package version 1.0.0b2
as we expect the input in bytes, not in base64 encoded.
If you're analyzing a doc from remote, you can pass the url in "AnalyzeDocumentRequest" like this:
poller = document_intelligence_client.begin_analyze_document(
"prebuilt-layout", AnalyzeDocumentRequest(url_source=url)
)
Hi @jainparakh. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.
Hi @jainparakh, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!
Steps to reproduce -
Expected:
Actual: Throws:
Inner error: { "code": "ParameterMissing", "message": "The parameter urlSource or base64Source is required."