-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AzureAIDocumentIntelligence : Analyze request Parameter in begin_analyze_document throwing error #36434
Comments
Thank you for your feedback. Tagging and routing to the team member best able to assist. |
Hi @sakshi1989 , can you try with passing parameter print(type(f))
poller = document_intelligence_client.begin_analyze_document(model_id="prebuilt-layout",
analyze_request=f,
output_content_format="markdown",
content_type="application/octet-stream",) Or passing in a print(type(f))
poller = document_intelligence_client.begin_analyze_document(model_id="prebuilt-layout",
AnalyzeDocumentRequest(bytes_source=f.read()),
output_content_format="markdown",) Thanks |
Thanks @YalinLi0312 for your reply. Your first suggestion works, but not the second one. With the second one I am receiving below error - Also, I would like to point out that in documentation there is nowhere mentioned to have the parameter |
Hi @sakshi1989. 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 @sakshi1989, thanks for the feedback! We'll mention the type in our documentation. |
Hi @YalinLi0312 , thank you for your quick response on the issue. Yes, now both the options are working. |
Just encountered the same problem, thankfully I came across this issue, used the f.read() solution and it worked great! |
Describe the bug
The begin_analyze_document method of the DocumentIntelligenceClient is throwing the below error -
HttpResponseError: (InvalidArgument) Invalid argument. Code: InvalidArgument Message: Invalid argument. Inner error: { "code": "ParameterMissing", "message": "The parameter urlSource or base64Source is required." }
I am trying this resource as per the example - Example
To Reproduce
Steps to reproduce the behavior:
azure-ai-documentintelligence
libraryfrom azure.core.credentials import AzureKeyCredential
from azure.ai.documentintelligence import DocumentIntelligenceClient
from azure.ai.documentintelligence.models import AnalyzeResult
azure-ai-documentintelligence
resource.document_intelligence_client = DocumentIntelligenceClient(endpoint=endpoint, credential=AzureKeyCredential(api_key))
with open(path_to_sample_documents, "rb") as f:
result : AnalyzeResult = poller.result()
Expected behavior
The document should have got processed
Additional context
The same issue was opened here, but it was closed as no response was received from the person who opened the issue.
Existing Issue
After debugging the internal code of the library it is failing at line 507
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs )
at path Internal Code
The text was updated successfully, but these errors were encountered: