From 2c98b19d339007523231a62428fe663361e95cac Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Tue, 28 Sep 2021 16:57:29 -0700 Subject: [PATCH 1/2] fix v2 custom forms tests --- .../tests/test_custom_forms.py | 36 ++++++++--------- .../tests/test_custom_forms_async.py | 28 ++++++------- .../tests/test_custom_forms_from_url.py | 40 +++++++++---------- .../tests/test_custom_forms_from_url_async.py | 36 ++++++++--------- 4 files changed, 70 insertions(+), 70 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms.py index 16da9ce71f5f..8e53ad289759 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms.py @@ -35,10 +35,10 @@ def test_analyze_document_empty_model_id(self, formrecognizer_test_endpoint, for @FormRecognizerPreparer() @FormTrainingClientPreparer() - def test_custom_form_unlabeled(self, client, formrecognizer_storage_container_sas_url): + def test_custom_form_unlabeled(self, client, formrecognizer_storage_container_sas_url_v2): fr_client = client.get_form_recognizer_client() - poller = client.begin_training(formrecognizer_storage_container_sas_url, use_training_labels=False) + poller = client.begin_training(formrecognizer_storage_container_sas_url_v2, use_training_labels=False) model = poller.result() with open(self.form_jpg, "rb") as stream: @@ -54,10 +54,10 @@ def test_custom_form_unlabeled(self, client, formrecognizer_storage_container_sa @FormRecognizerPreparer() @FormTrainingClientPreparer() - def test_custom_form_multipage_unlabeled(self, client, formrecognizer_multipage_storage_container_sas_url): + def test_custom_form_multipage_unlabeled(self, client, formrecognizer_multipage_storage_container_sas_url_v2): fr_client = client.get_form_recognizer_client() - poller = client.begin_training(formrecognizer_multipage_storage_container_sas_url, use_training_labels=False) + poller = client.begin_training(formrecognizer_multipage_storage_container_sas_url_v2, use_training_labels=False) model = poller.result() with open(self.multipage_invoice_pdf, "rb") as stream: @@ -76,11 +76,11 @@ def test_custom_form_multipage_unlabeled(self, client, formrecognizer_multipage_ @FormRecognizerPreparer() @FormTrainingClientPreparer() - def test_custom_form_labeled(self, client, formrecognizer_storage_container_sas_url): + def test_custom_form_labeled(self, client, formrecognizer_storage_container_sas_url_v2): fr_client = client.get_form_recognizer_client() poller = client.begin_training( - formrecognizer_storage_container_sas_url, + formrecognizer_storage_container_sas_url_v2, use_training_labels=True, model_name="labeled" ) @@ -97,11 +97,11 @@ def test_custom_form_labeled(self, client, formrecognizer_storage_container_sas_ @FormRecognizerPreparer() @FormTrainingClientPreparer() - def test_custom_form_multipage_labeled(self, client, formrecognizer_multipage_storage_container_sas_url): + def test_custom_form_multipage_labeled(self, client, formrecognizer_multipage_storage_container_sas_url_v2): fr_client = client.get_form_recognizer_client() poller = client.begin_training( - formrecognizer_multipage_storage_container_sas_url, + formrecognizer_multipage_storage_container_sas_url_v2, use_training_labels=True ) model = poller.result() @@ -122,10 +122,10 @@ def test_custom_form_multipage_labeled(self, client, formrecognizer_multipage_st @FormRecognizerPreparer() @FormTrainingClientPreparer() - def test_custom_form_unlabeled_transform(self, client, formrecognizer_storage_container_sas_url): + def test_custom_form_unlabeled_transform(self, client, formrecognizer_storage_container_sas_url_v2): fr_client = client.get_form_recognizer_client() - poller = client.begin_training(formrecognizer_storage_container_sas_url, use_training_labels=False) + poller = client.begin_training(formrecognizer_storage_container_sas_url_v2, use_training_labels=False) model = poller.result() responses = [] @@ -175,10 +175,10 @@ def callback(raw_response, _, headers): @FormRecognizerPreparer() @FormTrainingClientPreparer() - def test_custom_form_multipage_unlabeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url): + def test_custom_form_multipage_unlabeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_v2): fr_client = client.get_form_recognizer_client() - poller = client.begin_training(formrecognizer_multipage_storage_container_sas_url, use_training_labels=False) + poller = client.begin_training(formrecognizer_multipage_storage_container_sas_url_v2, use_training_labels=False) model = poller.result() responses = [] @@ -304,10 +304,10 @@ def callback(raw_response, _, headers): @FormRecognizerPreparer() @FormTrainingClientPreparer() @pytest.mark.live_test_only - def test_custom_form_continuation_token(self, client, formrecognizer_storage_container_sas_url): + def test_custom_form_continuation_token(self, client, formrecognizer_storage_container_sas_url_v2): fr_client = client.get_form_recognizer_client() - poller = client.begin_training(formrecognizer_storage_container_sas_url, use_training_labels=False) + poller = client.begin_training(formrecognizer_storage_container_sas_url_v2, use_training_labels=False) model = poller.result() with open(self.form_jpg, "rb") as fd: @@ -328,10 +328,10 @@ def test_custom_form_continuation_token(self, client, formrecognizer_storage_con @FormRecognizerPreparer() @FormTrainingClientPreparer() - def test_custom_form_multipage_vendor_set_unlabeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_2): + def test_custom_form_multipage_vendor_set_unlabeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_2_v2): fr_client = client.get_form_recognizer_client() - poller = client.begin_training(formrecognizer_multipage_storage_container_sas_url_2, use_training_labels=False) + poller = client.begin_training(formrecognizer_multipage_storage_container_sas_url_2_v2, use_training_labels=False) model = poller.result() responses = [] @@ -367,10 +367,10 @@ def callback(raw_response, _, headers): @FormRecognizerPreparer() @FormTrainingClientPreparer() - def test_custom_form_multipage_vendor_set_labeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_2): + def test_custom_form_multipage_vendor_set_labeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_2_v2): fr_client = client.get_form_recognizer_client() - poller = client.begin_training(formrecognizer_multipage_storage_container_sas_url_2, use_training_labels=True) + poller = client.begin_training(formrecognizer_multipage_storage_container_sas_url_2_v2, use_training_labels=True) model = poller.result() responses = [] diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_async.py index a9713e32c8f3..adeb0c8223b4 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_async.py @@ -39,14 +39,14 @@ async def test_analyze_document_empty_model_id(self, formrecognizer_test_endpoin @FormRecognizerPreparer() @FormTrainingClientPreparer() - async def test_custom_form_unlabeled(self, client, formrecognizer_storage_container_sas_url): + async def test_custom_form_unlabeled(self, client, formrecognizer_storage_container_sas_url_v2): fr_client = client.get_form_recognizer_client() with open(self.form_jpg, "rb") as fd: myfile = fd.read() async with client: - training_poller = await client.begin_training(formrecognizer_storage_container_sas_url, use_training_labels=False) + training_poller = await client.begin_training(formrecognizer_storage_container_sas_url_v2, use_training_labels=False) model = await training_poller.result() async with fr_client: @@ -57,13 +57,13 @@ async def test_custom_form_unlabeled(self, client, formrecognizer_storage_contai @FormRecognizerPreparer() @FormTrainingClientPreparer() - async def test_custom_form_multipage_unlabeled(self, client, formrecognizer_multipage_storage_container_sas_url): + async def test_custom_form_multipage_unlabeled(self, client, formrecognizer_multipage_storage_container_sas_url_v2): fr_client = client.get_form_recognizer_client() with open(self.multipage_invoice_pdf, "rb") as fd: myfile = fd.read() async with client: - training_poller = await client.begin_training(formrecognizer_multipage_storage_container_sas_url, use_training_labels=False) + training_poller = await client.begin_training(formrecognizer_multipage_storage_container_sas_url_v2, use_training_labels=False) model = await training_poller.result() async with fr_client: @@ -82,14 +82,14 @@ async def test_custom_form_multipage_unlabeled(self, client, formrecognizer_mult @FormRecognizerPreparer() @FormTrainingClientPreparer() - async def test_custom_form_multipage_labeled(self, client, formrecognizer_multipage_storage_container_sas_url): + async def test_custom_form_multipage_labeled(self, client, formrecognizer_multipage_storage_container_sas_url_v2): fr_client = client.get_form_recognizer_client() with open(self.multipage_invoice_pdf, "rb") as fd: myfile = fd.read() async with client: training_poller = await client.begin_training( - formrecognizer_multipage_storage_container_sas_url, + formrecognizer_multipage_storage_container_sas_url_v2, use_training_labels=True ) model = await training_poller.result() @@ -108,7 +108,7 @@ async def test_custom_form_multipage_labeled(self, client, formrecognizer_multip @FormRecognizerPreparer() @FormTrainingClientPreparer() - async def test_custom_forms_multipage_unlabeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url): + async def test_custom_forms_multipage_unlabeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_v2): fr_client = client.get_form_recognizer_client() responses = [] @@ -123,7 +123,7 @@ def callback(raw_response, _, headers): myfile = fd.read() async with client: - training_poller = await client.begin_training(formrecognizer_multipage_storage_container_sas_url, use_training_labels=False) + training_poller = await client.begin_training(formrecognizer_multipage_storage_container_sas_url_v2, use_training_labels=False) model = await training_poller.result() async with fr_client: @@ -244,13 +244,13 @@ def callback(raw_response, _, headers): @FormRecognizerPreparer() @FormTrainingClientPreparer() @pytest.mark.live_test_only - async def test_custom_form_continuation_token(self, client, formrecognizer_storage_container_sas_url): + async def test_custom_form_continuation_token(self, client, formrecognizer_storage_container_sas_url_v2): fr_client = client.get_form_recognizer_client() with open(self.form_jpg, "rb") as fd: myfile = fd.read() async with client: - poller = await client.begin_training(formrecognizer_storage_container_sas_url, use_training_labels=False) + poller = await client.begin_training(formrecognizer_storage_container_sas_url_v2, use_training_labels=False) model = await poller.result() async with fr_client: @@ -271,7 +271,7 @@ async def test_custom_form_continuation_token(self, client, formrecognizer_stora @FormRecognizerPreparer() @FormTrainingClientPreparer() - async def test_custom_form_multipage_vendor_set_unlabeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_2): + async def test_custom_form_multipage_vendor_set_unlabeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_2_v2): fr_client = client.get_form_recognizer_client() responses = [] @@ -286,7 +286,7 @@ def callback(raw_response, _, headers): myfile = fd.read() async with client: - poller = await client.begin_training(formrecognizer_multipage_storage_container_sas_url_2, use_training_labels=False) + poller = await client.begin_training(formrecognizer_multipage_storage_container_sas_url_2_v2, use_training_labels=False) model = await poller.result() async with fr_client: @@ -312,7 +312,7 @@ def callback(raw_response, _, headers): @FormRecognizerPreparer() @FormTrainingClientPreparer() - async def test_custom_form_multipage_vendor_set_labeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_2): + async def test_custom_form_multipage_vendor_set_labeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_2_v2): fr_client = client.get_form_recognizer_client() responses = [] @@ -327,7 +327,7 @@ def callback(raw_response, _, headers): responses.append(form) async with client: - poller = await client.begin_training(formrecognizer_multipage_storage_container_sas_url_2, use_training_labels=True) + poller = await client.begin_training(formrecognizer_multipage_storage_container_sas_url_2_v2, use_training_labels=True) model = await poller.result() async with fr_client: diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url.py index 82cc7a821725..41b09c291a2a 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url.py @@ -36,11 +36,11 @@ def test_document_analysis_empty_model_id(self, formrecognizer_test_endpoint, fo @FormRecognizerPreparer() @FormTrainingClientPreparer() - def test_form_multipage_unlabeled(self, client, formrecognizer_multipage_storage_container_sas_url): - blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url, "multipage-training-data", "multipage_invoice1.pdf") + def test_form_multipage_unlabeled(self, client, formrecognizer_multipage_storage_container_sas_url_v2): + blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url_v2, "multipage-training-data", "multipage_invoice1.pdf") fr_client = client.get_form_recognizer_client() - poller = client.begin_training(formrecognizer_multipage_storage_container_sas_url, use_training_labels=False) + poller = client.begin_training(formrecognizer_multipage_storage_container_sas_url_v2, use_training_labels=False) model = poller.result() poller = fr_client.begin_recognize_custom_forms_from_url( @@ -57,12 +57,12 @@ def test_form_multipage_unlabeled(self, client, formrecognizer_multipage_storage @FormRecognizerPreparer() @FormTrainingClientPreparer() - def test_form_multipage_labeled(self, client, formrecognizer_multipage_storage_container_sas_url): - blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url, "multipage-training-data", "multipage_invoice1.pdf") + def test_form_multipage_labeled(self, client, formrecognizer_multipage_storage_container_sas_url_v2): + blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url_v2, "multipage-training-data", "multipage_invoice1.pdf") fr_client = client.get_form_recognizer_client() poller = client.begin_training( - formrecognizer_multipage_storage_container_sas_url, + formrecognizer_multipage_storage_container_sas_url_v2, use_training_labels=True ) model = poller.result() @@ -79,10 +79,10 @@ def test_form_multipage_labeled(self, client, formrecognizer_multipage_storage_c @FormRecognizerPreparer() @FormTrainingClientPreparer() - def test_custom_form_multipage_unlabeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url): + def test_custom_form_multipage_unlabeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_v2): fr_client = client.get_form_recognizer_client() - blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url, "multipage-training-data", "multipage_invoice1.pdf") - poller = client.begin_training(formrecognizer_multipage_storage_container_sas_url, use_training_labels=False) + blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url_v2, "multipage-training-data", "multipage_invoice1.pdf") + poller = client.begin_training(formrecognizer_multipage_storage_container_sas_url_v2, use_training_labels=False) model = poller.result() responses = [] @@ -116,10 +116,10 @@ def callback(raw_response, _, headers): @FormRecognizerPreparer() @FormTrainingClientPreparer() - def test_custom_form_multipage_labeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url): + def test_custom_form_multipage_labeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_v2): fr_client = client.get_form_recognizer_client() - blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url, "multipage-training-data", "multipage_invoice1.pdf") - poller = client.begin_training(formrecognizer_multipage_storage_container_sas_url, use_training_labels=True) + blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url_v2, "multipage-training-data", "multipage_invoice1.pdf") + poller = client.begin_training(formrecognizer_multipage_storage_container_sas_url_v2, use_training_labels=True) model = poller.result() responses = [] @@ -155,10 +155,10 @@ def callback(raw_response, _, headers): @FormRecognizerPreparer() @FormTrainingClientPreparer() @pytest.mark.live_test_only - def test_custom_form_continuation_token(self, client, formrecognizer_storage_container_sas_url): + def test_custom_form_continuation_token(self, client, formrecognizer_storage_container_sas_url_v2): fr_client = client.get_form_recognizer_client() - training_poller = client.begin_training(formrecognizer_storage_container_sas_url, use_training_labels=False) + training_poller = client.begin_training(formrecognizer_storage_container_sas_url_v2, use_training_labels=False) model = training_poller.result() initial_poller = fr_client.begin_recognize_custom_forms_from_url( @@ -178,10 +178,10 @@ def test_custom_form_continuation_token(self, client, formrecognizer_storage_con @FormRecognizerPreparer() @FormTrainingClientPreparer() - def test_custom_form_multipage_vendor_set_unlabeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_2): + def test_custom_form_multipage_vendor_set_unlabeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_2_v2): fr_client = client.get_form_recognizer_client() - blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url_2, "multipage-vendor-forms", "multi1.pdf") - poller = client.begin_training(formrecognizer_multipage_storage_container_sas_url_2, use_training_labels=False) + blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url_2_v2, "multipage-vendor-forms", "multi1.pdf") + poller = client.begin_training(formrecognizer_multipage_storage_container_sas_url_2_v2, use_training_labels=False) model = poller.result() responses = [] @@ -215,10 +215,10 @@ def callback(raw_response, _, headers): @FormRecognizerPreparer() @FormTrainingClientPreparer() - def test_custom_form_multipage_vendor_set_labeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_2): + def test_custom_form_multipage_vendor_set_labeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_2_v2): fr_client = client.get_form_recognizer_client() - blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url_2, "multipage-vendor-forms", "multi1.pdf") - poller = client.begin_training(formrecognizer_multipage_storage_container_sas_url_2, use_training_labels=True) + blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url_2_v2, "multipage-vendor-forms", "multi1.pdf") + poller = client.begin_training(formrecognizer_multipage_storage_container_sas_url_2_v2, use_training_labels=True) model = poller.result() responses = [] diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url_async.py index bb6fedb2e960..8213f566eb7e 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url_async.py @@ -38,11 +38,11 @@ async def test_document_analysis_empty_model_id(self, formrecognizer_test_endpoi @FormRecognizerPreparer() @FormTrainingClientPreparer() - async def test_custom_form_multipage_unlabeled(self, client, formrecognizer_multipage_storage_container_sas_url): + async def test_custom_form_multipage_unlabeled(self, client, formrecognizer_multipage_storage_container_sas_url_v2): fr_client = client.get_form_recognizer_client() - blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url, "multipage-training-data", "multipage_invoice1.pdf") + blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url_v2, "multipage-training-data", "multipage_invoice1.pdf") async with client: - training_poller = await client.begin_training(formrecognizer_multipage_storage_container_sas_url, use_training_labels=False) + training_poller = await client.begin_training(formrecognizer_multipage_storage_container_sas_url_v2, use_training_labels=False) model = await training_poller.result() async with fr_client: @@ -60,12 +60,12 @@ async def test_custom_form_multipage_unlabeled(self, client, formrecognizer_mult @FormRecognizerPreparer() @FormTrainingClientPreparer() - async def test_form_multipage_labeled(self, client, formrecognizer_multipage_storage_container_sas_url): + async def test_form_multipage_labeled(self, client, formrecognizer_multipage_storage_container_sas_url_v2): fr_client = client.get_form_recognizer_client() - blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url, "multipage-training-data", "multipage_invoice1.pdf") + blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url_v2, "multipage-training-data", "multipage_invoice1.pdf") async with client: training_poller = await client.begin_training( - formrecognizer_multipage_storage_container_sas_url, + formrecognizer_multipage_storage_container_sas_url_v2, use_training_labels=True ) model = await training_poller.result() @@ -83,9 +83,9 @@ async def test_form_multipage_labeled(self, client, formrecognizer_multipage_sto @FormRecognizerPreparer() @FormTrainingClientPreparer() - async def test_multipage_unlabeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url): + async def test_multipage_unlabeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_v2): fr_client = client.get_form_recognizer_client() - blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url, "multipage-training-data", "multipage_invoice1.pdf") + blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url_v2, "multipage-training-data", "multipage_invoice1.pdf") responses = [] def callback(raw_response, _, headers): @@ -95,7 +95,7 @@ def callback(raw_response, _, headers): responses.append(form) async with client: - training_poller = await client.begin_training(formrecognizer_multipage_storage_container_sas_url, use_training_labels=False) + training_poller = await client.begin_training(formrecognizer_multipage_storage_container_sas_url_v2, use_training_labels=False) model = await training_poller.result() async with fr_client: @@ -123,9 +123,9 @@ def callback(raw_response, _, headers): @FormRecognizerPreparer() @FormTrainingClientPreparer() - async def test_multipage_labeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url): + async def test_multipage_labeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_v2): fr_client = client.get_form_recognizer_client() - blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url, "multipage-training-data", "multipage_invoice1.pdf") + blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url_v2, "multipage-training-data", "multipage_invoice1.pdf") responses = [] def callback(raw_response, _, headers): @@ -135,7 +135,7 @@ def callback(raw_response, _, headers): responses.append(form) async with client: - training_poller = await client.begin_training(formrecognizer_multipage_storage_container_sas_url, use_training_labels=True) + training_poller = await client.begin_training(formrecognizer_multipage_storage_container_sas_url_v2, use_training_labels=True) model = await training_poller.result() async with fr_client: @@ -189,9 +189,9 @@ async def test_custom_form_continuation_token(self, client, formrecognizer_stora @FormRecognizerPreparer() @FormTrainingClientPreparer() - async def test_custom_form_multipage_vendor_set_unlabeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_2): + async def test_custom_form_multipage_vendor_set_unlabeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_2_v2): fr_client = client.get_form_recognizer_client() - blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url_2, "multipage-vendor-forms", "multi1.pdf") + blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url_2_v2, "multipage-vendor-forms", "multi1.pdf") responses = [] def callback(raw_response, _, headers): @@ -201,7 +201,7 @@ def callback(raw_response, _, headers): responses.append(form) async with client: - poller = await client.begin_training(formrecognizer_multipage_storage_container_sas_url_2, use_training_labels=False) + poller = await client.begin_training(formrecognizer_multipage_storage_container_sas_url_2_v2, use_training_labels=False) model = await poller.result() async with fr_client: @@ -227,9 +227,9 @@ def callback(raw_response, _, headers): @FormRecognizerPreparer() @FormTrainingClientPreparer() - async def test_custom_form_multipage_vendor_set_labeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_2): + async def test_custom_form_multipage_vendor_set_labeled_transform(self, client, formrecognizer_multipage_storage_container_sas_url_2_v2): fr_client = client.get_form_recognizer_client() - blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url_2, "multipage-vendor-forms", "multi1.pdf") + blob_sas_url = self.get_blob_url(formrecognizer_multipage_storage_container_sas_url_2_v2, "multipage-vendor-forms", "multi1.pdf") responses = [] def callback(raw_response, _, headers): @@ -239,7 +239,7 @@ def callback(raw_response, _, headers): responses.append(form) async with client: - poller = await client.begin_training(formrecognizer_multipage_storage_container_sas_url_2, use_training_labels=True) + poller = await client.begin_training(formrecognizer_multipage_storage_container_sas_url_2_v2, use_training_labels=True) model = await poller.result() async with fr_client: From 3b6b9aa73d98d3690d11c8360e05d587360a8c52 Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Tue, 28 Sep 2021 17:27:49 -0700 Subject: [PATCH 2/2] update prebuilt document pages tests --- ..._document.test_document_specify_pages.yaml | 303 ++++++++++++------ ...ent_async.test_document_specify_pages.yaml | 287 +++++++++++++---- .../tests/test_document.py | 8 +- .../tests/test_document_async.py | 8 +- 4 files changed, 436 insertions(+), 170 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_document.test_document_specify_pages.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_document.test_document_specify_pages.yaml index b9c9fad2264a..b43d9991a0ab 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_document.test_document_specify_pages.yaml +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_document.test_document_specify_pages.yaml @@ -1933,19 +1933,19 @@ interactions: string: '' headers: apim-request-id: - - a49015ca-a72f-4662-8bdf-873c8028bcc2 + - b6fed110-20d4-4233-a5dc-239d980fad64 content-length: - '0' date: - - Mon, 27 Sep 2021 22:12:05 GMT + - Wed, 29 Sep 2021 00:23:36 GMT operation-location: - - https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/a49015ca-a72f-4662-8bdf-873c8028bcc2?api-version=2021-09-30-preview + - https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/b6fed110-20d4-4233-a5dc-239d980fad64?api-version=2021-09-30-preview strict-transport-security: - max-age=31536000; includeSubDomains; preload x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '300' + - '279' status: code: 202 message: Accepted @@ -1961,11 +1961,81 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/a49015ca-a72f-4662-8bdf-873c8028bcc2?api-version=2021-09-30-preview + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/b6fed110-20d4-4233-a5dc-239d980fad64?api-version=2021-09-30-preview response: body: - string: '{"status": "succeeded", "createdDateTime": "2021-09-27T22:12:06Z", - "lastUpdatedDateTime": "2021-09-27T22:12:10Z", "analyzeResult": {"apiVersion": + string: '{"status": "running", "createdDateTime": "2021-09-29T00:23:36Z", "lastUpdatedDateTime": + "2021-09-29T00:23:36Z"}' + headers: + apim-request-id: + - 60da8d6c-4773-434a-b6f9-e63791b0a92a + content-type: + - application/json; charset=utf-8 + date: + - Wed, 29 Sep 2021 00:23:40 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '84' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/b6fed110-20d4-4233-a5dc-239d980fad64?api-version=2021-09-30-preview + response: + body: + string: '{"status": "running", "createdDateTime": "2021-09-29T00:23:36Z", "lastUpdatedDateTime": + "2021-09-29T00:23:42Z"}' + headers: + apim-request-id: + - aafbfcfa-115c-485d-b260-51f54fd47b1d + content-type: + - application/json; charset=utf-8 + date: + - Wed, 29 Sep 2021 00:23:46 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '82' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/b6fed110-20d4-4233-a5dc-239d980fad64?api-version=2021-09-30-preview + response: + body: + string: '{"status": "succeeded", "createdDateTime": "2021-09-29T00:23:36Z", + "lastUpdatedDateTime": "2021-09-29T00:23:51Z", "analyzeResult": {"apiVersion": "2021-09-30-preview", "modelId": "prebuilt-document", "stringIndexType": "unicodeCodePoint", "content": "Company A Invoice\nInvoice For:\nAddress:\n567 Main St.\nRedmond, WA\n555-555-5555\nBilbo Baggins\n123 Hobbit Lane\nRedmond, WA\n555-555-5555\nItem\nQuantity\nPrice\nA\n1\n10.99\nB\n2\n14.67\nC\n4\n15.66\nD\n1\n12.00\nE\n4\n10.00\nF\n6\n12.00\nG\n8\n22.00\nSubtotal: @@ -2353,11 +2423,11 @@ interactions: 0, "length": 328}]}]}}' headers: apim-request-id: - - e77a6f0b-381e-4887-a027-d98b21d32f25 + - b2a1c850-4fcd-4cd2-ad45-1163d42bd7d4 content-type: - application/json; charset=utf-8 date: - - Mon, 27 Sep 2021 22:12:11 GMT + - Wed, 29 Sep 2021 00:23:51 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -2365,7 +2435,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '301' + - '234' status: code: 200 message: OK @@ -4297,25 +4367,25 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: POST - uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document:analyze?pages=1,3&stringIndexType=unicodeCodePoint&api-version=2021-09-30-preview + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document:analyze?pages=1%2C%203&stringIndexType=unicodeCodePoint&api-version=2021-09-30-preview response: body: string: '' headers: apim-request-id: - - a74bf020-007d-4466-8cd9-dba53ce952cb + - 50a76ad9-a564-487d-880c-9461c1643098 content-length: - '0' date: - - Mon, 27 Sep 2021 22:12:11 GMT + - Wed, 29 Sep 2021 00:23:51 GMT operation-location: - - https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/a74bf020-007d-4466-8cd9-dba53ce952cb?api-version=2021-09-30-preview + - https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/50a76ad9-a564-487d-880c-9461c1643098?api-version=2021-09-30-preview strict-transport-security: - max-age=31536000; includeSubDomains; preload x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '277' + - '280' status: code: 202 message: Accepted @@ -4331,11 +4401,11 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/a74bf020-007d-4466-8cd9-dba53ce952cb?api-version=2021-09-30-preview + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/50a76ad9-a564-487d-880c-9461c1643098?api-version=2021-09-30-preview response: body: - string: '{"status": "succeeded", "createdDateTime": "2021-09-27T22:12:12Z", - "lastUpdatedDateTime": "2021-09-27T22:12:16Z", "analyzeResult": {"apiVersion": + string: '{"status": "succeeded", "createdDateTime": "2021-09-29T00:23:52Z", + "lastUpdatedDateTime": "2021-09-29T00:23:57Z", "analyzeResult": {"apiVersion": "2021-09-30-preview", "modelId": "prebuilt-document", "stringIndexType": "unicodeCodePoint", "content": "Company A Invoice\nInvoice For:\nAddress:\n567 Main St.\nRedmond, WA\n555-555-5555\nBilbo Baggins\n123 Hobbit Lane\nRedmond, WA\n555-555-5555\nItem\nQuantity\nPrice\nA\n1\n10.99\nB\n2\n14.67\nC\n4\n15.66\nD\n1\n12.00\nE\n4\n10.00\nF\n6\n12.00\nG\n8\n22.00\nSubtotal: @@ -5073,18 +5143,21 @@ interactions: 3}]}, {"category": "Address", "content": "WA", "boundingRegions": [{"pageNumber": 3, "boundingBox": [1.6152, 2.0682, 1.8537, 2.0682, 1.8537, 2.1744, 1.6152, 2.1744]}], "confidence": 0.36, "spans": [{"offset": 391, "length": 2}]}, {"category": - "Address", "content": "123 Hobbit Lane Redmond, WA", "boundingRegions": [{"pageNumber": + "Address", "content": "123 Hobbit Lane Redmond", "boundingRegions": [{"pageNumber": 3, "boundingBox": [6.0165, 1.6707, 7.1006, 1.6707, 7.1006, 1.7854, 6.0165, - 1.7854]}, {"pageNumber": 3, "boundingBox": [6.0164, 1.891, 6.9793, 1.891, - 6.9793, 2.0275, 6.0164, 2.0275]}], "confidence": 0.76, "spans": [{"offset": - 421, "length": 27}]}, {"category": "Quantity", "subCategory": "Number", "content": + 1.7854]}, {"pageNumber": 3, "boundingBox": [6.0164, 1.891, 6.6861, 1.891, + 6.6861, 2.0275, 6.0164, 2.0275]}], "confidence": 0.87, "spans": [{"offset": + 421, "length": 23}]}, {"category": "Quantity", "subCategory": "Number", "content": "123", "boundingRegions": [{"pageNumber": 3, "boundingBox": [6.0165, 1.6772, 6.2434, 1.6772, 6.2434, 1.7854, 6.0165, 1.7854]}], "confidence": 0.8, "spans": - [{"offset": 421, "length": 3}]}, {"category": "Quantity", "subCategory": "Number", - "content": "3000.00", "boundingRegions": [{"pageNumber": 3, "boundingBox": - [6.1794, 4.9042, 6.7158, 4.9042, 6.7158, 5.0131, 6.1794, 5.0131]}], "confidence": - 0.8, "spans": [{"offset": 576, "length": 7}]}, {"category": "Quantity", "subCategory": - "Number", "content": "300.00", "boundingRegions": [{"pageNumber": 3, "boundingBox": + [{"offset": 421, "length": 3}]}, {"category": "Address", "content": "WA", + "boundingRegions": [{"pageNumber": 3, "boundingBox": [6.7408, 1.8982, 6.9793, + 1.8982, 6.9793, 2.0044, 6.7408, 2.0044]}], "confidence": 0.52, "spans": [{"offset": + 446, "length": 2}]}, {"category": "Quantity", "subCategory": "Number", "content": + "3000.00", "boundingRegions": [{"pageNumber": 3, "boundingBox": [6.1794, 4.9042, + 6.7158, 4.9042, 6.7158, 5.0131, 6.1794, 5.0131]}], "confidence": 0.8, "spans": + [{"offset": 576, "length": 7}]}, {"category": "Quantity", "subCategory": "Number", + "content": "300.00", "boundingRegions": [{"pageNumber": 3, "boundingBox": [5.836, 5.1245, 6.2887, 5.1245, 6.2887, 5.2333, 5.836, 5.2333]}], "confidence": 0.8, "spans": [{"offset": 589, "length": 6}]}, {"category": "Quantity", "subCategory": "Number", "content": "1000.00", "boundingRegions": [{"pageNumber": 3, "boundingBox": @@ -5104,11 +5177,11 @@ interactions: 1}}, "confidence": 1, "spans": []}]}}' headers: apim-request-id: - - 93c35193-ffe8-4374-af40-fad3b8eeb0bf + - ec118194-1444-4281-8916-4fe13e0b9043 content-type: - application/json; charset=utf-8 date: - - Mon, 27 Sep 2021 22:12:17 GMT + - Wed, 29 Sep 2021 00:23:58 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -5116,7 +5189,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '348' + - '433' status: code: 200 message: OK @@ -7054,19 +7127,19 @@ interactions: string: '' headers: apim-request-id: - - 17fdbc14-00c2-4a01-a75b-f1cd0e3b0d92 + - ee248df6-318f-4af8-b351-d55ecd399305 content-length: - '0' date: - - Mon, 27 Sep 2021 22:12:17 GMT + - Wed, 29 Sep 2021 00:23:58 GMT operation-location: - - https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/17fdbc14-00c2-4a01-a75b-f1cd0e3b0d92?api-version=2021-09-30-preview + - https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/ee248df6-318f-4af8-b351-d55ecd399305?api-version=2021-09-30-preview strict-transport-security: - max-age=31536000; includeSubDomains; preload x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '300' + - '291' status: code: 202 message: Accepted @@ -7082,11 +7155,81 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/17fdbc14-00c2-4a01-a75b-f1cd0e3b0d92?api-version=2021-09-30-preview + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/ee248df6-318f-4af8-b351-d55ecd399305?api-version=2021-09-30-preview + response: + body: + string: '{"status": "running", "createdDateTime": "2021-09-29T00:23:58Z", "lastUpdatedDateTime": + "2021-09-29T00:24:03Z"}' + headers: + apim-request-id: + - 1f1bc15c-7e84-487d-ab5f-74b4802809ca + content-type: + - application/json; charset=utf-8 + date: + - Wed, 29 Sep 2021 00:24:03 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '82' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/ee248df6-318f-4af8-b351-d55ecd399305?api-version=2021-09-30-preview response: body: - string: '{"status": "succeeded", "createdDateTime": "2021-09-27T22:12:18Z", - "lastUpdatedDateTime": "2021-09-27T22:12:23Z", "analyzeResult": {"apiVersion": + string: '{"status": "running", "createdDateTime": "2021-09-29T00:23:58Z", "lastUpdatedDateTime": + "2021-09-29T00:24:04Z"}' + headers: + apim-request-id: + - d3cbaa71-9f85-4ee6-8aeb-a59a7fbc4621 + content-type: + - application/json; charset=utf-8 + date: + - Wed, 29 Sep 2021 00:24:08 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '92' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/ee248df6-318f-4af8-b351-d55ecd399305?api-version=2021-09-30-preview + response: + body: + string: '{"status": "succeeded", "createdDateTime": "2021-09-29T00:23:58Z", + "lastUpdatedDateTime": "2021-09-29T00:24:13Z", "analyzeResult": {"apiVersion": "2021-09-30-preview", "modelId": "prebuilt-document", "stringIndexType": "unicodeCodePoint", "content": "Company A Invoice\nInvoice For:\nAddress:\n567 Main St.\nRedmond, WA\n555-555-5555\nBilbo Baggins\n123 Hobbit Lane\nRedmond, WA\n555-555-5555\nItem\nQuantity\nPrice\nA\n1\n10.99\nB\n2\n14.67\nC\n4\n15.66\nD\n1\n12.00\nE\n4\n10.00\nF\n6\n12.00\nG\n8\n22.00\nSubtotal: @@ -7472,11 +7615,11 @@ interactions: 0.8, "spans": [{"offset": 273, "length": 3}]}]}}' headers: apim-request-id: - - 3915f643-1aef-440a-96e0-8c00ac0ba2c6 + - 9b6def01-fd30-454e-8ae8-0d4bf2d3f437 content-type: - application/json; charset=utf-8 date: - - Mon, 27 Sep 2021 22:12:23 GMT + - Wed, 29 Sep 2021 00:24:13 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -7484,7 +7627,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '365' + - '192' status: code: 200 message: OK @@ -9416,25 +9559,25 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: POST - uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document:analyze?pages=1-2,3&stringIndexType=unicodeCodePoint&api-version=2021-09-30-preview + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document:analyze?pages=1-2%2C%203&stringIndexType=unicodeCodePoint&api-version=2021-09-30-preview response: body: string: '' headers: apim-request-id: - - a5ef81cd-99b1-4e9e-af00-b5643c382d94 + - 664ea576-6b53-4515-80e5-4b5bae1042cd content-length: - '0' date: - - Mon, 27 Sep 2021 22:12:24 GMT + - Wed, 29 Sep 2021 00:24:15 GMT operation-location: - - https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/a5ef81cd-99b1-4e9e-af00-b5643c382d94?api-version=2021-09-30-preview + - https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/664ea576-6b53-4515-80e5-4b5bae1042cd?api-version=2021-09-30-preview strict-transport-security: - max-age=31536000; includeSubDomains; preload x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '439' + - '472' status: code: 202 message: Accepted @@ -9450,46 +9593,11 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/a5ef81cd-99b1-4e9e-af00-b5643c382d94?api-version=2021-09-30-preview - response: - body: - string: '{"status": "running", "createdDateTime": "2021-09-27T22:12:24Z", "lastUpdatedDateTime": - "2021-09-27T22:12:29Z"}' - headers: - apim-request-id: - - 6fc9d451-4838-457f-8022-b6603e4321b3 - content-type: - - application/json; charset=utf-8 - date: - - Mon, 27 Sep 2021 22:12:29 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - transfer-encoding: - - chunked - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '85' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/a5ef81cd-99b1-4e9e-af00-b5643c382d94?api-version=2021-09-30-preview + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/664ea576-6b53-4515-80e5-4b5bae1042cd?api-version=2021-09-30-preview response: body: - string: '{"status": "succeeded", "createdDateTime": "2021-09-27T22:12:24Z", - "lastUpdatedDateTime": "2021-09-27T22:12:29Z", "analyzeResult": {"apiVersion": + string: '{"status": "succeeded", "createdDateTime": "2021-09-29T00:24:14Z", + "lastUpdatedDateTime": "2021-09-29T00:24:19Z", "analyzeResult": {"apiVersion": "2021-09-30-preview", "modelId": "prebuilt-document", "stringIndexType": "unicodeCodePoint", "content": "Company A Invoice\nInvoice For:\nAddress:\n567 Main St.\nRedmond, WA\n555-555-5555\nBilbo Baggins\n123 Hobbit Lane\nRedmond, WA\n555-555-5555\nItem\nQuantity\nPrice\nA\n1\n10.99\nB\n2\n14.67\nC\n4\n15.66\nD\n1\n12.00\nE\n4\n10.00\nF\n6\n12.00\nG\n8\n22.00\nSubtotal: @@ -10153,7 +10261,7 @@ interactions: 1.9554, 0.8852, 1.9554]}], "confidence": 0.8, "spans": [{"offset": 40, "length": 3}]}, {"category": "Address", "content": "WA", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1.6152, 2.0682, 1.8537, 2.0682, 1.8537, 2.1744, 1.6152, - 2.1744]}], "confidence": 0.37, "spans": [{"offset": 62, "length": 2}]}, {"category": + 2.1744]}], "confidence": 0.38, "spans": [{"offset": 62, "length": 2}]}, {"category": "Address", "content": "123 Hobbit Lane Redmond, WA", "boundingRegions": [{"pageNumber": 1, "boundingBox": [6.0165, 1.6707, 7.1006, 1.6707, 7.1006, 1.7854, 6.0165, 1.7854]}, {"pageNumber": 1, "boundingBox": [6.0164, 1.891, 6.9793, 1.891, @@ -10229,21 +10337,18 @@ interactions: 3}]}, {"category": "Address", "content": "WA", "boundingRegions": [{"pageNumber": 3, "boundingBox": [1.6152, 2.0682, 1.8537, 2.0682, 1.8537, 2.1744, 1.6152, 2.1744]}], "confidence": 0.36, "spans": [{"offset": 391, "length": 2}]}, {"category": - "Address", "content": "123 Hobbit Lane Redmond", "boundingRegions": [{"pageNumber": + "Address", "content": "123 Hobbit Lane Redmond, WA", "boundingRegions": [{"pageNumber": 3, "boundingBox": [6.0165, 1.6707, 7.1006, 1.6707, 7.1006, 1.7854, 6.0165, - 1.7854]}, {"pageNumber": 3, "boundingBox": [6.0164, 1.891, 6.6861, 1.891, - 6.6861, 2.0275, 6.0164, 2.0275]}], "confidence": 0.87, "spans": [{"offset": - 421, "length": 23}]}, {"category": "Quantity", "subCategory": "Number", "content": + 1.7854]}, {"pageNumber": 3, "boundingBox": [6.0164, 1.891, 6.9793, 1.891, + 6.9793, 2.0275, 6.0164, 2.0275]}], "confidence": 0.76, "spans": [{"offset": + 421, "length": 27}]}, {"category": "Quantity", "subCategory": "Number", "content": "123", "boundingRegions": [{"pageNumber": 3, "boundingBox": [6.0165, 1.6772, 6.2434, 1.6772, 6.2434, 1.7854, 6.0165, 1.7854]}], "confidence": 0.8, "spans": - [{"offset": 421, "length": 3}]}, {"category": "Address", "content": "WA", - "boundingRegions": [{"pageNumber": 3, "boundingBox": [6.7408, 1.8982, 6.9793, - 1.8982, 6.9793, 2.0044, 6.7408, 2.0044]}], "confidence": 0.52, "spans": [{"offset": - 446, "length": 2}]}, {"category": "Quantity", "subCategory": "Number", "content": - "3000.00", "boundingRegions": [{"pageNumber": 3, "boundingBox": [6.1794, 4.9042, - 6.7158, 4.9042, 6.7158, 5.0131, 6.1794, 5.0131]}], "confidence": 0.8, "spans": - [{"offset": 576, "length": 7}]}, {"category": "Quantity", "subCategory": "Number", - "content": "300.00", "boundingRegions": [{"pageNumber": 3, "boundingBox": + [{"offset": 421, "length": 3}]}, {"category": "Quantity", "subCategory": "Number", + "content": "3000.00", "boundingRegions": [{"pageNumber": 3, "boundingBox": + [6.1794, 4.9042, 6.7158, 4.9042, 6.7158, 5.0131, 6.1794, 5.0131]}], "confidence": + 0.8, "spans": [{"offset": 576, "length": 7}]}, {"category": "Quantity", "subCategory": + "Number", "content": "300.00", "boundingRegions": [{"pageNumber": 3, "boundingBox": [5.836, 5.1245, 6.2887, 5.1245, 6.2887, 5.2333, 5.836, 5.2333]}], "confidence": 0.8, "spans": [{"offset": 589, "length": 6}]}, {"category": "Quantity", "subCategory": "Number", "content": "1000.00", "boundingRegions": [{"pageNumber": 3, "boundingBox": @@ -10261,11 +10366,11 @@ interactions: 328, "length": 334}]}]}}' headers: apim-request-id: - - 31f6db60-e21a-497b-bd17-b462906a2ee2 + - a73a1ff2-240e-4fb9-919d-2faa41498cdf content-type: - application/json; charset=utf-8 date: - - Mon, 27 Sep 2021 22:12:34 GMT + - Wed, 29 Sep 2021 00:24:20 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -10273,7 +10378,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '302' + - '423' status: code: 200 message: OK diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_document_async.test_document_specify_pages.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_document_async.test_document_specify_pages.yaml index cc2a4c20ac4a..c0f7602b33ef 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_document_async.test_document_specify_pages.yaml +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_document_async.test_document_specify_pages.yaml @@ -1926,13 +1926,13 @@ interactions: body: string: '' headers: - apim-request-id: 86c78f27-e794-4591-a9ff-ae3ad6a3bfbc + apim-request-id: 9bad1202-da07-4b17-82cb-260d61a30cc2 content-length: '0' - date: Mon, 27 Sep 2021 22:16:45 GMT - operation-location: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/86c78f27-e794-4591-a9ff-ae3ad6a3bfbc?api-version=2021-09-30-preview + date: Wed, 29 Sep 2021 00:22:06 GMT + operation-location: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/9bad1202-da07-4b17-82cb-260d61a30cc2?api-version=2021-09-30-preview strict-transport-security: max-age=31536000; includeSubDomains; preload x-content-type-options: nosniff - x-envoy-upstream-service-time: '245' + x-envoy-upstream-service-time: '270' status: code: 202 message: Accepted @@ -1943,11 +1943,57 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/86c78f27-e794-4591-a9ff-ae3ad6a3bfbc?api-version=2021-09-30-preview + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/9bad1202-da07-4b17-82cb-260d61a30cc2?api-version=2021-09-30-preview response: body: - string: '{"status": "succeeded", "createdDateTime": "2021-09-27T22:16:45Z", - "lastUpdatedDateTime": "2021-09-27T22:16:50Z", "analyzeResult": {"apiVersion": + string: '{"status": "running", "createdDateTime": "2021-09-29T00:22:07Z", "lastUpdatedDateTime": + "2021-09-29T00:22:12Z"}' + headers: + apim-request-id: 835df26b-2327-4214-985e-9de1ea6718be + content-type: application/json; charset=utf-8 + date: Wed, 29 Sep 2021 00:22:12 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '967' + status: + code: 200 + message: OK + url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/9bad1202-da07-4b17-82cb-260d61a30cc2?api-version=2021-09-30-preview +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/9bad1202-da07-4b17-82cb-260d61a30cc2?api-version=2021-09-30-preview + response: + body: + string: '{"status": "running", "createdDateTime": "2021-09-29T00:22:07Z", "lastUpdatedDateTime": + "2021-09-29T00:22:12Z"}' + headers: + apim-request-id: e61b5217-c9c3-4721-b28a-89c530d7e533 + content-type: application/json; charset=utf-8 + date: Wed, 29 Sep 2021 00:22:17 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '85' + status: + code: 200 + message: OK + url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/9bad1202-da07-4b17-82cb-260d61a30cc2?api-version=2021-09-30-preview +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/9bad1202-da07-4b17-82cb-260d61a30cc2?api-version=2021-09-30-preview + response: + body: + string: '{"status": "succeeded", "createdDateTime": "2021-09-29T00:22:07Z", + "lastUpdatedDateTime": "2021-09-29T00:22:22Z", "analyzeResult": {"apiVersion": "2021-09-30-preview", "modelId": "prebuilt-document", "stringIndexType": "unicodeCodePoint", "content": "Company A Invoice\nInvoice For:\nAddress:\n567 Main St.\nRedmond, WA\n555-555-5555\nBilbo Baggins\n123 Hobbit Lane\nRedmond, WA\n555-555-5555\nItem\nQuantity\nPrice\nA\n1\n10.99\nB\n2\n14.67\nC\n4\n15.66\nD\n1\n12.00\nE\n4\n10.00\nF\n6\n12.00\nG\n8\n22.00\nSubtotal: @@ -2305,7 +2351,7 @@ interactions: 1.9554, 0.8852, 1.9554]}], "confidence": 0.8, "spans": [{"offset": 40, "length": 3}]}, {"category": "Address", "content": "WA", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1.6152, 2.0682, 1.8537, 2.0682, 1.8537, 2.1744, 1.6152, - 2.1744]}], "confidence": 0.37, "spans": [{"offset": 62, "length": 2}]}, {"category": + 2.1744]}], "confidence": 0.38, "spans": [{"offset": 62, "length": 2}]}, {"category": "Address", "content": "123 Hobbit Lane Redmond, WA", "boundingRegions": [{"pageNumber": 1, "boundingBox": [6.0165, 1.6707, 7.1006, 1.6707, 7.1006, 1.7854, 6.0165, 1.7854]}, {"pageNumber": 1, "boundingBox": [6.0164, 1.891, 6.9793, 1.891, @@ -2334,17 +2380,17 @@ interactions: "valueString": "en-US", "confidence": 1}}, "confidence": 1, "spans": [{"offset": 0, "length": 328}]}]}}' headers: - apim-request-id: 0a1cf5c9-020d-4d87-b76a-f681e7efd49f + apim-request-id: 7067430f-5deb-492f-99b0-7af27b6249bb content-type: application/json; charset=utf-8 - date: Mon, 27 Sep 2021 22:16:51 GMT + date: Wed, 29 Sep 2021 00:22:24 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '204' + x-envoy-upstream-service-time: '394' status: code: 200 message: OK - url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/86c78f27-e794-4591-a9ff-ae3ad6a3bfbc?api-version=2021-09-30-preview + url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/9bad1202-da07-4b17-82cb-260d61a30cc2?api-version=2021-09-30-preview - request: body: !!binary | JVBERi0xLjcNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFIvTGFu @@ -4267,33 +4313,79 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: POST - uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document:analyze?pages=1,3&stringIndexType=unicodeCodePoint&api-version=2021-09-30-preview + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document:analyze?pages=1,%203&stringIndexType=unicodeCodePoint&api-version=2021-09-30-preview response: body: string: '' headers: - apim-request-id: 703431d7-56be-481b-ad35-006ca1788ecd + apim-request-id: 71e0296f-c58c-4326-90dc-2f71835167f3 content-length: '0' - date: Mon, 27 Sep 2021 22:16:51 GMT - operation-location: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/703431d7-56be-481b-ad35-006ca1788ecd?api-version=2021-09-30-preview + date: Wed, 29 Sep 2021 00:22:24 GMT + operation-location: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/71e0296f-c58c-4326-90dc-2f71835167f3?api-version=2021-09-30-preview strict-transport-security: max-age=31536000; includeSubDomains; preload x-content-type-options: nosniff - x-envoy-upstream-service-time: '299' + x-envoy-upstream-service-time: '292' status: code: 202 message: Accepted - url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document:analyze?pages=1,3&stringIndexType=unicodeCodePoint&api-version=2021-09-30-preview + url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document:analyze?pages=1,%203&stringIndexType=unicodeCodePoint&api-version=2021-09-30-preview +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/71e0296f-c58c-4326-90dc-2f71835167f3?api-version=2021-09-30-preview + response: + body: + string: '{"status": "running", "createdDateTime": "2021-09-29T00:22:24Z", "lastUpdatedDateTime": + "2021-09-29T00:22:29Z"}' + headers: + apim-request-id: ea0d16cb-f045-47b1-8851-dbdc6c32f709 + content-type: application/json; charset=utf-8 + date: Wed, 29 Sep 2021 00:22:30 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '1119' + status: + code: 200 + message: OK + url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/71e0296f-c58c-4326-90dc-2f71835167f3?api-version=2021-09-30-preview - request: body: null headers: User-Agent: - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/703431d7-56be-481b-ad35-006ca1788ecd?api-version=2021-09-30-preview + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/71e0296f-c58c-4326-90dc-2f71835167f3?api-version=2021-09-30-preview response: body: - string: '{"status": "succeeded", "createdDateTime": "2021-09-27T22:16:51Z", - "lastUpdatedDateTime": "2021-09-27T22:16:56Z", "analyzeResult": {"apiVersion": + string: '{"status": "running", "createdDateTime": "2021-09-29T00:22:24Z", "lastUpdatedDateTime": + "2021-09-29T00:22:29Z"}' + headers: + apim-request-id: 2c16fcaa-1423-4095-99e6-8677611224cc + content-type: application/json; charset=utf-8 + date: Wed, 29 Sep 2021 00:22:36 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '88' + status: + code: 200 + message: OK + url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/71e0296f-c58c-4326-90dc-2f71835167f3?api-version=2021-09-30-preview +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/71e0296f-c58c-4326-90dc-2f71835167f3?api-version=2021-09-30-preview + response: + body: + string: '{"status": "succeeded", "createdDateTime": "2021-09-29T00:22:24Z", + "lastUpdatedDateTime": "2021-09-29T00:22:39Z", "analyzeResult": {"apiVersion": "2021-09-30-preview", "modelId": "prebuilt-document", "stringIndexType": "unicodeCodePoint", "content": "Company A Invoice\nInvoice For:\nAddress:\n567 Main St.\nRedmond, WA\n555-555-5555\nBilbo Baggins\n123 Hobbit Lane\nRedmond, WA\n555-555-5555\nItem\nQuantity\nPrice\nA\n1\n10.99\nB\n2\n14.67\nC\n4\n15.66\nD\n1\n12.00\nE\n4\n10.00\nF\n6\n12.00\nG\n8\n22.00\nSubtotal: @@ -5061,17 +5153,17 @@ interactions: "fields": {"Locale": {"type": "string", "valueString": "en-US", "confidence": 1}}, "confidence": 1, "spans": []}]}}' headers: - apim-request-id: 07b7ada2-d40c-4160-85c2-d0d55aff60c7 + apim-request-id: 3bab281e-7a43-4b07-9e19-f7d00ed2b835 content-type: application/json; charset=utf-8 - date: Mon, 27 Sep 2021 22:16:56 GMT + date: Wed, 29 Sep 2021 00:22:41 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '314' + x-envoy-upstream-service-time: '374' status: code: 200 message: OK - url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/703431d7-56be-481b-ad35-006ca1788ecd?api-version=2021-09-30-preview + url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/71e0296f-c58c-4326-90dc-2f71835167f3?api-version=2021-09-30-preview - request: body: !!binary | JVBERi0xLjcNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFIvTGFu @@ -6999,13 +7091,13 @@ interactions: body: string: '' headers: - apim-request-id: acf4fa68-0132-4560-8315-fb5a9e1736b3 + apim-request-id: 61af3f4d-969f-4b8a-88cc-e003602b2ff8 content-length: '0' - date: Mon, 27 Sep 2021 22:16:56 GMT - operation-location: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/acf4fa68-0132-4560-8315-fb5a9e1736b3?api-version=2021-09-30-preview + date: Wed, 29 Sep 2021 00:22:42 GMT + operation-location: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/61af3f4d-969f-4b8a-88cc-e003602b2ff8?api-version=2021-09-30-preview strict-transport-security: max-age=31536000; includeSubDomains; preload x-content-type-options: nosniff - x-envoy-upstream-service-time: '275' + x-envoy-upstream-service-time: '291' status: code: 202 message: Accepted @@ -7016,34 +7108,57 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/acf4fa68-0132-4560-8315-fb5a9e1736b3?api-version=2021-09-30-preview + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/61af3f4d-969f-4b8a-88cc-e003602b2ff8?api-version=2021-09-30-preview + response: + body: + string: '{"status": "running", "createdDateTime": "2021-09-29T00:22:42Z", "lastUpdatedDateTime": + "2021-09-29T00:22:47Z"}' + headers: + apim-request-id: 07ee699a-6e6a-49a6-8c04-8ad0901cc608 + content-type: application/json; charset=utf-8 + date: Wed, 29 Sep 2021 00:22:47 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '83' + status: + code: 200 + message: OK + url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/61af3f4d-969f-4b8a-88cc-e003602b2ff8?api-version=2021-09-30-preview +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/61af3f4d-969f-4b8a-88cc-e003602b2ff8?api-version=2021-09-30-preview response: body: - string: '{"status": "running", "createdDateTime": "2021-09-27T22:16:57Z", "lastUpdatedDateTime": - "2021-09-27T22:17:02Z"}' + string: '{"status": "running", "createdDateTime": "2021-09-29T00:22:42Z", "lastUpdatedDateTime": + "2021-09-29T00:22:49Z"}' headers: - apim-request-id: 709cf214-614c-44c4-b167-9739ff68e371 + apim-request-id: 040d010d-026a-4b58-badd-e4040a9f5d45 content-type: application/json; charset=utf-8 - date: Mon, 27 Sep 2021 22:17:02 GMT + date: Wed, 29 Sep 2021 00:22:52 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '86' + x-envoy-upstream-service-time: '74' status: code: 200 message: OK - url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/acf4fa68-0132-4560-8315-fb5a9e1736b3?api-version=2021-09-30-preview + url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/61af3f4d-969f-4b8a-88cc-e003602b2ff8?api-version=2021-09-30-preview - request: body: null headers: User-Agent: - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/acf4fa68-0132-4560-8315-fb5a9e1736b3?api-version=2021-09-30-preview + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/61af3f4d-969f-4b8a-88cc-e003602b2ff8?api-version=2021-09-30-preview response: body: - string: '{"status": "succeeded", "createdDateTime": "2021-09-27T22:16:57Z", - "lastUpdatedDateTime": "2021-09-27T22:17:03Z", "analyzeResult": {"apiVersion": + string: '{"status": "succeeded", "createdDateTime": "2021-09-29T00:22:42Z", + "lastUpdatedDateTime": "2021-09-29T00:22:58Z", "analyzeResult": {"apiVersion": "2021-09-30-preview", "modelId": "prebuilt-document", "stringIndexType": "unicodeCodePoint", "content": "Company A Invoice\nInvoice For:\nAddress:\n567 Main St.\nRedmond, WA\n555-555-5555\nBilbo Baggins\n123 Hobbit Lane\nRedmond, WA\n555-555-5555\nItem\nQuantity\nPrice\nA\n1\n10.99\nB\n2\n14.67\nC\n4\n15.66\nD\n1\n12.00\nE\n4\n10.00\nF\n6\n12.00\nG\n8\n22.00\nSubtotal: @@ -7428,17 +7543,17 @@ interactions: [5.942, 5.5645, 6.3987, 5.5645, 6.3987, 5.6733, 5.942, 5.6733]}], "confidence": 0.8, "spans": [{"offset": 273, "length": 3}]}]}}' headers: - apim-request-id: 39f305f7-365d-4b08-8323-f869a7235ef7 + apim-request-id: 584cec50-be15-4bb3-bb39-6af13808322d content-type: application/json; charset=utf-8 - date: Mon, 27 Sep 2021 22:17:08 GMT + date: Wed, 29 Sep 2021 00:22:58 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '340' + x-envoy-upstream-service-time: '531' status: code: 200 message: OK - url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/acf4fa68-0132-4560-8315-fb5a9e1736b3?api-version=2021-09-30-preview + url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/61af3f4d-969f-4b8a-88cc-e003602b2ff8?api-version=2021-09-30-preview - request: body: !!binary | JVBERi0xLjcNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFIvTGFu @@ -9361,56 +9476,102 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: POST - uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document:analyze?pages=1-2,3&stringIndexType=unicodeCodePoint&api-version=2021-09-30-preview + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document:analyze?pages=1-2,%203&stringIndexType=unicodeCodePoint&api-version=2021-09-30-preview response: body: string: '' headers: - apim-request-id: 8444d484-73c9-410c-a4f8-76c20e68e0e0 + apim-request-id: 3fd811a6-78be-4df3-9adb-b59345aee95b content-length: '0' - date: Mon, 27 Sep 2021 22:17:09 GMT - operation-location: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/8444d484-73c9-410c-a4f8-76c20e68e0e0?api-version=2021-09-30-preview + date: Wed, 29 Sep 2021 00:22:59 GMT + operation-location: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/3fd811a6-78be-4df3-9adb-b59345aee95b?api-version=2021-09-30-preview strict-transport-security: max-age=31536000; includeSubDomains; preload x-content-type-options: nosniff - x-envoy-upstream-service-time: '303' + x-envoy-upstream-service-time: '394' status: code: 202 message: Accepted - url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document:analyze?pages=1-2,3&stringIndexType=unicodeCodePoint&api-version=2021-09-30-preview + url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document:analyze?pages=1-2,%203&stringIndexType=unicodeCodePoint&api-version=2021-09-30-preview +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/3fd811a6-78be-4df3-9adb-b59345aee95b?api-version=2021-09-30-preview + response: + body: + string: '{"status": "running", "createdDateTime": "2021-09-29T00:22:59Z", "lastUpdatedDateTime": + "2021-09-29T00:23:04Z"}' + headers: + apim-request-id: 4b69e45e-9483-499f-823e-c7421b21ca67 + content-type: application/json; charset=utf-8 + date: Wed, 29 Sep 2021 00:23:04 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '84' + status: + code: 200 + message: OK + url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/3fd811a6-78be-4df3-9adb-b59345aee95b?api-version=2021-09-30-preview +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/3fd811a6-78be-4df3-9adb-b59345aee95b?api-version=2021-09-30-preview + response: + body: + string: '{"status": "running", "createdDateTime": "2021-09-29T00:22:59Z", "lastUpdatedDateTime": + "2021-09-29T00:23:05Z"}' + headers: + apim-request-id: 3a1c448d-ff2d-4447-bb44-aceb2b903554 + content-type: application/json; charset=utf-8 + date: Wed, 29 Sep 2021 00:23:09 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '80' + status: + code: 200 + message: OK + url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/3fd811a6-78be-4df3-9adb-b59345aee95b?api-version=2021-09-30-preview - request: body: null headers: User-Agent: - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/8444d484-73c9-410c-a4f8-76c20e68e0e0?api-version=2021-09-30-preview + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/3fd811a6-78be-4df3-9adb-b59345aee95b?api-version=2021-09-30-preview response: body: - string: '{"status": "running", "createdDateTime": "2021-09-27T22:17:09Z", "lastUpdatedDateTime": - "2021-09-27T22:17:14Z"}' + string: '{"status": "running", "createdDateTime": "2021-09-29T00:22:59Z", "lastUpdatedDateTime": + "2021-09-29T00:23:05Z"}' headers: - apim-request-id: f92e0b58-e4e0-42f5-b032-b71657b394a6 + apim-request-id: 5b3cb079-64f2-4132-ba97-35ea7792f69b content-type: application/json; charset=utf-8 - date: Mon, 27 Sep 2021 22:17:14 GMT + date: Wed, 29 Sep 2021 00:23:14 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '86' + x-envoy-upstream-service-time: '80' status: code: 200 message: OK - url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/8444d484-73c9-410c-a4f8-76c20e68e0e0?api-version=2021-09-30-preview + url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/3fd811a6-78be-4df3-9adb-b59345aee95b?api-version=2021-09-30-preview - request: body: null headers: User-Agent: - azsdk-python-ai-formrecognizer/3.2.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/8444d484-73c9-410c-a4f8-76c20e68e0e0?api-version=2021-09-30-preview + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/3fd811a6-78be-4df3-9adb-b59345aee95b?api-version=2021-09-30-preview response: body: - string: '{"status": "succeeded", "createdDateTime": "2021-09-27T22:17:09Z", - "lastUpdatedDateTime": "2021-09-27T22:17:15Z", "analyzeResult": {"apiVersion": + string: '{"status": "succeeded", "createdDateTime": "2021-09-29T00:22:59Z", + "lastUpdatedDateTime": "2021-09-29T00:23:15Z", "analyzeResult": {"apiVersion": "2021-09-30-preview", "modelId": "prebuilt-document", "stringIndexType": "unicodeCodePoint", "content": "Company A Invoice\nInvoice For:\nAddress:\n567 Main St.\nRedmond, WA\n555-555-5555\nBilbo Baggins\n123 Hobbit Lane\nRedmond, WA\n555-555-5555\nItem\nQuantity\nPrice\nA\n1\n10.99\nB\n2\n14.67\nC\n4\n15.66\nD\n1\n12.00\nE\n4\n10.00\nF\n6\n12.00\nG\n8\n22.00\nSubtotal: @@ -10178,15 +10339,15 @@ interactions: "valueString": "en-US", "confidence": 1}}, "confidence": 1, "spans": [{"offset": 328, "length": 334}]}]}}' headers: - apim-request-id: 2c2d4ace-2509-44a2-86f3-845828e56825 + apim-request-id: fece3627-e3fd-4220-bc6c-7639cdfa1935 content-type: application/json; charset=utf-8 - date: Mon, 27 Sep 2021 22:17:19 GMT + date: Wed, 29 Sep 2021 00:23:20 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '348' + x-envoy-upstream-service-time: '517' status: code: 200 message: OK - url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/8444d484-73c9-410c-a4f8-76c20e68e0e0?api-version=2021-09-30-preview + url: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/3fd811a6-78be-4df3-9adb-b59345aee95b?api-version=2021-09-30-preview version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_document.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_document.py index 9882b32736b4..232bc6bbaf36 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_document.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_document.py @@ -141,18 +141,18 @@ def test_document_specify_pages(self, client): with open(self.multipage_invoice_pdf, "rb") as fd: document = fd.read() - poller = client.begin_analyze_document("prebuilt-document", document, pages=["1"]) + poller = client.begin_analyze_document("prebuilt-document", document, pages="1") result = poller.result() assert len(result.pages) == 1 - poller = client.begin_analyze_document("prebuilt-document", document, pages=["1", "3"]) + poller = client.begin_analyze_document("prebuilt-document", document, pages="1, 3") result = poller.result() assert len(result.pages) == 2 - poller = client.begin_analyze_document("prebuilt-document", document, pages=["1-2"]) + poller = client.begin_analyze_document("prebuilt-document", document, pages="1-2") result = poller.result() assert len(result.pages) == 2 - poller = client.begin_analyze_document("prebuilt-document", document, pages=["1-2", "3"]) + poller = client.begin_analyze_document("prebuilt-document", document, pages="1-2, 3") result = poller.result() assert len(result.pages) == 3 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_document_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_document_async.py index f0f3e24bd199..00f53479f42c 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_document_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_document_async.py @@ -146,18 +146,18 @@ async def test_document_specify_pages(self, client): document = fd.read() async with client: - poller = await client.begin_analyze_document("prebuilt-document", document, pages=["1"]) + poller = await client.begin_analyze_document("prebuilt-document", document, pages="1") result = await poller.result() assert len(result.pages) == 1 - poller = await client.begin_analyze_document("prebuilt-document", document, pages=["1", "3"]) + poller = await client.begin_analyze_document("prebuilt-document", document, pages="1, 3") result = await poller.result() assert len(result.pages) == 2 - poller = await client.begin_analyze_document("prebuilt-document", document, pages=["1-2"]) + poller = await client.begin_analyze_document("prebuilt-document", document, pages="1-2") result = await poller.result() assert len(result.pages) == 2 - poller = await client.begin_analyze_document("prebuilt-document", document, pages=["1-2", "3"]) + poller = await client.begin_analyze_document("prebuilt-document", document, pages="1-2, 3") result = await poller.result() assert len(result.pages) == 3