Azure / Azure/azure-sdk-for-python
[DocumentIntelligence] JSON error when calling begin_analyze_document
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 3.4k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 193
Description
- **Package Name**: azure_ai_documentintelligence
- **Package Version**: 1.0.2
- **Operating System**: Win 11
- **Python Version**: 3.9
**Describe the bug**
Reading a PDF document triggers the following error:
**JSONDecodeError: Expecting value**
Though, the code is taken from the documentation. I precise that the code is not run on Azure but locally on a Windows system.
**To Reproduce**
```
from azure.core.credentials import AzureKeyCredential
from azure.ai.documentintelligence import DocumentIntelligenceClient
endpoint = "***"
key = "***"
client = DocumentIntelligenceClient(endpoint=endpoint, credential=AzureKeyCredential(key))
with open("my_file.pdf", "rb") as f:
poller = client.begin_analyze_document("prebuilt-read", body=f)
```
**Expected behavior**
I expect the code to run properly.
Contributor guide
Assessment
This issue has not been assessed yet.