diff --git a/pyproject.toml b/pyproject.toml index 245108abf..29f1d2eb0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath" -version = "2.1.144" +version = "2.1.145" description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools." readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.10" diff --git a/src/uipath/_services/documents_service.py b/src/uipath/_services/documents_service.py index 61e01b4cd..2f3532fb9 100644 --- a/src/uipath/_services/documents_service.py +++ b/src/uipath/_services/documents_service.py @@ -5,8 +5,6 @@ from typing import Any, Awaitable, Callable, Dict, List, Optional, Set, Tuple, Union from uuid import UUID -from httpx._types import FileContent - from .._config import Config from .._execution_context import ExecutionContext from .._folder_context import FolderContext @@ -17,8 +15,8 @@ ClassificationResult, ExtractionResponse, ExtractionResponseIXP, + FileContent, ProjectType, - ValidatedResult, ValidationAction, ) from ..tracing import traced @@ -512,6 +510,7 @@ def result_getter() -> Tuple[str, str, Any]: extraction_response["projectId"] = project_id extraction_response["tag"] = tag extraction_response["documentTypeId"] = document_type_id + extraction_response["projectType"] = project_type if project_type == ProjectType.IXP: return ExtractionResponseIXP.model_validate(extraction_response) @@ -552,6 +551,7 @@ async def result_getter() -> Tuple[str, str, Any]: extraction_response["projectId"] = project_id extraction_response["tag"] = tag extraction_response["documentTypeId"] = document_type_id + extraction_response["projectType"] = project_type if project_type == ProjectType.IXP: return ExtractionResponseIXP.model_validate(extraction_response) @@ -777,12 +777,13 @@ def extract( file_path (str, optional): Path to the document file to be processed. Must be provided if `classification_result` is not provided. project_type (ProjectType, optional): Type of the project. Must be provided if `project_name` is provided. document_type_name (str, optional): Document type name associated with the extractor to be used for extraction. Required if `project_type` is `ProjectType.MODERN` and `project_name` is provided. + classification_result (ClassificationResult, optional): The classification result obtained from a previous classification step. If provided, `project_name`, `project_type`, `file`, `file_path`, and `document_type_name` must not be provided. Note: Either `file` or `file_path` must be provided, but not both. Returns: - ExtractionResponse: The extraction result containing predicted data. + Union[ExtractionResponse, ExtractionResponseIXP]: The extraction response containing the extracted data. Examples: IXP projects: @@ -1019,7 +1020,12 @@ async def _get_validation_result_async( ).json() def _wait_for_create_validation_action( - self, project_id: str, tag: str, document_type_id: str, operation_id: str + self, + project_id: str, + project_type: ProjectType, + tag: str, + document_type_id: str, + operation_id: str, ) -> ValidationAction: def result_getter() -> Tuple[Any, Optional[Any], Optional[Any]]: result = self._get_validation_result( @@ -1041,13 +1047,19 @@ def result_getter() -> Tuple[Any, Optional[Any], Optional[Any]]: ) response["projectId"] = project_id + response["projectType"] = project_type response["tag"] = tag response["documentTypeId"] = document_type_id response["operationId"] = operation_id return ValidationAction.model_validate(response) async def _wait_for_create_validation_action_async( - self, project_id: str, tag: str, document_type_id: str, operation_id: str + self, + project_id: str, + project_type: ProjectType, + tag: str, + document_type_id: str, + operation_id: str, ) -> ValidationAction: async def result_getter_async() -> Tuple[Any, Optional[Any], Optional[Any]]: result = await self._get_validation_result_async( @@ -1069,13 +1081,14 @@ async def result_getter_async() -> Tuple[Any, Optional[Any], Optional[Any]]: ) response["projectId"] = project_id + response["projectType"] = project_type response["tag"] = tag response["documentTypeId"] = document_type_id response["operationId"] = operation_id return ValidationAction.model_validate(response) - @traced(name="documents_create_validation_action", run_type="uipath") - def create_validation_action( + @traced(name="documents_create_validate_extraction_action", run_type="uipath") + def create_validate_extraction_action( self, action_title: str, action_priority: ActionPriority, @@ -1085,7 +1098,7 @@ def create_validation_action( storage_bucket_directory_path: str, extraction_response: ExtractionResponse, ) -> ValidationAction: - """Create a validation action for a document based on the extraction response. More details about validation actions can be found in the [official documentation](https://docs.uipath.com/ixp/automation-cloud/latest/user-guide/validating-extractions). + """Create a validate extraction action for a document based on the extraction response. More details about validation actions can be found in the [official documentation](https://docs.uipath.com/ixp/automation-cloud/latest/user-guide/validating-extractions). Args: action_title (str): Title of the action. @@ -1101,12 +1114,12 @@ def create_validation_action( Examples: ```python - validation_action = service.create_validation_action( + validation_action = service.create_validate_extraction_action( action_title="Test Validation Action", action_priority=ActionPriority.MEDIUM, action_catalog="default_du_actions", action_folder="Shared", - storage_bucket_name="TestBucket", + storage_bucket_name="du_storage_bucket", storage_bucket_directory_path="TestDirectory", extraction_response=extraction_response, ) @@ -1127,13 +1140,14 @@ def create_validation_action( return self._wait_for_create_validation_action( project_id=extraction_response.project_id, + project_type=extraction_response.project_type, tag=extraction_response.tag, document_type_id=extraction_response.document_type_id, operation_id=operation_id, ) - @traced(name="documents_create_validation_action_async", run_type="uipath") - async def create_validation_action_async( + @traced(name="documents_create_validate_extraction_action_async", run_type="uipath") + async def create_validate_extraction_action_async( self, action_title: str, action_priority: ActionPriority, @@ -1143,7 +1157,7 @@ async def create_validation_action_async( storage_bucket_directory_path: str, extraction_response: ExtractionResponse, ) -> ValidationAction: - """Asynchronous version of the [`create_validation_action`][uipath._services.documents_service.DocumentsService.create_validation_action] method.""" + """Asynchronous version of the [`create_validation_action`][uipath._services.documents_service.DocumentsService.create_validate_extraction_action] method.""" operation_id = await self._start_validation_async( project_id=extraction_response.project_id, tag=extraction_response.tag, @@ -1159,29 +1173,30 @@ async def create_validation_action_async( return await self._wait_for_create_validation_action_async( project_id=extraction_response.project_id, + project_type=extraction_response.project_type, tag=extraction_response.tag, document_type_id=extraction_response.document_type_id, operation_id=operation_id, ) - @traced(name="documents_get_validation_result", run_type="uipath") - def get_validation_result( + @traced(name="documents_get_validate_extraction_result", run_type="uipath") + def get_validate_extraction_result( self, validation_action: ValidationAction - ) -> ValidatedResult: - """Get the result of a validation action. + ) -> Union[ExtractionResponse, ExtractionResponseIXP]: + """Get the result of a validate extraction action. Note: This method will block until the validation action is completed, meaning the user has completed the validation in UiPath Action Center. Args: - validation_action (ValidationAction): The validation action to get the result for, typically obtained from the [`create_validation_action`][uipath._services.documents_service.DocumentsService.create_validation_action] method. + validation_action (ValidationAction): The validation action to get the result for, typically obtained from the [`create_validate_extraction_action`][uipath._services.documents_service.DocumentsService.create_validate_extraction_action] method. Returns: - ValidatedResult: The result of the validation action. + Union[ExtractionResponse, ExtractionResponseIXP]: The validated extraction response. Examples: ```python - validated_result = service.get_validation_result(validation_action) + validated_result = service.get_validate_extraction_result(validate_extraction_action) ``` """ @@ -1192,25 +1207,29 @@ def result_getter() -> Tuple[str, None, Any]: document_type_id=validation_action.document_type_id, operation_id=validation_action.operation_id, ) - return ( - result["result"]["actionStatus"], - None, - result["result"].get("validatedExtractionResults", None), - ) + return (result["result"]["actionStatus"], None, result["result"]) response = self._wait_for_operation( result_getter=result_getter, wait_statuses=["Unassigned", "Pending"], success_status="Completed", ) + response["extractionResult"] = response.pop("validatedExtractionResults") + response["projectId"] = validation_action.project_id + response["tag"] = validation_action.tag + response["documentTypeId"] = validation_action.document_type_id + response["projectType"] = validation_action.project_type - return ValidatedResult.model_validate(response) + if validation_action.project_type == ProjectType.IXP: + return ExtractionResponseIXP.model_validate(response) - @traced(name="documents_get_validation_result_async", run_type="uipath") - async def get_validation_result_async( + return ExtractionResponse.model_validate(response) + + @traced(name="documents_get_validate_extraction_result_async", run_type="uipath") + async def get_validate_extraction_result_async( self, validation_action: ValidationAction - ) -> ValidatedResult: - """Asynchronous version of the [`get_validation_result`][uipath._services.documents_service.DocumentsService.get_validation_result] method.""" + ) -> Union[ExtractionResponse, ExtractionResponseIXP]: + """Asynchronous version of the [`get_validation_result`][uipath._services.documents_service.DocumentsService.get_validate_extraction_result] method.""" async def result_getter() -> Tuple[str, None, Any]: result = await self._get_validation_result_async( @@ -1219,16 +1238,20 @@ async def result_getter() -> Tuple[str, None, Any]: document_type_id=validation_action.document_type_id, operation_id=validation_action.operation_id, ) - return ( - result["result"]["actionStatus"], - None, - result["result"].get("validatedExtractionResults", None), - ) + return (result["result"]["actionStatus"], None, result["result"]) response = await self._wait_for_operation_async( result_getter=result_getter, wait_statuses=["Unassigned", "Pending"], success_status="Completed", ) + response["extractionResult"] = response.pop("validatedExtractionResults") + response["projectId"] = validation_action.project_id + response["tag"] = validation_action.tag + response["documentTypeId"] = validation_action.document_type_id + response["projectType"] = validation_action.project_type + + if validation_action.project_type == ProjectType.IXP: + return ExtractionResponseIXP.model_validate(response) - return ValidatedResult.model_validate(response) + return ExtractionResponse.model_validate(response) diff --git a/src/uipath/models/documents.py b/src/uipath/models/documents.py index ee676bec0..caf2a7831 100644 --- a/src/uipath/models/documents.py +++ b/src/uipath/models/documents.py @@ -1,8 +1,10 @@ from enum import Enum -from typing import List, Optional +from typing import IO, List, Optional, Union from pydantic import BaseModel, ConfigDict, Field +FileContent = Union[IO[bytes], bytes, str] + class FieldType(str, Enum): TEXT = "Text" @@ -98,6 +100,7 @@ class ExtractionResponse(BaseModel): extraction_result: ExtractionResult = Field(alias="extractionResult") project_id: str = Field(alias="projectId") + project_type: ProjectType = Field(alias="projectType") tag: str document_type_id: str = Field(alias="documentTypeId") @@ -131,28 +134,12 @@ class ValidationAction(BaseModel): action_data: dict = Field(alias="actionData") # type: ignore action_status: str = Field(alias="actionStatus") project_id: str = Field(alias="projectId") + project_type: ProjectType = Field(alias="projectType") tag: str document_type_id: str = Field(alias="documentTypeId") operation_id: str = Field(alias="operationId") -class ValidatedResult(BaseModel): - """A model representing the result of a validation action. - - Attributes: - document_id (str): The ID of the validated document. - results_document (dict): The validated results document. - """ - - model_config = ConfigDict( - serialize_by_alias=True, - validate_by_alias=True, - ) - - document_id: str = Field(alias="DocumentId") - results_document: dict = Field(alias="ResultsDocument") # type: ignore - - class Reference(BaseModel): model_config = ConfigDict( serialize_by_alias=True, diff --git a/tests/sdk/services/test_documents_service.py b/tests/sdk/services/test_documents_service.py index 12d7095bf..c3a211f9a 100644 --- a/tests/sdk/services/test_documents_service.py +++ b/tests/sdk/services/test_documents_service.py @@ -55,15 +55,6 @@ def create_validation_action_response(documents_tests_data_path: Path) -> dict: return json.load(f) -@pytest.fixture -def validated_result(documents_tests_data_path: Path) -> dict: # type: ignore - with open( - documents_tests_data_path / "validated_result.json", - "r", - ) as f: - return json.load(f) - - class TestDocumentsService: @pytest.mark.parametrize("mode", ["sync", "async"]) @pytest.mark.parametrize( @@ -171,6 +162,7 @@ async def test_extract_with_classification_result( # ASSERT modern_extraction_response["projectId"] = project_id + modern_extraction_response["projectType"] = ProjectType.MODERN modern_extraction_response["tag"] = "Production" modern_extraction_response["documentTypeId"] = document_type_id assert response.model_dump() == modern_extraction_response @@ -476,6 +468,7 @@ async def test_extract_ixp( # ASSERT expected_response = ixp_extraction_response expected_response["projectId"] = project_id + expected_response["projectType"] = ProjectType.IXP.value expected_response["tag"] = "live" expected_response["documentTypeId"] = str(UUID(int=0)) assert response.model_dump() == expected_response @@ -603,6 +596,7 @@ async def test_extract_modern( # ASSERT expected_response = modern_extraction_response expected_response["projectId"] = project_id + expected_response["projectType"] = ProjectType.MODERN.value expected_response["tag"] = "Production" expected_response["documentTypeId"] = document_type_id assert response.model_dump() == expected_response @@ -886,12 +880,13 @@ async def test_create_validation_action( ) ixp_extraction_response["projectId"] = project_id + ixp_extraction_response["projectType"] = ProjectType.IXP.value ixp_extraction_response["tag"] = tag ixp_extraction_response["documentTypeId"] = document_type_id # ACT if mode == "async": - response = await service.create_validation_action_async( + response = await service.create_validate_extraction_action_async( action_title=action_title, action_priority=action_priority, action_catalog=action_catalog, @@ -903,7 +898,7 @@ async def test_create_validation_action( ), ) else: - response = service.create_validation_action( + response = service.create_validate_extraction_action( action_title=action_title, action_priority=action_priority, action_catalog=action_catalog, @@ -917,12 +912,20 @@ async def test_create_validation_action( # ASSERT create_validation_action_response["projectId"] = project_id + create_validation_action_response["projectType"] = ProjectType.IXP.value create_validation_action_response["tag"] = tag create_validation_action_response["documentTypeId"] = document_type_id create_validation_action_response["operationId"] = operation_id assert response.model_dump() == create_validation_action_response @pytest.mark.parametrize("mode", ["sync", "async"]) + @pytest.mark.parametrize( + "project_type,tag,extraction_response_fixture", + [ + (ProjectType.MODERN, "Production", "modern_extraction_response"), + (ProjectType.IXP, "live", "ixp_extraction_response"), + ], + ) @pytest.mark.asyncio async def test_get_validation_result( self, @@ -932,25 +935,40 @@ async def test_get_validation_result( tenant: str, service: DocumentsService, create_validation_action_response: dict, # type: ignore - validated_result: dict, # type: ignore + modern_extraction_response: dict, # type: ignore + ixp_extraction_response: dict, # type: ignore mode: str, + project_type: ProjectType, + tag: str, + extraction_response_fixture: str, ): # ARRANGE project_id = str(uuid4()) operation_id = str(uuid4()) document_type_id = str(UUID(int=0)) + # Select the appropriate extraction response based on the fixture name + extraction_response = ( + modern_extraction_response + if extraction_response_fixture == "modern_extraction_response" + else ixp_extraction_response + ) + create_validation_action_response["projectId"] = project_id - create_validation_action_response["tag"] = "live" + create_validation_action_response["projectType"] = project_type.value + create_validation_action_response["tag"] = tag create_validation_action_response["documentTypeId"] = document_type_id create_validation_action_response["operationId"] = operation_id create_validation_action_response["actionStatus"] = "Completed" create_validation_action_response["validatedExtractionResults"] = ( - validated_result + extraction_response["extractionResult"] + ) + create_validation_action_response["dataProjection"] = extraction_response.get( + "dataProjection", None ) httpx_mock.add_response( - url=f"{base_url}{org}{tenant}/du_/api/framework/projects/{project_id}/live/document-types/{document_type_id}/validation/result/{operation_id}?api-version=1.1", + url=f"{base_url}{org}{tenant}/du_/api/framework/projects/{project_id}/{tag}/document-types/{document_type_id}/validation/result/{operation_id}?api-version=1.1", status_code=200, match_headers={"X-UiPath-Internal-ConsumptionSourceType": "CodedAgents"}, json={"status": "Succeeded", "result": create_validation_action_response}, @@ -958,20 +976,24 @@ async def test_get_validation_result( # ACT if mode == "async": - response = await service.get_validation_result_async( + response = await service.get_validate_extraction_result_async( validation_action=ValidationAction.model_validate( create_validation_action_response ) ) else: - response = service.get_validation_result( + response = service.get_validate_extraction_result( validation_action=ValidationAction.model_validate( create_validation_action_response ) ) # ASSERT - assert response.model_dump() == validated_result + extraction_response["projectId"] = project_id + extraction_response["projectType"] = project_type + extraction_response["tag"] = tag + extraction_response["documentTypeId"] = document_type_id + assert response.model_dump() == extraction_response @pytest.mark.parametrize("mode", ["sync", "async"]) @pytest.mark.asyncio diff --git a/tests/sdk/services/tests_data/documents_service/validated_result.json b/tests/sdk/services/tests_data/documents_service/validated_result.json deleted file mode 100644 index 735373a1d..000000000 --- a/tests/sdk/services/tests_data/documents_service/validated_result.json +++ /dev/null @@ -1,880 +0,0 @@ -{ - "DocumentId": "8c3294a2-2683-f011-b480-000d3a219ed5", - "ResultsDocument": { - "Bounds": { - "StartPage": 0, - "PageCount": 1, - "TextStartIndex": 0, - "TextLength": 603, - "PageRange": "1" - }, - "Language": "ron", - "DocumentGroup": "", - "DocumentCategory": "", - "DocumentTypeId": "00000000-0000-0000-0000-000000000000", - "DocumentTypeName": "Default", - "DocumentTypeDataVersion": 0, - "DataVersion": 1, - "DocumentTypeSource": "Automatic", - "DocumentTypeField": { - "Components": [], - "Value": "Default", - "UnformattedValue": "", - "Reference": { - "TextStartIndex": 0, - "TextLength": 0, - "Tokens": [] - }, - "DerivedFields": [], - "Confidence": 1.0, - "OperatorConfirmed": true, - "OcrConfidence": 1.0, - "TextType": "Unknown" - }, - "Fields": [ - { - "FieldId": "Details", - "FieldName": "Details", - "FieldType": "Table", - "IsMissing": false, - "DataSource": "Automatic", - "Values": [ - { - "Components": [ - { - "FieldId": "Details.Header", - "FieldName": "Header", - "FieldType": "Internal", - "IsMissing": false, - "DataSource": "Automatic", - "Values": [ - { - "Components": [ - { - "FieldId": "Total", - "FieldName": "Total", - "FieldType": "Text", - "IsMissing": false, - "DataSource": "Automatic", - "Values": [ - { - "Components": [], - "Value": "Total", - "UnformattedValue": "Total", - "Reference": { - "TextStartIndex": 0, - "TextLength": 0, - "Tokens": [] - }, - "DerivedFields": [], - "Confidence": 1.0, - "OperatorConfirmed": true, - "OcrConfidence": 1.0, - "TextType": "Unknown" - } - ], - "DataVersion": 0, - "OperatorConfirmed": true, - "ValidatorNotes": "" - }, - { - "FieldId": "From", - "FieldName": "From", - "FieldType": "Text", - "IsMissing": false, - "DataSource": "Automatic", - "Values": [ - { - "Components": [], - "Value": "From", - "UnformattedValue": "From", - "Reference": { - "TextStartIndex": 0, - "TextLength": 0, - "Tokens": [] - }, - "DerivedFields": [], - "Confidence": 1.0, - "OperatorConfirmed": true, - "OcrConfidence": 1.0, - "TextType": "Unknown" - } - ], - "DataVersion": 0, - "OperatorConfirmed": true, - "ValidatorNotes": "" - }, - { - "FieldId": "To", - "FieldName": "To", - "FieldType": "Text", - "IsMissing": false, - "DataSource": "Automatic", - "Values": [ - { - "Components": [], - "Value": "To", - "UnformattedValue": "To", - "Reference": { - "TextStartIndex": 0, - "TextLength": 0, - "Tokens": [] - }, - "DerivedFields": [], - "Confidence": 1.0, - "OperatorConfirmed": true, - "OcrConfidence": 1.0, - "TextType": "Unknown" - } - ], - "DataVersion": 0, - "OperatorConfirmed": true, - "ValidatorNotes": "" - } - ], - "Value": "", - "UnformattedValue": "", - "Reference": { - "TextStartIndex": 0, - "TextLength": 0, - "Tokens": [] - }, - "DerivedFields": [], - "Confidence": 1.0, - "OperatorConfirmed": true, - "OcrConfidence": 1.0, - "TextType": "Unknown" - } - ], - "DataVersion": 0, - "OperatorConfirmed": true, - "ValidatorNotes": "" - }, - { - "FieldId": "Details.Body", - "FieldName": "Body", - "FieldType": "Internal", - "IsMissing": false, - "DataSource": "Automatic", - "Values": [ - { - "Components": [ - { - "FieldId": "Total", - "FieldName": "Total", - "FieldType": "Text", - "IsMissing": false, - "DataSource": "Automatic", - "Values": [ - { - "Components": [], - "Value": "9.25 RON", - "UnformattedValue": "", - "Reference": { - "TextStartIndex": 595, - "TextLength": 8, - "Tokens": [ - { - "TextStartIndex": 595, - "TextLength": 4, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [ - [303.5632, 484.268, 18.4553, 8.1246] - ] - }, - { - "TextStartIndex": 600, - "TextLength": 3, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [ - [302.8246, 505.6762, 19.9318, 8.1246] - ] - } - ] - }, - "DerivedFields": [], - "Confidence": 1.0, - "OperatorConfirmed": true, - "OcrConfidence": 1.0, - "TextType": "Text" - } - ], - "DataVersion": 0, - "OperatorConfirmed": true, - "ValidatorNotes": "" - }, - { - "FieldId": "From", - "FieldName": "From", - "FieldType": "Text", - "IsMissing": false, - "DataSource": "Automatic", - "Values": [ - { - "Components": [], - "Value": "Strada Dummy 1, Cluj-Napox 400394, Romania", - "UnformattedValue": "", - "Reference": { - "TextStartIndex": 337, - "TextLength": 50, - "Tokens": [ - { - "TextStartIndex": 337, - "TextLength": 6, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[425.4316, 110.732, 21.4082, 7.386]] - }, - { - "TextStartIndex": 344, - "TextLength": 5, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [ - [425.4316, 134.3548, 16.9789, 7.386] - ] - }, - { - "TextStartIndex": 350, - "TextLength": 6, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[425.4316, 153.5484, 20.67, 7.386]] - }, - { - "TextStartIndex": 357, - "TextLength": 2, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[425.4316, 176.433, 2.9529, 7.386]] - }, - { - "TextStartIndex": 357, - "TextLength": 2, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[425.4316, 180.1241, 2.2147, 7.386]] - }, - { - "TextStartIndex": 360, - "TextLength": 11, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [ - [425.4316, 184.5533, 11.8114, 7.386] - ] - }, - { - "TextStartIndex": 360, - "TextLength": 11, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[425.4316, 197.103, 2.9528, 7.386]] - }, - { - "TextStartIndex": 360, - "TextLength": 11, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[425.4316, 199.3176, 24.361, 7.386]] - }, - { - "TextStartIndex": 372, - "TextLength": 7, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [ - [425.4316, 225.8933, 23.6228, 7.386] - ] - }, - { - "TextStartIndex": 372, - "TextLength": 7, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[425.4316, 250.2543, 2.2147, 7.386]] - }, - { - "TextStartIndex": 380, - "TextLength": 7, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [ - [425.4316, 253.9454, 28.7903, 7.386] - ] - } - ] - }, - "DerivedFields": [], - "Confidence": 1.0, - "OperatorConfirmed": true, - "OcrConfidence": 1.0, - "TextType": "Text" - } - ], - "DataVersion": 0, - "OperatorConfirmed": true, - "ValidatorNotes": "" - }, - { - "FieldId": "To", - "FieldName": "To", - "FieldType": "Text", - "IsMissing": false, - "DataSource": "Automatic", - "Values": [ - { - "Components": [], - "Value": "Strada Frunzelor 55, Cluj-Napx 400664, Romania", - "UnformattedValue": "", - "Reference": { - "TextStartIndex": 395, - "TextLength": 50, - "Tokens": [ - { - "TextStartIndex": 395, - "TextLength": 6, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[443.8965, 110.732, 20.67, 7.3859]] - }, - { - "TextStartIndex": 402, - "TextLength": 11, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [ - [443.8965, 134.3548, 33.9578, 7.3859] - ] - }, - { - "TextStartIndex": 414, - "TextLength": 3, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [ - [443.8965, 170.5273, 8.1203, 7.3859] - ] - }, - { - "TextStartIndex": 414, - "TextLength": 3, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [ - [443.8965, 179.3859, 2.2146, 7.3859] - ] - }, - { - "TextStartIndex": 418, - "TextLength": 11, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [ - [443.8965, 182.3387, 12.5496, 7.3859] - ] - }, - { - "TextStartIndex": 418, - "TextLength": 11, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [ - [443.8965, 195.6265, 2.2147, 7.3859] - ] - }, - { - "TextStartIndex": 418, - "TextLength": 11, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [ - [443.8965, 197.8412, 24.361, 7.3859] - ] - }, - { - "TextStartIndex": 430, - "TextLength": 7, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [ - [443.8965, 223.6787, 25.0993, 7.3859] - ] - }, - { - "TextStartIndex": 430, - "TextLength": 7, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [ - [443.8965, 248.7779, 2.2146, 7.3859] - ] - }, - { - "TextStartIndex": 438, - "TextLength": 7, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [ - [443.8965, 252.469, 29.5285, 7.3859] - ] - } - ] - }, - "DerivedFields": [], - "Confidence": 1.0, - "OperatorConfirmed": true, - "OcrConfidence": 1.0, - "TextType": "Text" - } - ], - "DataVersion": 0, - "OperatorConfirmed": true, - "ValidatorNotes": "" - } - ], - "Value": "", - "UnformattedValue": "", - "Reference": { - "TextStartIndex": 0, - "TextLength": 0, - "Tokens": [] - }, - "DerivedFields": [], - "Confidence": 1.0, - "OperatorConfirmed": true, - "OcrConfidence": 1.0, - "TextType": "Unknown" - } - ], - "DataVersion": 0, - "OperatorConfirmed": true, - "ValidatorNotes": "" - } - ], - "Value": "", - "UnformattedValue": "", - "Reference": { - "TextStartIndex": 0, - "TextLength": 0, - "Tokens": [] - }, - "DerivedFields": [], - "Confidence": 1.0, - "OperatorConfirmed": true, - "OcrConfidence": 1.0, - "TextType": "Unknown" - } - ], - "DataVersion": 0, - "OperatorConfirmed": true, - "ValidatorNotes": "" - } - ], - "Tables": [ - { - "FieldId": "Details", - "FieldName": "Details", - "IsMissing": false, - "DataSource": "Automatic", - "DataVersion": 0, - "OperatorConfirmed": true, - "Values": [ - { - "OperatorConfirmed": true, - "Confidence": 1.0, - "OcrConfidence": 1.0, - "Cells": [ - { - "RowIndex": 0, - "ColumnIndex": 0, - "IsHeader": true, - "IsMissing": false, - "OperatorConfirmed": true, - "DataSource": "Automatic", - "DataVersion": 0, - "Values": [ - { - "Components": [], - "Value": "Total", - "UnformattedValue": "Total", - "Reference": { - "TextStartIndex": 0, - "TextLength": 0, - "Tokens": [] - }, - "DerivedFields": [], - "Confidence": 1.0, - "OperatorConfirmed": true, - "OcrConfidence": 1.0, - "TextType": "Unknown" - } - ] - }, - { - "RowIndex": 0, - "ColumnIndex": 1, - "IsHeader": true, - "IsMissing": false, - "OperatorConfirmed": true, - "DataSource": "Automatic", - "DataVersion": 0, - "Values": [ - { - "Components": [], - "Value": "From", - "UnformattedValue": "From", - "Reference": { - "TextStartIndex": 0, - "TextLength": 0, - "Tokens": [] - }, - "DerivedFields": [], - "Confidence": 1.0, - "OperatorConfirmed": true, - "OcrConfidence": 1.0, - "TextType": "Unknown" - } - ] - }, - { - "RowIndex": 0, - "ColumnIndex": 2, - "IsHeader": true, - "IsMissing": false, - "OperatorConfirmed": true, - "DataSource": "Automatic", - "DataVersion": 0, - "Values": [ - { - "Components": [], - "Value": "To", - "UnformattedValue": "To", - "Reference": { - "TextStartIndex": 0, - "TextLength": 0, - "Tokens": [] - }, - "DerivedFields": [], - "Confidence": 1.0, - "OperatorConfirmed": true, - "OcrConfidence": 1.0, - "TextType": "Unknown" - } - ] - }, - { - "RowIndex": 1, - "ColumnIndex": 0, - "IsHeader": false, - "IsMissing": false, - "OperatorConfirmed": true, - "DataSource": "Automatic", - "DataVersion": 0, - "Values": [ - { - "Components": [], - "Value": "9.25 RON", - "UnformattedValue": "", - "Reference": { - "TextStartIndex": 595, - "TextLength": 8, - "Tokens": [ - { - "TextStartIndex": 595, - "TextLength": 4, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[303.5632, 484.268, 18.4553, 8.1246]] - }, - { - "TextStartIndex": 600, - "TextLength": 3, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[302.8246, 505.6762, 19.9318, 8.1246]] - } - ] - }, - "DerivedFields": [], - "Confidence": 1.0, - "OperatorConfirmed": true, - "OcrConfidence": 1.0, - "TextType": "Text" - } - ] - }, - { - "RowIndex": 1, - "ColumnIndex": 1, - "IsHeader": false, - "IsMissing": false, - "OperatorConfirmed": true, - "DataSource": "Automatic", - "DataVersion": 0, - "Values": [ - { - "Components": [], - "Value": "Strada Matei Corvin 1, Cluj-Napoca 400394, Romania", - "UnformattedValue": "", - "Reference": { - "TextStartIndex": 337, - "TextLength": 50, - "Tokens": [ - { - "TextStartIndex": 337, - "TextLength": 6, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[425.4316, 110.732, 21.4082, 7.386]] - }, - { - "TextStartIndex": 344, - "TextLength": 5, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[425.4316, 134.3548, 16.9789, 7.386]] - }, - { - "TextStartIndex": 350, - "TextLength": 6, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[425.4316, 153.5484, 20.67, 7.386]] - }, - { - "TextStartIndex": 357, - "TextLength": 2, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[425.4316, 176.433, 2.9529, 7.386]] - }, - { - "TextStartIndex": 357, - "TextLength": 2, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[425.4316, 180.1241, 2.2147, 7.386]] - }, - { - "TextStartIndex": 360, - "TextLength": 11, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[425.4316, 184.5533, 11.8114, 7.386]] - }, - { - "TextStartIndex": 360, - "TextLength": 11, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[425.4316, 197.103, 2.9528, 7.386]] - }, - { - "TextStartIndex": 360, - "TextLength": 11, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[425.4316, 199.3176, 24.361, 7.386]] - }, - { - "TextStartIndex": 372, - "TextLength": 7, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[425.4316, 225.8933, 23.6228, 7.386]] - }, - { - "TextStartIndex": 372, - "TextLength": 7, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[425.4316, 250.2543, 2.2147, 7.386]] - }, - { - "TextStartIndex": 380, - "TextLength": 7, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[425.4316, 253.9454, 28.7903, 7.386]] - } - ] - }, - "DerivedFields": [], - "Confidence": 1.0, - "OperatorConfirmed": true, - "OcrConfidence": 1.0, - "TextType": "Text" - } - ] - }, - { - "RowIndex": 1, - "ColumnIndex": 2, - "IsHeader": false, - "IsMissing": false, - "OperatorConfirmed": true, - "DataSource": "Automatic", - "DataVersion": 0, - "Values": [ - { - "Components": [], - "Value": "Strada Frunzzz 100, Cluj-Napox 400664, Romania", - "UnformattedValue": "", - "Reference": { - "TextStartIndex": 395, - "TextLength": 50, - "Tokens": [ - { - "TextStartIndex": 395, - "TextLength": 6, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[443.8965, 110.732, 20.67, 7.3859]] - }, - { - "TextStartIndex": 402, - "TextLength": 11, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[443.8965, 134.3548, 33.9578, 7.3859]] - }, - { - "TextStartIndex": 414, - "TextLength": 3, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[443.8965, 170.5273, 8.1203, 7.3859]] - }, - { - "TextStartIndex": 414, - "TextLength": 3, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[443.8965, 179.3859, 2.2146, 7.3859]] - }, - { - "TextStartIndex": 418, - "TextLength": 11, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[443.8965, 182.3387, 12.5496, 7.3859]] - }, - { - "TextStartIndex": 418, - "TextLength": 11, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[443.8965, 195.6265, 2.2147, 7.3859]] - }, - { - "TextStartIndex": 418, - "TextLength": 11, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[443.8965, 197.8412, 24.361, 7.3859]] - }, - { - "TextStartIndex": 430, - "TextLength": 7, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[443.8965, 223.6787, 25.0993, 7.3859]] - }, - { - "TextStartIndex": 430, - "TextLength": 7, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[443.8965, 248.7779, 2.2146, 7.3859]] - }, - { - "TextStartIndex": 438, - "TextLength": 7, - "Page": 0, - "PageWidth": 595.0, - "PageHeight": 842.0, - "Boxes": [[443.8965, 252.469, 29.5285, 7.3859]] - } - ] - }, - "DerivedFields": [], - "Confidence": 1.0, - "OperatorConfirmed": true, - "OcrConfidence": 1.0, - "TextType": "Text" - } - ] - } - ], - "ColumnInfo": [ - { - "FieldId": "Total", - "FieldName": "Total", - "FieldType": "Text" - }, - { - "FieldId": "From", - "FieldName": "From", - "FieldType": "Text" - }, - { - "FieldId": "To", - "FieldName": "To", - "FieldType": "Text" - } - ], - "NumberOfRows": 2 - } - ] - } - ] - } -} diff --git a/uv.lock b/uv.lock index e65bb7c5e..b85df784e 100644 --- a/uv.lock +++ b/uv.lock @@ -3059,7 +3059,7 @@ wheels = [ [[package]] name = "uipath" -version = "2.1.144" +version = "2.1.145" source = { editable = "." } dependencies = [ { name = "azure-monitor-opentelemetry" },