Skip to content

Commit 90ac3ab

Browse files
[documentintelligence] Release prep (Azure#38929)
* run snippet updater * update changelog --------- Co-authored-by: catalinaperalta <[email protected]>
1 parent 13e01ff commit 90ac3ab

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

sdk/documentintelligence/azure-ai-documentintelligence/CHANGELOG.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release History
22

3-
## 1.0.0 (Unreleased)
3+
## 1.0.0 (2024-12-17)
44

55
### Features Added
66

@@ -30,8 +30,6 @@
3030
- Removed model `AnalyzeResultOperation`.
3131
- Removed `GENERATIVE ` in enum `DocumentBuildMode`.
3232

33-
### Bugs Fixed
34-
3533
### Other Changes
3634

3735
- Changed the default service API version to `2024-11-30`.

sdk/documentintelligence/azure-ai-documentintelligence/README.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,7 @@ key = os.environ["DOCUMENTINTELLIGENCE_API_KEY"]
233233

234234
document_intelligence_client = DocumentIntelligenceClient(endpoint=endpoint, credential=AzureKeyCredential(key))
235235
with open(path_to_sample_documents, "rb") as f:
236-
poller = document_intelligence_client.begin_analyze_document(
237-
"prebuilt-layout", body=f
238-
)
236+
poller = document_intelligence_client.begin_analyze_document("prebuilt-layout", body=f)
239237
result: AnalyzeResult = poller.result()
240238

241239
if result.styles and any([style.is_handwritten for style in result.styles]):
@@ -503,16 +501,16 @@ from azure.ai.documentintelligence import DocumentIntelligenceClient
503501
from azure.ai.documentintelligence.models import AnalyzeResult
504502

505503
def _format_price(price_dict):
504+
if price_dict is None:
505+
return "N/A"
506506
return "".join([f"{p}" for p in price_dict.values()])
507507

508508
endpoint = os.environ["DOCUMENTINTELLIGENCE_ENDPOINT"]
509509
key = os.environ["DOCUMENTINTELLIGENCE_API_KEY"]
510510

511511
document_intelligence_client = DocumentIntelligenceClient(endpoint=endpoint, credential=AzureKeyCredential(key))
512512
with open(path_to_sample_documents, "rb") as f:
513-
poller = document_intelligence_client.begin_analyze_document(
514-
"prebuilt-receipt", body=f, locale="en-US"
515-
)
513+
poller = document_intelligence_client.begin_analyze_document("prebuilt-receipt", body=f, locale="en-US")
516514
receipts: AnalyzeResult = poller.result()
517515

518516
if receipts.documents:
@@ -665,9 +663,7 @@ document_intelligence_client = DocumentIntelligenceClient(endpoint=endpoint, cre
665663

666664
# Make sure your document's type is included in the list of document types the custom model can analyze
667665
with open(path_to_sample_documents, "rb") as f:
668-
poller = document_intelligence_client.begin_analyze_document(
669-
model_id=model_id, body=f
670-
)
666+
poller = document_intelligence_client.begin_analyze_document(model_id=model_id, body=f)
671667
result: AnalyzeResult = poller.result()
672668

673669
if result.documents:
@@ -921,7 +917,7 @@ def callback(response):
921917

922918
client.get_resource_details(raw_response_hook=callback)
923919

924-
print(f"Response status code is: {responses["status_code"]}")
920+
print(f"Response status code is: {responses['status_code']}")
925921
response_body = responses["response_body"]
926922
print(
927923
f"Our resource has {response_body['customDocumentModels']['count']} custom models, "

0 commit comments

Comments
 (0)