Azure / Azure/azure-sdk-for-python

[DocumentIntelligence] JSON error when calling begin_analyze_document

Offen
#43,388 3 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @yungshinlintw Auf GitHub ansehen
Client customer-reported Document Intelligence needs-team-attention question
Vorherrschende Sprache
Python
Sterne
5.6k
Forks
3.4k
Ø Merge
2 T. 2 Std.
Gemergte PRs (30 T.)
213

Beschreibung

- **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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.