Azure / Azure/azure-sdk-for-python

[DocumentIntelligence] JSON error when calling begin_analyze_document

Open
#43,388 3 comments 0 reactions 1 assignee Claimed by @yungshinlintw View on GitHub
Client customer-reported Document Intelligence needs-team-attention question
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.