From eaa16795e75b940747df66d03927aeaba9dddd50 Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Thu, 11 Mar 2021 15:18:12 -0800 Subject: [PATCH] get poller result instead of wait --- ...ntent.test_content_language_specified.yaml | 20 ++-- ...async.test_content_language_specified.yaml | 22 ++--- ...m_url.test_content_language_specified.yaml | 22 ++--- ...async.test_content_language_specified.yaml | 24 ++--- ...invoice.test_invoice_locale_specified.yaml | 77 ++++++++------- ...e_async.test_invoice_locale_specified.yaml | 81 +++++++++------- ...receipt.test_receipt_locale_specified.yaml | 92 +++++++++--------- ...t_async.test_receipt_locale_specified.yaml | 94 ++++++++++--------- .../tests/test_business_card.py | 3 +- .../tests/test_business_card_async.py | 3 +- .../tests/test_business_card_from_url.py | 3 +- .../test_business_card_from_url_async.py | 3 +- .../tests/test_content.py | 3 +- .../tests/test_content_async.py | 3 +- .../tests/test_content_from_url.py | 3 +- .../tests/test_content_from_url_async.py | 3 +- .../tests/test_invoice.py | 3 +- .../tests/test_invoice_async.py | 3 +- .../tests/test_invoice_from_url.py | 3 +- .../tests/test_invoice_from_url_async.py | 3 +- .../tests/test_receipt.py | 3 +- .../tests/test_receipt_async.py | 3 +- .../tests/test_receipt_from_url.py | 3 +- .../tests/test_receipt_from_url_async.py | 3 +- 24 files changed, 259 insertions(+), 221 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content.test_content_language_specified.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content.test_content_language_specified.yaml index c2b7d584cd78..b3a5cfa6600f 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content.test_content_language_specified.yaml +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content.test_content_language_specified.yaml @@ -22,19 +22,19 @@ interactions: string: '' headers: apim-request-id: - - f1519c74-698b-4054-9470-903e9a12c8ac + - b5f7cdf5-9de9-4135-af0c-b4bf74df26ef content-length: - '0' date: - - Mon, 01 Mar 2021 18:47:37 GMT + - Thu, 11 Mar 2021 23:12:40 GMT operation-location: - - https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/layout/analyzeResults/f1519c74-698b-4054-9470-903e9a12c8ac + - https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/layout/analyzeResults/b5f7cdf5-9de9-4135-af0c-b4bf74df26ef strict-transport-security: - max-age=31536000; includeSubDomains; preload x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '900' + - '114' status: code: 202 message: Accepted @@ -50,11 +50,11 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.1.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/layout/analyzeResults/f1519c74-698b-4054-9470-903e9a12c8ac + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/layout/analyzeResults/b5f7cdf5-9de9-4135-af0c-b4bf74df26ef response: body: - string: '{"status": "succeeded", "createdDateTime": "2021-03-01T18:47:37Z", - "lastUpdatedDateTime": "2021-03-01T18:47:41Z", "analyzeResult": {"version": + string: '{"status": "succeeded", "createdDateTime": "2021-03-11T23:12:40Z", + "lastUpdatedDateTime": "2021-03-11T23:12:44Z", "analyzeResult": {"version": "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 1700, "height": 2200, "unit": "pixel", "language": "de", "lines": [{"boundingBox": [136, 139, 351, 138, 351, 166, 136, 166], "text": "Purchase Order", "appearance": {"style": @@ -409,19 +409,19 @@ interactions: "boundingBox": [1058, 1563, 1555, 1563, 1555, 1707, 1058, 1707]}]}]}}' headers: apim-request-id: - - c88f709e-df94-4e00-91bf-b9fcde7d22d3 + - af63c051-8872-4cde-b01a-b18b12c86210 content-length: - '24449' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Mar 2021 18:47:43 GMT + - Thu, 11 Mar 2021 23:12:45 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '41' + - '17' status: code: 200 message: OK diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_async.test_content_language_specified.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_async.test_content_language_specified.yaml index 140acdb97979..13eef9165818 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_async.test_content_language_specified.yaml +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_async.test_content_language_specified.yaml @@ -15,13 +15,13 @@ interactions: body: string: '' headers: - apim-request-id: 782ae0c2-0a1d-476f-9870-7ed206734b19 + apim-request-id: 01f39fc2-8131-4ced-aa23-6f316fcb6804 content-length: '0' - date: Wed, 03 Mar 2021 19:28:03 GMT - operation-location: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/layout/analyzeResults/782ae0c2-0a1d-476f-9870-7ed206734b19 + date: Thu, 11 Mar 2021 23:11:45 GMT + operation-location: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/layout/analyzeResults/01f39fc2-8131-4ced-aa23-6f316fcb6804 strict-transport-security: max-age=31536000; includeSubDomains; preload x-content-type-options: nosniff - x-envoy-upstream-service-time: '115' + x-envoy-upstream-service-time: '107' status: code: 202 message: Accepted @@ -32,11 +32,11 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.1.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/layout/analyzeResults/782ae0c2-0a1d-476f-9870-7ed206734b19 + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/layout/analyzeResults/01f39fc2-8131-4ced-aa23-6f316fcb6804 response: body: - string: '{"status": "succeeded", "createdDateTime": "2021-03-03T19:28:03Z", - "lastUpdatedDateTime": "2021-03-03T19:28:07Z", "analyzeResult": {"version": + string: '{"status": "succeeded", "createdDateTime": "2021-03-11T23:11:46Z", + "lastUpdatedDateTime": "2021-03-11T23:11:49Z", "analyzeResult": {"version": "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 1700, "height": 2200, "unit": "pixel", "language": "de", "lines": [{"boundingBox": [136, 139, 351, 138, 351, 166, 136, 166], "text": "Purchase Order", "appearance": {"style": @@ -390,15 +390,15 @@ interactions: 1663, 1543, 1663, 1543, 1708, 1308, 1707], "elements": ["#/readResults/0/lines/47/words/0"]}], "boundingBox": [1058, 1563, 1555, 1563, 1555, 1707, 1058, 1707]}]}]}}' headers: - apim-request-id: 5dd28a4d-8ef9-467c-85f8-5634b1714981 + apim-request-id: d72b6359-0d31-4bd3-b06f-306c2ecd6a73 content-length: '24449' content-type: application/json; charset=utf-8 - date: Wed, 03 Mar 2021 19:28:08 GMT + date: Thu, 11 Mar 2021 23:11:51 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload x-content-type-options: nosniff - x-envoy-upstream-service-time: '20' + x-envoy-upstream-service-time: '22' status: code: 200 message: OK - url: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/layout/analyzeResults/782ae0c2-0a1d-476f-9870-7ed206734b19 + url: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/layout/analyzeResults/01f39fc2-8131-4ced-aa23-6f316fcb6804 version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_from_url.test_content_language_specified.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_from_url.test_content_language_specified.yaml index 55d5517195ff..6048ee82cab0 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_from_url.test_content_language_specified.yaml +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_from_url.test_content_language_specified.yaml @@ -9,7 +9,7 @@ interactions: Connection: - keep-alive Content-Length: - - '213' + - '223' Content-Type: - application/json User-Agent: @@ -21,19 +21,19 @@ interactions: string: '' headers: apim-request-id: - - cb6b1625-48d3-4000-9820-54bf9a7f866f + - 65d1fabf-2997-4968-9599-84321346785a content-length: - '0' date: - - Mon, 01 Mar 2021 18:41:18 GMT + - Thu, 11 Mar 2021 23:12:20 GMT operation-location: - - https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/layout/analyzeResults/cb6b1625-48d3-4000-9820-54bf9a7f866f + - https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/layout/analyzeResults/65d1fabf-2997-4968-9599-84321346785a strict-transport-security: - max-age=31536000; includeSubDomains; preload x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '174' + - '607' status: code: 202 message: Accepted @@ -49,11 +49,11 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.1.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/layout/analyzeResults/cb6b1625-48d3-4000-9820-54bf9a7f866f + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/layout/analyzeResults/65d1fabf-2997-4968-9599-84321346785a response: body: - string: '{"status": "succeeded", "createdDateTime": "2021-03-01T18:41:18Z", - "lastUpdatedDateTime": "2021-03-01T18:41:21Z", "analyzeResult": {"version": + string: '{"status": "succeeded", "createdDateTime": "2021-03-11T23:12:21Z", + "lastUpdatedDateTime": "2021-03-11T23:12:24Z", "analyzeResult": {"version": "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 1700, "height": 2200, "unit": "pixel", "language": "de", "lines": [{"boundingBox": [136, 139, 351, 138, 351, 166, 136, 166], "text": "Purchase Order", "appearance": {"style": @@ -408,19 +408,19 @@ interactions: "boundingBox": [1058, 1563, 1555, 1563, 1555, 1707, 1058, 1707]}]}]}}' headers: apim-request-id: - - 35c7cc3a-554a-45bc-b88a-14ee27585736 + - 5769ae4f-6c2c-4ff1-9b33-d0a91b22b3ae content-length: - '24449' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Mar 2021 18:41:23 GMT + - Thu, 11 Mar 2021 23:12:25 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '21' + - '26' status: code: 200 message: OK diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_from_url_async.test_content_language_specified.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_from_url_async.test_content_language_specified.yaml index 8c85a9d7ae0f..c5adbb0a182a 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_from_url_async.test_content_language_specified.yaml +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_from_url_async.test_content_language_specified.yaml @@ -5,7 +5,7 @@ interactions: Accept: - application/json Content-Length: - - '213' + - '223' Content-Type: - application/json User-Agent: @@ -16,13 +16,13 @@ interactions: body: string: '' headers: - apim-request-id: 94008e34-4534-4ebc-a18c-afcba66eaede + apim-request-id: bdf7c84f-8df5-4dd8-a205-0606943dc528 content-length: '0' - date: Wed, 03 Mar 2021 19:31:46 GMT - operation-location: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/layout/analyzeResults/94008e34-4534-4ebc-a18c-afcba66eaede + date: Thu, 11 Mar 2021 23:12:04 GMT + operation-location: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/layout/analyzeResults/bdf7c84f-8df5-4dd8-a205-0606943dc528 strict-transport-security: max-age=31536000; includeSubDomains; preload x-content-type-options: nosniff - x-envoy-upstream-service-time: '304' + x-envoy-upstream-service-time: '629' status: code: 202 message: Accepted @@ -33,11 +33,11 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.1.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/layout/analyzeResults/94008e34-4534-4ebc-a18c-afcba66eaede + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/layout/analyzeResults/bdf7c84f-8df5-4dd8-a205-0606943dc528 response: body: - string: '{"status": "succeeded", "createdDateTime": "2021-03-03T19:31:47Z", - "lastUpdatedDateTime": "2021-03-03T19:31:51Z", "analyzeResult": {"version": + string: '{"status": "succeeded", "createdDateTime": "2021-03-11T23:12:04Z", + "lastUpdatedDateTime": "2021-03-11T23:12:07Z", "analyzeResult": {"version": "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 1700, "height": 2200, "unit": "pixel", "language": "de", "lines": [{"boundingBox": [136, 139, 351, 138, 351, 166, 136, 166], "text": "Purchase Order", "appearance": {"style": @@ -391,15 +391,15 @@ interactions: 1663, 1543, 1663, 1543, 1708, 1308, 1707], "elements": ["#/readResults/0/lines/47/words/0"]}], "boundingBox": [1058, 1563, 1555, 1563, 1555, 1707, 1058, 1707]}]}]}}' headers: - apim-request-id: 7b123bfd-3c4f-44b7-9ed8-752b3b4df625 + apim-request-id: 8910a09a-daaa-403a-b514-4f21d2c8f7c9 content-length: '24449' content-type: application/json; charset=utf-8 - date: Wed, 03 Mar 2021 19:31:51 GMT + date: Thu, 11 Mar 2021 23:12:09 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload x-content-type-options: nosniff - x-envoy-upstream-service-time: '15' + x-envoy-upstream-service-time: '28' status: code: 200 message: OK - url: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/layout/analyzeResults/94008e34-4534-4ebc-a18c-afcba66eaede + url: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/layout/analyzeResults/bdf7c84f-8df5-4dd8-a205-0606943dc528 version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice.test_invoice_locale_specified.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice.test_invoice_locale_specified.yaml index 1de83ccb84f8..c3ae70934fb5 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice.test_invoice_locale_specified.yaml +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice.test_invoice_locale_specified.yaml @@ -1368,19 +1368,19 @@ interactions: string: '' headers: apim-request-id: - - b5b2a7ec-5d30-4c0f-966c-3ef3c14ac505 + - 87230a17-8191-4135-8306-5491491fe930 content-length: - '0' date: - - Mon, 01 Mar 2021 18:57:36 GMT + - Thu, 11 Mar 2021 23:15:00 GMT operation-location: - - https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/invoice/analyzeResults/b5b2a7ec-5d30-4c0f-966c-3ef3c14ac505 + - https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/invoice/analyzeResults/87230a17-8191-4135-8306-5491491fe930 strict-transport-security: - max-age=31536000; includeSubDomains; preload x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '71' + - '48' status: code: 202 message: Accepted @@ -1396,26 +1396,26 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.1.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/invoice/analyzeResults/b5b2a7ec-5d30-4c0f-966c-3ef3c14ac505 + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/invoice/analyzeResults/87230a17-8191-4135-8306-5491491fe930 response: body: - string: '{"status": "running", "createdDateTime": "2021-03-01T18:57:36Z", "lastUpdatedDateTime": - "2021-03-01T18:57:36Z"}' + string: '{"status": "running", "createdDateTime": "2021-03-11T23:15:00Z", "lastUpdatedDateTime": + "2021-03-11T23:15:01Z"}' headers: apim-request-id: - - d0afaa59-30d9-4cd5-949c-4dab8d62ff1c + - 79e69e81-5304-4dab-807e-122e3ef801c6 content-length: - '106' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Mar 2021 18:57:40 GMT + - Thu, 11 Mar 2021 23:15:04 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '34' + - '11' status: code: 200 message: OK @@ -1431,11 +1431,11 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.1.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/invoice/analyzeResults/b5b2a7ec-5d30-4c0f-966c-3ef3c14ac505 + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/invoice/analyzeResults/87230a17-8191-4135-8306-5491491fe930 response: body: - string: '{"status": "succeeded", "createdDateTime": "2021-03-01T18:57:36Z", - "lastUpdatedDateTime": "2021-03-01T18:57:43Z", "analyzeResult": {"version": + string: '{"status": "succeeded", "createdDateTime": "2021-03-11T23:15:00Z", + "lastUpdatedDateTime": "2021-03-11T23:15:06Z", "analyzeResult": {"version": "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 1700, "height": 2200, "unit": "pixel"}], "pageResults": [{"page": 1, "tables": [{"rows": 3, "columns": 6, "cells": [{"rowIndex": 0, "columnIndex": 0, "text": "Invoice @@ -1458,41 +1458,50 @@ interactions: "documentResults": [{"docType": "prebuilt:invoice", "pageRange": [1, 1], "fields": {"CustomerAddress": {"type": "string", "valueString": "1020 Enterprise Way Sunnayvale, CA 87659", "text": "1020 Enterprise Way Sunnayvale, CA 87659", - "boundingBox": [1036.1, 337.1, 1333.2, 338.1, 1333, 408.4, 1035.9, 407.5], - "page": 1, "confidence": 0.992}, "CustomerAddressRecipient": {"type": "string", - "valueString": "Microsoft", "text": "Microsoft", "boundingBox": [1035, 299, - 1164, 300, 1165, 326, 1036, 327], "page": 1, "confidence": 0.99}, "CustomerName": - {"type": "string", "valueString": "Microsoft", "text": "Microsoft", "boundingBox": - [1035, 299, 1164, 300, 1165, 326, 1036, 327], "page": 1, "confidence": 0.99}, + "boundingBox": [1038, 338, 1331.1, 338.9, 1330.9, 408.4, 1037.8, 407.5], "page": + 1, "confidence": 0.955}, "CustomerAddressRecipient": {"type": "string", "valueString": + "Microsoft", "text": "Microsoft", "boundingBox": [1033, 299, 1164, 300, 1165, + 326, 1033, 327], "page": 1, "confidence": 0.981}, "CustomerName": {"type": + "string", "valueString": "Microsoft", "text": "Microsoft", "boundingBox": + [1033, 299, 1164, 300, 1165, 326, 1033, 327], "page": 1, "confidence": 0.981}, "DueDate": {"type": "date", "valueDate": "2017-06-24", "text": "6/24/2017", - "boundingBox": [668, 679, 792, 679, 792, 705, 667, 705], "page": 1, "confidence": - 0.989}, "InvoiceDate": {"type": "date", "valueDate": "2017-06-18", "text": - "6/18/2017", "boundingBox": [387, 680, 510, 680, 510, 705, 387, 705], "page": - 1, "confidence": 0.926}, "InvoiceId": {"type": "string", "valueString": "34278587", - "text": "34278587", "boundingBox": [105, 680, 229, 680, 230, 705, 106, 705], - "page": 1, "confidence": 0.795}, "InvoiceTotal": {"type": "number", "valueNumber": - 56651.49, "text": "$56,651.49", "boundingBox": [1075, 680, 1224, 680, 1225, - 705, 1075, 707], "page": 1, "confidence": 0.505}, "VendorAddress": {"type": + "boundingBox": [668, 679, 789, 679, 790, 705, 667, 705], "page": 1, "confidence": + 0.981}, "InvoiceDate": {"type": "date", "valueDate": "2017-06-18", "text": + "6/18/2017", "boundingBox": [387, 680, 508, 680, 507, 705, 387, 705], "page": + 1, "confidence": 0.962}, "InvoiceId": {"type": "string", "valueString": "34278587", + "text": "34278587", "boundingBox": [107, 680, 227, 680, 227, 705, 107, 705], + "page": 1, "confidence": 0.963}, "Items": {"type": "array", "valueArray": + [{"type": "object", "valueObject": {"Amount": {"type": "number", "valueNumber": + 56651.49, "text": "$56,651.49", "boundingBox": [1075, 680, 1213, 680, 1213, + 706, 1075, 707], "page": 1, "confidence": 0.801}, "Date": {"type": "date", + "valueDate": "2017-06-18", "text": "6/18/2017", "boundingBox": [387, 680, + 508, 680, 507, 705, 387, 705], "page": 1, "confidence": 0.436}, "ProductCode": + {"type": "string", "valueString": "34278587", "text": "34278587", "boundingBox": + [107, 680, 227, 680, 227, 705, 107, 705], "page": 1, "confidence": 0.665}, + "Tax": {"type": "number", "text": "PT", "boundingBox": [1238, 679, 1277, 679, + 1277, 704, 1238, 705], "page": 1, "confidence": 0.462}}, "text": "34278587 + 6/18/2017 6/24/2017 $56,651.49 PT", "boundingBox": [107, 679, 1277, 679, 1277, + 707, 107, 707], "page": 1, "confidence": 0.885}]}, "VendorAddress": {"type": "string", "valueString": "1 Redmond way Suite 6000 Redmond, WA 99243", "text": - "1 Redmond way Suite 6000 Redmond, WA 99243", "boundingBox": [158, 337, 433, - 337, 433, 441, 158, 441], "page": 1, "confidence": 0.946}, "VendorName": {"type": + "1 Redmond way Suite 6000 Redmond, WA 99243", "boundingBox": [159, 337, 429, + 337, 429, 441, 159, 441], "page": 1, "confidence": 0.953}, "VendorName": {"type": "string", "valueString": "Contoso", "text": "Contoso", "boundingBox": [106, - 232, 288, 234, 288, 274, 105, 274], "page": 1, "confidence": 0.87}}}]}}' + 232, 284, 234, 283, 274, 105, 274], "page": 1, "confidence": 0.981}}}]}}' headers: apim-request-id: - - 7c5315af-6c58-4824-9cf5-171ebf9bf4d1 + - e7a59432-7ce1-4ceb-a60c-7d81e816948b content-length: - - '3040' + - '3649' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Mar 2021 18:57:46 GMT + - Thu, 11 Mar 2021 23:15:10 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '38' + - '20' status: code: 200 message: OK diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_async.test_invoice_locale_specified.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_async.test_invoice_locale_specified.yaml index 663172689654..f6d99530cada 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_async.test_invoice_locale_specified.yaml +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_async.test_invoice_locale_specified.yaml @@ -1361,13 +1361,13 @@ interactions: body: string: '' headers: - apim-request-id: 22eb0710-7de6-40f7-a4d1-b6868859882d + apim-request-id: aa658068-1f6a-467c-9ed1-2114812b1cf4 content-length: '0' - date: Wed, 03 Mar 2021 19:36:59 GMT - operation-location: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/invoice/analyzeResults/22eb0710-7de6-40f7-a4d1-b6868859882d + date: Thu, 11 Mar 2021 23:14:40 GMT + operation-location: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/invoice/analyzeResults/aa658068-1f6a-467c-9ed1-2114812b1cf4 strict-transport-security: max-age=31536000; includeSubDomains; preload x-content-type-options: nosniff - x-envoy-upstream-service-time: '48' + x-envoy-upstream-service-time: '45' status: code: 202 message: Accepted @@ -1378,34 +1378,34 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.1.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/invoice/analyzeResults/22eb0710-7de6-40f7-a4d1-b6868859882d + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/invoice/analyzeResults/aa658068-1f6a-467c-9ed1-2114812b1cf4 response: body: - string: '{"status": "running", "createdDateTime": "2021-03-03T19:37:00Z", "lastUpdatedDateTime": - "2021-03-03T19:37:00Z"}' + string: '{"status": "running", "createdDateTime": "2021-03-11T23:14:40Z", "lastUpdatedDateTime": + "2021-03-11T23:14:40Z"}' headers: - apim-request-id: 87b80b25-8bd4-4572-a34c-eb2f49cfc332 + apim-request-id: ef7becb2-f184-465e-912c-550aecb91318 content-length: '106' content-type: application/json; charset=utf-8 - date: Wed, 03 Mar 2021 19:37:05 GMT + date: Thu, 11 Mar 2021 23:14:45 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload x-content-type-options: nosniff - x-envoy-upstream-service-time: '10' + x-envoy-upstream-service-time: '14' status: code: 200 message: OK - url: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/invoice/analyzeResults/22eb0710-7de6-40f7-a4d1-b6868859882d + url: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/invoice/analyzeResults/aa658068-1f6a-467c-9ed1-2114812b1cf4 - request: body: null headers: User-Agent: - azsdk-python-ai-formrecognizer/3.1.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/invoice/analyzeResults/22eb0710-7de6-40f7-a4d1-b6868859882d + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/invoice/analyzeResults/aa658068-1f6a-467c-9ed1-2114812b1cf4 response: body: - string: '{"status": "succeeded", "createdDateTime": "2021-03-03T19:37:00Z", - "lastUpdatedDateTime": "2021-03-03T19:37:07Z", "analyzeResult": {"version": + string: '{"status": "succeeded", "createdDateTime": "2021-03-11T23:14:40Z", + "lastUpdatedDateTime": "2021-03-11T23:14:46Z", "analyzeResult": {"version": "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 1700, "height": 2200, "unit": "pixel"}], "pageResults": [{"page": 1, "tables": [{"rows": 3, "columns": 6, "cells": [{"rowIndex": 0, "columnIndex": 0, "text": "Invoice @@ -1428,36 +1428,45 @@ interactions: "documentResults": [{"docType": "prebuilt:invoice", "pageRange": [1, 1], "fields": {"CustomerAddress": {"type": "string", "valueString": "1020 Enterprise Way Sunnayvale, CA 87659", "text": "1020 Enterprise Way Sunnayvale, CA 87659", - "boundingBox": [1036.1, 337.1, 1333.2, 338.1, 1333, 408.4, 1035.9, 407.5], - "page": 1, "confidence": 0.992}, "CustomerAddressRecipient": {"type": "string", - "valueString": "Microsoft", "text": "Microsoft", "boundingBox": [1035, 299, - 1164, 300, 1165, 326, 1036, 327], "page": 1, "confidence": 0.99}, "CustomerName": - {"type": "string", "valueString": "Microsoft", "text": "Microsoft", "boundingBox": - [1035, 299, 1164, 300, 1165, 326, 1036, 327], "page": 1, "confidence": 0.99}, + "boundingBox": [1038, 338, 1331.1, 338.9, 1330.9, 408.4, 1037.8, 407.5], "page": + 1, "confidence": 0.955}, "CustomerAddressRecipient": {"type": "string", "valueString": + "Microsoft", "text": "Microsoft", "boundingBox": [1033, 299, 1164, 300, 1165, + 326, 1033, 327], "page": 1, "confidence": 0.981}, "CustomerName": {"type": + "string", "valueString": "Microsoft", "text": "Microsoft", "boundingBox": + [1033, 299, 1164, 300, 1165, 326, 1033, 327], "page": 1, "confidence": 0.981}, "DueDate": {"type": "date", "valueDate": "2017-06-24", "text": "6/24/2017", - "boundingBox": [668, 679, 792, 679, 792, 705, 667, 705], "page": 1, "confidence": - 0.989}, "InvoiceDate": {"type": "date", "valueDate": "2017-06-18", "text": - "6/18/2017", "boundingBox": [387, 680, 510, 680, 510, 705, 387, 705], "page": - 1, "confidence": 0.926}, "InvoiceId": {"type": "string", "valueString": "34278587", - "text": "34278587", "boundingBox": [105, 680, 229, 680, 230, 705, 106, 705], - "page": 1, "confidence": 0.795}, "InvoiceTotal": {"type": "number", "valueNumber": - 56651.49, "text": "$56,651.49", "boundingBox": [1075, 680, 1224, 680, 1225, - 705, 1075, 707], "page": 1, "confidence": 0.505}, "VendorAddress": {"type": + "boundingBox": [668, 679, 789, 679, 790, 705, 667, 705], "page": 1, "confidence": + 0.981}, "InvoiceDate": {"type": "date", "valueDate": "2017-06-18", "text": + "6/18/2017", "boundingBox": [387, 680, 508, 680, 507, 705, 387, 705], "page": + 1, "confidence": 0.962}, "InvoiceId": {"type": "string", "valueString": "34278587", + "text": "34278587", "boundingBox": [107, 680, 227, 680, 227, 705, 107, 705], + "page": 1, "confidence": 0.963}, "Items": {"type": "array", "valueArray": + [{"type": "object", "valueObject": {"Amount": {"type": "number", "valueNumber": + 56651.49, "text": "$56,651.49", "boundingBox": [1075, 680, 1213, 680, 1213, + 706, 1075, 707], "page": 1, "confidence": 0.801}, "Date": {"type": "date", + "valueDate": "2017-06-18", "text": "6/18/2017", "boundingBox": [387, 680, + 508, 680, 507, 705, 387, 705], "page": 1, "confidence": 0.436}, "ProductCode": + {"type": "string", "valueString": "34278587", "text": "34278587", "boundingBox": + [107, 680, 227, 680, 227, 705, 107, 705], "page": 1, "confidence": 0.665}, + "Tax": {"type": "number", "text": "PT", "boundingBox": [1238, 679, 1277, 679, + 1277, 704, 1238, 705], "page": 1, "confidence": 0.462}}, "text": "34278587 + 6/18/2017 6/24/2017 $56,651.49 PT", "boundingBox": [107, 679, 1277, 679, 1277, + 707, 107, 707], "page": 1, "confidence": 0.885}]}, "VendorAddress": {"type": "string", "valueString": "1 Redmond way Suite 6000 Redmond, WA 99243", "text": - "1 Redmond way Suite 6000 Redmond, WA 99243", "boundingBox": [158, 337, 433, - 337, 433, 441, 158, 441], "page": 1, "confidence": 0.946}, "VendorName": {"type": + "1 Redmond way Suite 6000 Redmond, WA 99243", "boundingBox": [159, 337, 429, + 337, 429, 441, 159, 441], "page": 1, "confidence": 0.953}, "VendorName": {"type": "string", "valueString": "Contoso", "text": "Contoso", "boundingBox": [106, - 232, 288, 234, 288, 274, 105, 274], "page": 1, "confidence": 0.87}}}]}}' + 232, 284, 234, 283, 274, 105, 274], "page": 1, "confidence": 0.981}}}]}}' headers: - apim-request-id: 64f1de16-7853-43cb-becf-3cfce13fa1af - content-length: '3040' + apim-request-id: 325243b5-9af3-448e-92da-91a8ea15fda1 + content-length: '3649' content-type: application/json; charset=utf-8 - date: Wed, 03 Mar 2021 19:37:10 GMT + date: Thu, 11 Mar 2021 23:14:49 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload x-content-type-options: nosniff - x-envoy-upstream-service-time: '17' + x-envoy-upstream-service-time: '18' status: code: 200 message: OK - url: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/invoice/analyzeResults/22eb0710-7de6-40f7-a4d1-b6868859882d + url: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/invoice/analyzeResults/aa658068-1f6a-467c-9ed1-2114812b1cf4 version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt.test_receipt_locale_specified.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt.test_receipt_locale_specified.yaml index 5e7933aaf858..db1c76a3ce62 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt.test_receipt_locale_specified.yaml +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt.test_receipt_locale_specified.yaml @@ -22,19 +22,19 @@ interactions: string: '' headers: apim-request-id: - - 0a03973d-7554-41a7-a104-4a09cdea45a0 + - 4df8c7bd-37bf-425f-b532-1b63a379d736 content-length: - '0' date: - - Mon, 01 Mar 2021 21:21:12 GMT + - Thu, 11 Mar 2021 23:16:03 GMT operation-location: - - https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/receipt/analyzeResults/0a03973d-7554-41a7-a104-4a09cdea45a0 + - https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/receipt/analyzeResults/4df8c7bd-37bf-425f-b532-1b63a379d736 strict-transport-security: - max-age=31536000; includeSubDomains; preload x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '216' + - '156' status: code: 202 message: Accepted @@ -50,63 +50,65 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.1.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/receipt/analyzeResults/0a03973d-7554-41a7-a104-4a09cdea45a0 + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/receipt/analyzeResults/4df8c7bd-37bf-425f-b532-1b63a379d736 response: body: - string: '{"status": "succeeded", "createdDateTime": "2021-03-01T21:21:12Z", - "lastUpdatedDateTime": "2021-03-01T21:21:14Z", "analyzeResult": {"version": + string: '{"status": "succeeded", "createdDateTime": "2021-03-11T23:16:03Z", + "lastUpdatedDateTime": "2021-03-11T23:16:07Z", "analyzeResult": {"version": "2.1.0", "readResults": [{"page": 1, "angle": 0.1273, "width": 1688, "height": 3000, "unit": "pixel"}], "documentResults": [{"docType": "prebuilt:receipt", - "pageRange": [1, 1], "fields": {"ReceiptType": {"type": "string", "valueString": - "Itemized", "confidence": 0.99}, "MerchantName": {"type": "string", "valueString": - "Contoso Contoso", "text": "Contoso Contoso", "boundingBox": [380.9, 282.9, - 1116, 473.2, 1025, 824.4, 290, 634], "page": 1, "confidence": 0.769}, "MerchantAddress": - {"type": "string", "valueString": "123 Main Street Redmond, WA 98052", "text": - "123 Main Street Redmond, WA 98052", "boundingBox": [298.3, 676.5, 844.6, - 781.5, 810.7, 958, 264.4, 853], "page": 1, "confidence": 0.99}, "MerchantPhoneNumber": + "pageRange": [1, 1], "fields": {"Items": {"type": "array", "valueArray": [{"type": + "object", "valueObject": {"Name": {"type": "string", "valueString": "Cappuccino", + "text": "Cappuccino", "boundingBox": [304, 1585, 658, 1598, 657, 1688, 302, + 1679], "page": 1, "confidence": 0.558}, "Quantity": {"type": "number", "valueNumber": + 1, "text": "1", "boundingBox": [244, 1581, 286, 1584, 283, 1678, 241, 1675], + "page": 1, "confidence": 0.936}, "TotalPrice": {"type": "number", "valueNumber": + 2.2, "text": "$2.20", "boundingBox": [1106, 1579, 1260, 1574, 1263, 1656, + 1108, 1662], "page": 1, "confidence": 0.972}}}, {"type": "object", "valueObject": + {"Name": {"type": "string", "valueString": "BACON & EGGS", "text": "BACON + & EGGS", "boundingBox": [293, 1839, 737, 1839, 737, 1924, 293, 1924], "page": + 1, "confidence": 0.906}, "Quantity": {"type": "number", "valueNumber": 1, + "text": "1", "boundingBox": [227, 1839, 275, 1839, 275, 1924, 226, 1924], + "page": 1, "confidence": 0.936}, "TotalPrice": {"type": "number", "valueNumber": + 9.5, "text": "$9.5", "boundingBox": [1134, 1948, 1252, 1948, 1252, 2041, 1134, + 2041], "page": 1, "confidence": 0.977}}}]}, "MerchantAddress": {"type": "string", + "valueString": "123 Main Street Redmond, WA 98052", "text": "123 Main Street + Redmond, WA 98052", "boundingBox": [298.6, 675.8, 844.8, 782.2, 810.6, 957.9, + 264.4, 851.5], "page": 1, "confidence": 0.974}, "MerchantName": {"type": "string", + "valueString": "Contoso", "text": "Contoso", "boundingBox": [308, 570, 515, + 627, 500, 685, 290, 634], "page": 1, "confidence": 0.974}, "MerchantPhoneNumber": {"type": "phoneNumber", "valuePhoneNumber": "+919876543210", "text": "987-654-3210", - "boundingBox": [271, 1000, 651, 1049, 643, 1125, 264, 1075], "page": 1, "confidence": - 0.995}, "TransactionDate": {"type": "date", "valueDate": "2019-10-06", "text": - "6/10/2019", "boundingBox": [259, 1224, 510, 1246, 505, 1331, 255, 1312], - "page": 1, "confidence": 0.995}, "TransactionTime": {"type": "time", "valueTime": - "13:59:00", "text": "13:59", "boundingBox": [527, 1248, 681, 1262, 675, 1341, - 522, 1332], "page": 1, "confidence": 0.995}, "Items": {"type": "array", "valueArray": - [{"type": "object", "valueObject": {"Quantity": {"type": "number", "valueNumber": - 1, "text": "1", "boundingBox": [244, 1581, 288, 1584, 285, 1678, 241, 1675], - "page": 1, "confidence": 0.936}, "Name": {"type": "string", "valueString": - "Cappuccino", "text": "Cappuccino", "boundingBox": [306, 1585, 658, 1598, - 657, 1688, 304, 1679], "page": 1, "confidence": 0.976}, "TotalPrice": {"type": - "number", "valueNumber": 2.2, "text": "$2.20", "boundingBox": [1106, 1579, - 1260, 1574, 1263, 1656, 1108, 1662], "page": 1, "confidence": 0.988}}}, {"type": - "object", "valueObject": {"Quantity": {"type": "number", "valueNumber": 1, - "text": "1", "boundingBox": [227, 1839, 278, 1839, 277, 1924, 226, 1924], - "page": 1, "confidence": 0.882}, "Name": {"type": "string", "valueString": - "BACON & EGGS Sunny-side-up", "text": "BACON & EGGS Sunny-side-up", "boundingBox": - [294, 1839, 757, 1839, 757, 2064, 294, 2064], "page": 1, "confidence": 0.506}, - "TotalPrice": {"type": "number", "valueNumber": 9.5, "text": "$9.5", "boundingBox": - [1134, 1948, 1252, 1948, 1252, 2041, 1134, 2041], "page": 1, "confidence": - 0.987}}}]}, "Tax": {"type": "number", "valueNumber": 1.17, "text": "1.17", - "boundingBox": [1186, 2356, 1307, 2361, 1303, 2452, 1182, 2447], "page": 1, - "confidence": 0.994}, "Total": {"type": "number", "valueNumber": 14.5, "text": - "$14.50", "boundingBox": [1033, 2623, 1376, 2641, 1370, 2758, 1027, 2740], - "page": 1, "confidence": 0.988}, "Subtotal": {"type": "number", "valueNumber": - 11.7, "text": "11.70", "boundingBox": [1139, 2228, 1309, 2228, 1308, 2313, - 1138, 2313], "page": 1, "confidence": 0.269}}}]}}' + "boundingBox": [274, 1000, 651, 1049, 643, 1125, 268, 1076], "page": 1, "confidence": + 0.987}, "ReceiptType": {"type": "string", "valueString": "Itemized", "confidence": + 0.99}, "Subtotal": {"type": "number", "valueNumber": 11.7, "text": "$ 11.70", + "boundingBox": [1082, 2225.1, 1307.1, 2228, 1306, 2315.4, 1080.9, 2312.5], + "page": 1, "confidence": 0.967}, "Tax": {"type": "number", "valueNumber": + 1.17, "text": "$ 1.17", "boundingBox": [1125, 2352.1, 1307.4, 2361, 1303, + 2452.9, 1120.6, 2444], "page": 1, "confidence": 0.985}, "Tip": {"type": "number", + "valueNumber": 1.63, "text": "$ 1.63", "boundingBox": [1034, 2481.7, 1268.6, + 2488, 1266, 2583.5, 1031.5, 2577.2], "page": 1, "confidence": 0.941}, "Total": + {"type": "number", "valueNumber": 14.5, "text": "$14.50", "boundingBox": [1033, + 2623, 1374, 2641, 1368, 2757, 1027, 2740], "page": 1, "confidence": 0.978}, + "TransactionDate": {"type": "date", "valueDate": "2019-10-06", "text": "6/10/2019", + "boundingBox": [259, 1224, 514, 1247, 509, 1331, 255, 1312], "page": 1, "confidence": + 0.987}, "TransactionTime": {"type": "time", "valueTime": "13:59:00", "text": + "13:59", "boundingBox": [531, 1248, 681, 1262, 675, 1341, 526, 1333], "page": + 1, "confidence": 0.985}}}]}}' headers: apim-request-id: - - 5904d92d-3b47-4255-8064-ba4f3ee9df9e + - 4dc3949a-745c-4792-9ee1-872d40d6be63 content-length: - - '2711' + - '2837' content-type: - application/json; charset=utf-8 date: - - Mon, 01 Mar 2021 21:21:17 GMT + - Thu, 11 Mar 2021 23:16:08 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '26' + - '16' status: code: 200 message: OK diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_async.test_receipt_locale_specified.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_async.test_receipt_locale_specified.yaml index 4a7871f6333f..73735447aab0 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_async.test_receipt_locale_specified.yaml +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_async.test_receipt_locale_specified.yaml @@ -15,13 +15,13 @@ interactions: body: string: '' headers: - apim-request-id: 0d57b4be-0cd8-4689-a1f9-446f94bb702d + apim-request-id: 217b7a25-7ce9-4cb7-84e9-eb184920c9ef content-length: '0' - date: Wed, 03 Mar 2021 19:20:48 GMT - operation-location: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/receipt/analyzeResults/0d57b4be-0cd8-4689-a1f9-446f94bb702d + date: Thu, 11 Mar 2021 23:15:25 GMT + operation-location: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/receipt/analyzeResults/217b7a25-7ce9-4cb7-84e9-eb184920c9ef strict-transport-security: max-age=31536000; includeSubDomains; preload x-content-type-options: nosniff - x-envoy-upstream-service-time: '191' + x-envoy-upstream-service-time: '145' status: code: 202 message: Accepted @@ -32,58 +32,60 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.1.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/receipt/analyzeResults/0d57b4be-0cd8-4689-a1f9-446f94bb702d + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/receipt/analyzeResults/217b7a25-7ce9-4cb7-84e9-eb184920c9ef response: body: - string: '{"status": "succeeded", "createdDateTime": "2021-03-03T19:20:48Z", - "lastUpdatedDateTime": "2021-03-03T19:20:50Z", "analyzeResult": {"version": + string: '{"status": "succeeded", "createdDateTime": "2021-03-11T23:15:25Z", + "lastUpdatedDateTime": "2021-03-11T23:15:29Z", "analyzeResult": {"version": "2.1.0", "readResults": [{"page": 1, "angle": 0.1273, "width": 1688, "height": 3000, "unit": "pixel"}], "documentResults": [{"docType": "prebuilt:receipt", - "pageRange": [1, 1], "fields": {"ReceiptType": {"type": "string", "valueString": - "Itemized", "confidence": 0.99}, "MerchantName": {"type": "string", "valueString": - "Contoso Contoso", "text": "Contoso Contoso", "boundingBox": [380.9, 282.9, - 1116, 473.2, 1025, 824.4, 290, 634], "page": 1, "confidence": 0.769}, "MerchantAddress": - {"type": "string", "valueString": "123 Main Street Redmond, WA 98052", "text": - "123 Main Street Redmond, WA 98052", "boundingBox": [298.3, 676.5, 844.6, - 781.5, 810.7, 958, 264.4, 853], "page": 1, "confidence": 0.99}, "MerchantPhoneNumber": + "pageRange": [1, 1], "fields": {"Items": {"type": "array", "valueArray": [{"type": + "object", "valueObject": {"Name": {"type": "string", "valueString": "Cappuccino", + "text": "Cappuccino", "boundingBox": [304, 1585, 658, 1598, 657, 1688, 302, + 1679], "page": 1, "confidence": 0.558}, "Quantity": {"type": "number", "valueNumber": + 1, "text": "1", "boundingBox": [244, 1581, 286, 1584, 283, 1678, 241, 1675], + "page": 1, "confidence": 0.936}, "TotalPrice": {"type": "number", "valueNumber": + 2.2, "text": "$2.20", "boundingBox": [1106, 1579, 1260, 1574, 1263, 1656, + 1108, 1662], "page": 1, "confidence": 0.972}}}, {"type": "object", "valueObject": + {"Name": {"type": "string", "valueString": "BACON & EGGS", "text": "BACON + & EGGS", "boundingBox": [293, 1839, 737, 1839, 737, 1924, 293, 1924], "page": + 1, "confidence": 0.906}, "Quantity": {"type": "number", "valueNumber": 1, + "text": "1", "boundingBox": [227, 1839, 275, 1839, 275, 1924, 226, 1924], + "page": 1, "confidence": 0.936}, "TotalPrice": {"type": "number", "valueNumber": + 9.5, "text": "$9.5", "boundingBox": [1134, 1948, 1252, 1948, 1252, 2041, 1134, + 2041], "page": 1, "confidence": 0.977}}}]}, "MerchantAddress": {"type": "string", + "valueString": "123 Main Street Redmond, WA 98052", "text": "123 Main Street + Redmond, WA 98052", "boundingBox": [298.6, 675.8, 844.8, 782.2, 810.6, 957.9, + 264.4, 851.5], "page": 1, "confidence": 0.974}, "MerchantName": {"type": "string", + "valueString": "Contoso", "text": "Contoso", "boundingBox": [308, 570, 515, + 627, 500, 685, 290, 634], "page": 1, "confidence": 0.974}, "MerchantPhoneNumber": {"type": "phoneNumber", "valuePhoneNumber": "+919876543210", "text": "987-654-3210", - "boundingBox": [271, 1000, 651, 1049, 643, 1125, 264, 1075], "page": 1, "confidence": - 0.995}, "TransactionDate": {"type": "date", "valueDate": "2019-10-06", "text": - "6/10/2019", "boundingBox": [259, 1224, 510, 1246, 505, 1331, 255, 1312], - "page": 1, "confidence": 0.995}, "TransactionTime": {"type": "time", "valueTime": - "13:59:00", "text": "13:59", "boundingBox": [527, 1248, 681, 1262, 675, 1341, - 522, 1332], "page": 1, "confidence": 0.995}, "Items": {"type": "array", "valueArray": - [{"type": "object", "valueObject": {"Quantity": {"type": "number", "valueNumber": - 1, "text": "1", "boundingBox": [244, 1581, 288, 1584, 285, 1678, 241, 1675], - "page": 1, "confidence": 0.936}, "Name": {"type": "string", "valueString": - "Cappuccino", "text": "Cappuccino", "boundingBox": [306, 1585, 658, 1598, - 657, 1688, 304, 1679], "page": 1, "confidence": 0.976}, "TotalPrice": {"type": - "number", "valueNumber": 2.2, "text": "$2.20", "boundingBox": [1106, 1579, - 1260, 1574, 1263, 1656, 1108, 1662], "page": 1, "confidence": 0.988}}}, {"type": - "object", "valueObject": {"Quantity": {"type": "number", "valueNumber": 1, - "text": "1", "boundingBox": [227, 1839, 278, 1839, 277, 1924, 226, 1924], - "page": 1, "confidence": 0.882}, "Name": {"type": "string", "valueString": - "BACON & EGGS Sunny-side-up", "text": "BACON & EGGS Sunny-side-up", "boundingBox": - [294, 1839, 757, 1839, 757, 2064, 294, 2064], "page": 1, "confidence": 0.506}, - "TotalPrice": {"type": "number", "valueNumber": 9.5, "text": "$9.5", "boundingBox": - [1134, 1948, 1252, 1948, 1252, 2041, 1134, 2041], "page": 1, "confidence": - 0.987}}}]}, "Tax": {"type": "number", "valueNumber": 1.17, "text": "1.17", - "boundingBox": [1186, 2356, 1307, 2361, 1303, 2452, 1182, 2447], "page": 1, - "confidence": 0.994}, "Total": {"type": "number", "valueNumber": 14.5, "text": - "$14.50", "boundingBox": [1033, 2623, 1376, 2641, 1370, 2758, 1027, 2740], - "page": 1, "confidence": 0.988}, "Subtotal": {"type": "number", "valueNumber": - 11.7, "text": "11.70", "boundingBox": [1139, 2228, 1309, 2228, 1308, 2313, - 1138, 2313], "page": 1, "confidence": 0.269}}}]}}' + "boundingBox": [274, 1000, 651, 1049, 643, 1125, 268, 1076], "page": 1, "confidence": + 0.987}, "ReceiptType": {"type": "string", "valueString": "Itemized", "confidence": + 0.99}, "Subtotal": {"type": "number", "valueNumber": 11.7, "text": "$ 11.70", + "boundingBox": [1082, 2225.1, 1307.1, 2228, 1306, 2315.4, 1080.9, 2312.5], + "page": 1, "confidence": 0.967}, "Tax": {"type": "number", "valueNumber": + 1.17, "text": "$ 1.17", "boundingBox": [1125, 2352.1, 1307.4, 2361, 1303, + 2452.9, 1120.6, 2444], "page": 1, "confidence": 0.985}, "Tip": {"type": "number", + "valueNumber": 1.63, "text": "$ 1.63", "boundingBox": [1034, 2481.7, 1268.6, + 2488, 1266, 2583.5, 1031.5, 2577.2], "page": 1, "confidence": 0.941}, "Total": + {"type": "number", "valueNumber": 14.5, "text": "$14.50", "boundingBox": [1033, + 2623, 1374, 2641, 1368, 2757, 1027, 2740], "page": 1, "confidence": 0.978}, + "TransactionDate": {"type": "date", "valueDate": "2019-10-06", "text": "6/10/2019", + "boundingBox": [259, 1224, 514, 1247, 509, 1331, 255, 1312], "page": 1, "confidence": + 0.987}, "TransactionTime": {"type": "time", "valueTime": "13:59:00", "text": + "13:59", "boundingBox": [531, 1248, 681, 1262, 675, 1341, 526, 1333], "page": + 1, "confidence": 0.985}}}]}}' headers: - apim-request-id: d3987285-2836-46fa-a56b-aee1127d9659 - content-length: '2711' + apim-request-id: 42b9af60-e700-4be8-ad0b-ff80c7a3e4c0 + content-length: '2837' content-type: application/json; charset=utf-8 - date: Wed, 03 Mar 2021 19:20:53 GMT + date: Thu, 11 Mar 2021 23:15:30 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload x-content-type-options: nosniff - x-envoy-upstream-service-time: '16' + x-envoy-upstream-service-time: '19' status: code: 200 message: OK - url: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/receipt/analyzeResults/0d57b4be-0cd8-4689-a1f9-446f94bb702d + url: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/prebuilt/receipt/analyzeResults/217b7a25-7ce9-4cb7-84e9-eb184920c9ef version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card.py index aa14dedb8077..43b8b7d8c0b1 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card.py @@ -450,7 +450,8 @@ def test_business_card_locale_specified(self, client): business_card = fd.read() poller = client.begin_recognize_business_cards(business_card, locale="en-IN") assert 'en-IN' == poller._polling_method._initial_response.http_response.request.query['locale'] - poller.wait() + result = poller.result() + assert result @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py index c131f34081da..4aa6c716c1dd 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py @@ -474,7 +474,8 @@ async def test_business_card_locale_specified(self, client): async with client: poller = await client.begin_recognize_business_cards(business_card, locale="en-IN") assert 'en-IN' == poller._polling_method._initial_response.http_response.request.query['locale'] - await poller.wait() + result = await poller.result() + assert result @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url.py index 02c5de22b888..1bcd27b51a76 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url.py @@ -364,7 +364,8 @@ def test_business_card_v2(self, client): def test_business_card_locale_specified(self, client): poller = client.begin_recognize_business_cards_from_url(self.business_card_url_jpg, locale="en-IN") assert 'en-IN' == poller._polling_method._initial_response.http_response.request.query['locale'] - poller.wait() + result = poller.result() + assert result @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url_async.py index 1be2acce25dc..0533a0001a35 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url_async.py @@ -381,7 +381,8 @@ async def test_business_card_locale_specified(self, client): async with client: poller = await client.begin_recognize_business_cards_from_url(self.business_card_url_jpg, locale="en-IN") assert 'en-IN' == poller._polling_method._initial_response.http_response.request.query['locale'] - await poller.wait() + result = await poller.result() + assert result @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py index 8b139aaee24e..1be3a3283d73 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py @@ -364,7 +364,8 @@ def test_content_language_specified(self, client): myfile = fd.read() poller = client.begin_recognize_content(myfile, language="de") assert 'de' == poller._polling_method._initial_response.http_response.request.query['language'] - poller.wait() + result = poller.result() + assert result @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_async.py index e39ceebfea7c..f8a18199dbb6 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_async.py @@ -401,7 +401,8 @@ async def test_content_language_specified(self, client): async with client: poller = await client.begin_recognize_content(myfile, language="de") assert 'de' == poller._polling_method._initial_response.http_response.request.query['language'] - await poller.wait() + result = await poller.result() + assert result @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url.py index 93b778be6c7e..cdd27efc475f 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url.py @@ -261,7 +261,8 @@ def test_content_specify_pages(self, client): def test_content_language_specified(self, client): poller = client.begin_recognize_content_from_url(self.form_url_jpg, language="de") assert 'de' == poller._polling_method._initial_response.http_response.request.query['language'] - poller.wait() + result = poller.result() + assert result @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url_async.py index d7bf30968ec7..77537f5df99b 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url_async.py @@ -285,7 +285,8 @@ async def test_content_language_specified(self, client): async with client: poller = await client.begin_recognize_content_from_url(self.form_url_jpg, language="de") assert 'de' == poller._polling_method._initial_response.http_response.request.query['language'] - await poller.wait() + result = await poller.result() + assert result @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice.py index 0190cb227baf..e2d64ff4b133 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice.py @@ -372,7 +372,8 @@ def test_invoice_locale_specified(self, client): invoice = fd.read() poller = client.begin_recognize_invoices(invoice, locale="en-US") assert 'en-US' == poller._polling_method._initial_response.http_response.request.query['locale'] - poller.wait() + result = poller.result() + assert result @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_async.py index cdc30a8473e8..c19ec85837de 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_async.py @@ -398,7 +398,8 @@ async def test_invoice_locale_specified(self, client): async with client: poller = await client.begin_recognize_invoices(invoice, locale="en-US") assert 'en-US' == poller._polling_method._initial_response.http_response.request.query['locale'] - await poller.wait() + result = await poller.result() + assert result @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url.py index 0b078d864fc0..7f9ac695259f 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url.py @@ -286,7 +286,8 @@ def test_invoice_v2(self, client): def test_invoice_locale_specified(self, client): poller = client.begin_recognize_invoices_from_url(self.invoice_url_pdf, locale="en-US") assert 'en-US' == poller._polling_method._initial_response.http_response.request.query['locale'] - poller.wait() + result = poller.result() + assert result @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url_async.py index 03ddac308b56..4270a75e0793 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url_async.py @@ -304,7 +304,8 @@ async def test_invoice_locale_specified(self, client): async with client: poller = await client.begin_recognize_invoices_from_url(self.invoice_url_pdf, locale="en-US") assert 'en-US' == poller._polling_method._initial_response.http_response.request.query['locale'] - await poller.wait() + result = await poller.result() + assert result @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py index 68c2d28d131c..f6a3a4e0b1f0 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py @@ -381,7 +381,8 @@ def test_receipt_locale_specified(self, client): receipt = fd.read() poller = client.begin_recognize_receipts(receipt, locale="en-IN") assert 'en-IN' == poller._polling_method._initial_response.http_response.request.query['locale'] - poller.wait() + result = poller.result() + assert result @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py index 30c0a5f2524e..6d0c061f589b 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py @@ -411,7 +411,8 @@ async def test_receipt_locale_specified(self, client): async with client: poller = await client.begin_recognize_receipts(receipt, locale="en-IN") assert 'en-IN' == poller._polling_method._initial_response.http_response.request.query['locale'] - await poller.wait() + result = await poller.result() + assert result @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py index 47052c921050..8edd09eed864 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py @@ -311,7 +311,8 @@ def test_receipt_continuation_token(self, client): def test_receipt_locale_specified(self, client): poller = client.begin_recognize_receipts_from_url(self.receipt_url_jpg, locale="en-IN") assert 'en-IN' == poller._polling_method._initial_response.http_response.request.query['locale'] - poller.wait() + result = poller.result() + assert result @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py index cdfa91cdebed..4fec479151c1 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py @@ -347,7 +347,8 @@ async def test_receipt_locale_specified(self, client): async with client: poller = await client.begin_recognize_receipts_from_url(self.receipt_url_jpg, locale="en-IN") assert 'en-IN' == poller._polling_method._initial_response.http_response.request.query['locale'] - await poller.wait() + result = await poller.result() + assert result @FormRecognizerPreparer() @GlobalClientPreparer()