uipath 2.1.114__py3-none-any.whl → 2.1.116__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of uipath might be problematic. Click here for more details.

@@ -1,5 +1,6 @@
1
1
  class EvaluationRuntimeException(Exception):
2
- def __init__(self, spans, logs, root_exception):
2
+ def __init__(self, spans, logs, root_exception, execution_time):
3
3
  self.spans = spans
4
4
  self.logs = logs
5
5
  self.root_exception = root_exception
6
+ self.execution_time = execution_time
@@ -478,6 +478,24 @@ class StudioWebProgressReporter:
478
478
 
479
479
  logger.debug("StudioWeb progress reporter subscribed to evaluation events")
480
480
 
481
+ def _serialize_justification(self, justification: Any) -> str | None:
482
+ """Serialize justification to JSON string for API compatibility.
483
+
484
+ Args:
485
+ justification: The justification object which could be None, a BaseModel,
486
+ a string, or any other JSON-serializable object
487
+
488
+ Returns:
489
+ JSON string representation or None if justification is None
490
+ """
491
+ if justification is None:
492
+ return None
493
+ if hasattr(justification, "model_dump"):
494
+ return json.dumps(justification.model_dump())
495
+ if not isinstance(justification, str):
496
+ return json.dumps(justification)
497
+ return justification
498
+
481
499
  def _extract_agent_snapshot(self, entrypoint: str) -> StudioWebAgentSnapshot:
482
500
  try:
483
501
  project_config = get_project_config(os.getcwd())
@@ -531,11 +549,14 @@ class StudioWebProgressReporter:
531
549
  uuid.uuid5(uuid.NAMESPACE_DNS, eval_result.evaluator_id)
532
550
  )
533
551
 
552
+ # Convert BaseModel justification to JSON string for API compatibility
553
+ justification = self._serialize_justification(eval_result.result.details)
554
+
534
555
  evaluator_scores_list.append(
535
556
  {
536
557
  "type": eval_result.result.score_type.value,
537
558
  "value": eval_result.result.score,
538
- "justification": eval_result.result.details,
559
+ "justification": justification,
539
560
  "evaluatorId": evaluator_id_value,
540
561
  }
541
562
  )
@@ -586,11 +607,14 @@ class StudioWebProgressReporter:
586
607
  if eval_result.evaluator_id not in evaluators:
587
608
  continue
588
609
 
610
+ # Convert BaseModel justification to JSON string for API compatibility
611
+ justification = self._serialize_justification(eval_result.result.details)
612
+
589
613
  evaluator_scores_list.append(
590
614
  {
591
615
  "type": eval_result.result.score_type.value,
592
616
  "value": eval_result.result.score,
593
- "justification": eval_result.result.details,
617
+ "justification": justification,
594
618
  "evaluatorId": eval_result.evaluator_id,
595
619
  }
596
620
  )
@@ -603,7 +627,7 @@ class StudioWebProgressReporter:
603
627
  "type": eval_result.result.score_type.value,
604
628
  "value": eval_result.result.score,
605
629
  },
606
- "justification": eval_result.result.details,
630
+ "justification": justification,
607
631
  },
608
632
  "completionMetrics": {
609
633
  "duration": int(eval_result.result.evaluation_time)
@@ -30,6 +30,8 @@ from ...eval.models import EvaluationResult
30
30
  from ...eval.models.models import AgentExecution, EvalItemResult
31
31
  from .._runtime._contracts import (
32
32
  UiPathBaseRuntime,
33
+ UiPathErrorCategory,
34
+ UiPathErrorContract,
33
35
  UiPathExecutionBatchTraceProcessor,
34
36
  UiPathRuntimeContext,
35
37
  UiPathRuntimeFactory,
@@ -364,7 +366,43 @@ class UiPathEvalRuntime(UiPathBaseRuntime, Generic[T, C]):
364
366
  )
365
367
 
366
368
  try:
367
- agent_execution_output = await self.execute_runtime(eval_item, execution_id)
369
+ try:
370
+ agent_execution_output = await self.execute_runtime(
371
+ eval_item, execution_id
372
+ )
373
+ except Exception as e:
374
+ if self.context.verbose:
375
+ error_info = UiPathErrorContract(
376
+ code="RUNTIME_SHUTDOWN_ERROR",
377
+ title="Runtime shutdown failed",
378
+ detail=f"Error: {str(e)}",
379
+ category=UiPathErrorCategory.UNKNOWN,
380
+ )
381
+ error_result = UiPathRuntimeResult(
382
+ status=UiPathRuntimeStatus.FAULTED,
383
+ error=error_info,
384
+ )
385
+ if isinstance(e, EvaluationRuntimeException):
386
+ spans = e.spans
387
+ logs = e.logs
388
+ execution_time = e.execution_time
389
+ else:
390
+ spans = []
391
+ logs = []
392
+ execution_time = 0
393
+
394
+ evaluation_run_results.agent_execution_output = (
395
+ convert_eval_execution_output_to_serializable(
396
+ UiPathEvalRunExecutionOutput(
397
+ execution_time=execution_time,
398
+ result=error_result,
399
+ spans=spans,
400
+ logs=logs,
401
+ )
402
+ )
403
+ )
404
+ raise
405
+
368
406
  if self.context.verbose:
369
407
  evaluation_run_results.agent_execution_output = (
370
408
  convert_eval_execution_output_to_serializable(
@@ -530,6 +568,7 @@ class UiPathEvalRuntime(UiPathBaseRuntime, Generic[T, C]):
530
568
  runtime_context, root_span=eval_item.name, attributes=attributes
531
569
  )
532
570
  except Exception as e:
571
+ end_time = time()
533
572
  spans, logs = self._get_and_clear_execution_data(
534
573
  runtime_context.execution_id
535
574
  )
@@ -537,6 +576,7 @@ class UiPathEvalRuntime(UiPathBaseRuntime, Generic[T, C]):
537
576
  spans=spans,
538
577
  logs=logs,
539
578
  root_exception=e,
579
+ execution_time=end_time - start_time,
540
580
  ) from e
541
581
 
542
582
  end_time = time()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath
3
- Version: 2.1.114
3
+ Version: 2.1.116
4
4
  Summary: Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools.
5
5
  Project-URL: Homepage, https://uipath.com
6
6
  Project-URL: Repository, https://github.com/UiPath/uipath-python
@@ -53,13 +53,13 @@ uipath/_cli/_evals/_console_progress_reporter.py,sha256=RlfhtyEHq2QjyXRevyeAhtGT
53
53
  uipath/_cli/_evals/_evaluate.py,sha256=yRVhZ6uV58EV5Fv5X_K6425ZGsseQslnLe6FpIKy-u8,833
54
54
  uipath/_cli/_evals/_evaluator_factory.py,sha256=gPF9fRMZBOUPnJSM1fzQyXGHMGYQw_0VmHv-JOGbZf4,14348
55
55
  uipath/_cli/_evals/_helpers.py,sha256=dYHgkWxy2fOuqqZDtOKWKsZ1Ri4dn8qMnuB6DE-1MUk,6661
56
- uipath/_cli/_evals/_progress_reporter.py,sha256=QnkDAS_EJcM3Dzfd9h7n7Sqv9aOHhLmiF3O6XQ2UGKg,32179
57
- uipath/_cli/_evals/_runtime.py,sha256=dU2LXZ-T55-wsqRUCP0Kc4AU1oh1MiF4NRKIyPWJytw,23895
56
+ uipath/_cli/_evals/_progress_reporter.py,sha256=qWMJZskfEjHOLKLL7FqhpraFaYAWpcqO2YFV7oAyBDY,33191
57
+ uipath/_cli/_evals/_runtime.py,sha256=beT9cJIj0bcEtn4azTNXgTEz3_tO9Z8SvZDNno04O7I,25490
58
58
  uipath/_cli/_evals/_span_collection.py,sha256=RoKoeDFG2XODdlgI27ionCjU7LLD_C0LJJ3gu0wab10,779
59
59
  uipath/_cli/_evals/_models/_evaluation_set.py,sha256=7P6zIkgerGKHXL6rD1YHXFFWpyxCUpNu7AX71bAaNoE,7270
60
60
  uipath/_cli/_evals/_models/_evaluator.py,sha256=UXrN103gHJFw3MtVWlGwViQWAo2cICRR-n357zL6wTA,9369
61
61
  uipath/_cli/_evals/_models/_evaluator_base_params.py,sha256=8i7Ir70IjaNOINTHMTXVXsKB4koYf3BCR8Vh2cyrBQI,406
62
- uipath/_cli/_evals/_models/_exceptions.py,sha256=-oXLTDa4ab9Boa34ZxuUrCezf8ajIGrIEUVwZnmBASE,195
62
+ uipath/_cli/_evals/_models/_exceptions.py,sha256=yjrXoWwpvqt-Vfa-F-T1h4oM0J7mMIqbNae0CXH_Dmw,256
63
63
  uipath/_cli/_evals/_models/_mocks.py,sha256=mlD9qvdZNniuKxzY_ttJtwLVFvKGvvIukYvy0FTa12k,241
64
64
  uipath/_cli/_evals/_models/_output.py,sha256=ZQiRCqFZWUsPrJ96E_xQlup6xUlz0lmbJQdsy9WUqoU,7450
65
65
  uipath/_cli/_evals/_models/_sw_reporting.py,sha256=tSBLQFAdOIun8eP0vsqt56K6bmCZz_uMaWI3hskg_24,536
@@ -224,8 +224,8 @@ uipath/tracing/_utils.py,sha256=zMjiKjNpSN3YQNEU4-u5AAvPtUsi8QuEqNLya89jfAU,1446
224
224
  uipath/utils/__init__.py,sha256=VD-KXFpF_oWexFg6zyiWMkxl2HM4hYJMIUDZ1UEtGx0,105
225
225
  uipath/utils/_endpoints_manager.py,sha256=tnF_FiCx8qI2XaJDQgYkMN_gl9V0VqNR1uX7iawuLp8,8230
226
226
  uipath/utils/dynamic_schema.py,sha256=w0u_54MoeIAB-mf3GmwX1A_X8_HDrRy6p998PvX9evY,3839
227
- uipath-2.1.114.dist-info/METADATA,sha256=r4o8j02giVGszCNikppWAx4Wli4nxJjPYRIdbPUWm6U,6626
228
- uipath-2.1.114.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
229
- uipath-2.1.114.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
230
- uipath-2.1.114.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
231
- uipath-2.1.114.dist-info/RECORD,,
227
+ uipath-2.1.116.dist-info/METADATA,sha256=ploEygHtDyYUY3KUmrmsEQTBOUofVLdCcKHQ2aQssRc,6626
228
+ uipath-2.1.116.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
229
+ uipath-2.1.116.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
230
+ uipath-2.1.116.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
231
+ uipath-2.1.116.dist-info/RECORD,,