uipath 2.1.42__tar.gz → 2.1.43__tar.gz

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.
Files changed (273) hide show
  1. {uipath-2.1.42 → uipath-2.1.43}/PKG-INFO +1 -1
  2. {uipath-2.1.42 → uipath-2.1.43}/pyproject.toml +1 -1
  3. uipath-2.1.43/src/uipath/_cli/_evals/_models/_agent_execution_output.py +14 -0
  4. uipath-2.1.43/src/uipath/_cli/_evals/_runtime.py +172 -0
  5. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_runtime/_contracts.py +135 -6
  6. uipath-2.1.43/src/uipath/_cli/_utils/_eval_set.py +84 -0
  7. uipath-2.1.43/src/uipath/_cli/cli_eval.py +149 -0
  8. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/cli_run.py +10 -36
  9. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/middlewares.py +1 -0
  10. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_utils/constants.py +3 -0
  11. uipath-2.1.43/src/uipath/eval/_helpers/__init__.py +3 -0
  12. uipath-2.1.43/src/uipath/eval/_helpers/helpers.py +47 -0
  13. {uipath-2.1.42 → uipath-2.1.43}/uv.lock +1 -1
  14. uipath-2.1.42/src/uipath/_cli/_evals/evaluation_service.py +0 -582
  15. uipath-2.1.42/src/uipath/_cli/cli_eval.py +0 -118
  16. {uipath-2.1.42 → uipath-2.1.43}/.cursorrules +0 -0
  17. {uipath-2.1.42 → uipath-2.1.43}/.editorconfig +0 -0
  18. {uipath-2.1.42 → uipath-2.1.43}/.gitattributes +0 -0
  19. {uipath-2.1.42 → uipath-2.1.43}/.github/workflows/cd.yml +0 -0
  20. {uipath-2.1.42 → uipath-2.1.43}/.github/workflows/ci.yml +0 -0
  21. {uipath-2.1.42 → uipath-2.1.43}/.github/workflows/commitlint.yml +0 -0
  22. {uipath-2.1.42 → uipath-2.1.43}/.github/workflows/lint.yml +0 -0
  23. {uipath-2.1.42 → uipath-2.1.43}/.github/workflows/publish-dev.yml +0 -0
  24. {uipath-2.1.42 → uipath-2.1.43}/.github/workflows/publish-docs.yml +0 -0
  25. {uipath-2.1.42 → uipath-2.1.43}/.github/workflows/slack.yml +0 -0
  26. {uipath-2.1.42 → uipath-2.1.43}/.github/workflows/test.yml +0 -0
  27. {uipath-2.1.42 → uipath-2.1.43}/.gitignore +0 -0
  28. {uipath-2.1.42 → uipath-2.1.43}/.pre-commit-config.yaml +0 -0
  29. {uipath-2.1.42 → uipath-2.1.43}/.python-version +0 -0
  30. {uipath-2.1.42 → uipath-2.1.43}/.vscode/extensions.json +0 -0
  31. {uipath-2.1.42 → uipath-2.1.43}/.vscode/launch.json +0 -0
  32. {uipath-2.1.42 → uipath-2.1.43}/.vscode/settings.json +0 -0
  33. {uipath-2.1.42 → uipath-2.1.43}/CONTRIBUTING.md +0 -0
  34. {uipath-2.1.42 → uipath-2.1.43}/LICENSE +0 -0
  35. {uipath-2.1.42 → uipath-2.1.43}/README.md +0 -0
  36. {uipath-2.1.42 → uipath-2.1.43}/docs/CONTRIBUTING.md +0 -0
  37. {uipath-2.1.42 → uipath-2.1.43}/docs/FAQ.md +0 -0
  38. {uipath-2.1.42 → uipath-2.1.43}/docs/assets/env-preparation-failed-dark.png +0 -0
  39. {uipath-2.1.42 → uipath-2.1.43}/docs/assets/env-preparation-failed-light.png +0 -0
  40. {uipath-2.1.42 → uipath-2.1.43}/docs/assets/favicon.png +0 -0
  41. {uipath-2.1.42 → uipath-2.1.43}/docs/assets/logo-dark.svg +0 -0
  42. {uipath-2.1.42 → uipath-2.1.43}/docs/assets/logo-light.svg +0 -0
  43. {uipath-2.1.42 → uipath-2.1.43}/docs/cli/index.md +0 -0
  44. {uipath-2.1.42 → uipath-2.1.43}/docs/core/actions.md +0 -0
  45. {uipath-2.1.42 → uipath-2.1.43}/docs/core/assets/cloud_env_var_dark.gif +0 -0
  46. {uipath-2.1.42 → uipath-2.1.43}/docs/core/assets/cloud_env_var_light.gif +0 -0
  47. {uipath-2.1.42 → uipath-2.1.43}/docs/core/assets/cloud_env_var_secret_dark.png +0 -0
  48. {uipath-2.1.42 → uipath-2.1.43}/docs/core/assets/cloud_env_var_secret_light.png +0 -0
  49. {uipath-2.1.42 → uipath-2.1.43}/docs/core/assets/copy_path_dark.png +0 -0
  50. {uipath-2.1.42 → uipath-2.1.43}/docs/core/assets/copy_path_light.png +0 -0
  51. {uipath-2.1.42 → uipath-2.1.43}/docs/core/assets.md +0 -0
  52. {uipath-2.1.42 → uipath-2.1.43}/docs/core/attachments.md +0 -0
  53. {uipath-2.1.42 → uipath-2.1.43}/docs/core/buckets.md +0 -0
  54. {uipath-2.1.42 → uipath-2.1.43}/docs/core/connections.md +0 -0
  55. {uipath-2.1.42 → uipath-2.1.43}/docs/core/context_grounding.md +0 -0
  56. {uipath-2.1.42 → uipath-2.1.43}/docs/core/environment_variables.md +0 -0
  57. {uipath-2.1.42 → uipath-2.1.43}/docs/core/getting_started.md +0 -0
  58. {uipath-2.1.42 → uipath-2.1.43}/docs/core/jobs.md +0 -0
  59. {uipath-2.1.42 → uipath-2.1.43}/docs/core/llm_gateway.md +0 -0
  60. {uipath-2.1.42 → uipath-2.1.43}/docs/core/processes.md +0 -0
  61. {uipath-2.1.42 → uipath-2.1.43}/docs/core/queues.md +0 -0
  62. {uipath-2.1.42 → uipath-2.1.43}/docs/core/traced.md +0 -0
  63. {uipath-2.1.42 → uipath-2.1.43}/docs/hooks.py +0 -0
  64. {uipath-2.1.42 → uipath-2.1.43}/docs/index.md +0 -0
  65. {uipath-2.1.42 → uipath-2.1.43}/docs/javascripts/extra.js +0 -0
  66. {uipath-2.1.42 → uipath-2.1.43}/docs/overrides/main.html +0 -0
  67. {uipath-2.1.42 → uipath-2.1.43}/docs/overrides/partials/actions.html +0 -0
  68. {uipath-2.1.42 → uipath-2.1.43}/docs/overrides/partials/logo.html +0 -0
  69. {uipath-2.1.42 → uipath-2.1.43}/docs/release_policy.md +0 -0
  70. {uipath-2.1.42 → uipath-2.1.43}/docs/sample_images/google-ADK-agent/agent-output.png +0 -0
  71. {uipath-2.1.42 → uipath-2.1.43}/docs/stylesheets/extra.css +0 -0
  72. {uipath-2.1.42 → uipath-2.1.43}/justfile +0 -0
  73. {uipath-2.1.42 → uipath-2.1.43}/mkdocs.yml +0 -0
  74. {uipath-2.1.42 → uipath-2.1.43}/py.typed +0 -0
  75. {uipath-2.1.42 → uipath-2.1.43}/samples/event-trigger/.python-version +0 -0
  76. {uipath-2.1.42 → uipath-2.1.43}/samples/event-trigger/README.md +0 -0
  77. {uipath-2.1.42 → uipath-2.1.43}/samples/event-trigger/main.py +0 -0
  78. {uipath-2.1.42 → uipath-2.1.43}/samples/event-trigger/pyproject.toml +0 -0
  79. {uipath-2.1.42 → uipath-2.1.43}/samples/google-ADK-agent/.env.example +0 -0
  80. {uipath-2.1.42 → uipath-2.1.43}/samples/google-ADK-agent/README.md +0 -0
  81. {uipath-2.1.42 → uipath-2.1.43}/samples/google-ADK-agent/input.json +0 -0
  82. {uipath-2.1.42 → uipath-2.1.43}/samples/google-ADK-agent/multi_tool_agent/__init__.py +0 -0
  83. {uipath-2.1.42 → uipath-2.1.43}/samples/google-ADK-agent/multi_tool_agent/agent.py +0 -0
  84. {uipath-2.1.42 → uipath-2.1.43}/samples/google-ADK-agent/pyproject.toml +0 -0
  85. {uipath-2.1.42 → uipath-2.1.43}/samples/google-ADK-agent/uv.lock +0 -0
  86. {uipath-2.1.42 → uipath-2.1.43}/scripts/debug_test.py +0 -0
  87. {uipath-2.1.42 → uipath-2.1.43}/scripts/lint_httpx_client.py +0 -0
  88. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/__init__.py +0 -0
  89. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/README.md +0 -0
  90. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/__init__.py +0 -0
  91. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_auth/_auth_server.py +0 -0
  92. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_auth/_auth_service.py +0 -0
  93. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_auth/_client_credentials.py +0 -0
  94. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_auth/_models.py +0 -0
  95. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_auth/_oidc_utils.py +0 -0
  96. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_auth/_portal_service.py +0 -0
  97. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_auth/_url_utils.py +0 -0
  98. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_auth/_utils.py +0 -0
  99. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_auth/auth_config.json +0 -0
  100. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_auth/index.html +0 -0
  101. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_auth/localhost.crt +0 -0
  102. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_auth/localhost.key +0 -0
  103. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_dev/_terminal/__init__.py +0 -0
  104. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_dev/_terminal/_components/_chat.py +0 -0
  105. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_dev/_terminal/_components/_details.py +0 -0
  106. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_dev/_terminal/_components/_history.py +0 -0
  107. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_dev/_terminal/_components/_json_input.py +0 -0
  108. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_dev/_terminal/_components/_new.py +0 -0
  109. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_dev/_terminal/_models/_execution.py +0 -0
  110. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_dev/_terminal/_models/_messages.py +0 -0
  111. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_dev/_terminal/_styles/terminal.tcss +0 -0
  112. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_dev/_terminal/_utils/_chat.py +0 -0
  113. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_dev/_terminal/_utils/_exporter.py +0 -0
  114. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_dev/_terminal/_utils/_logger.py +0 -0
  115. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_evals/_evaluators/__init__.py +0 -0
  116. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_evals/_evaluators/_deterministic_evaluator_base.py +0 -0
  117. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_evals/_evaluators/_evaluator_base.py +0 -0
  118. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_evals/_evaluators/_evaluator_factory.py +0 -0
  119. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_evals/_evaluators/_exact_match_evaluator.py +0 -0
  120. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_evals/_evaluators/_json_similarity_evaluator.py +0 -0
  121. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_evals/_evaluators/_llm_as_judge_evaluator.py +0 -0
  122. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_evals/_evaluators/_trajectory_evaluator.py +0 -0
  123. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_evals/_models/__init__.py +0 -0
  124. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_evals/_models/_evaluation_set.py +0 -0
  125. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_evals/_models/_evaluators.py +0 -0
  126. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_evals/progress_reporter.py +0 -0
  127. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_push/sw_file_handler.py +0 -0
  128. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_runtime/_escalation.py +0 -0
  129. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_runtime/_hitl.py +0 -0
  130. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_runtime/_logging.py +0 -0
  131. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_runtime/_runtime.py +0 -0
  132. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_templates/.psmdcp.template +0 -0
  133. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_templates/.rels.template +0 -0
  134. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_templates/[Content_Types].xml.template +0 -0
  135. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_templates/main.py.template +0 -0
  136. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_templates/package.nuspec.template +0 -0
  137. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_utils/_common.py +0 -0
  138. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_utils/_console.py +0 -0
  139. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_utils/_constants.py +0 -0
  140. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_utils/_debug.py +0 -0
  141. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_utils/_folders.py +0 -0
  142. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_utils/_input_args.py +0 -0
  143. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_utils/_parse_ast.py +0 -0
  144. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_utils/_processes.py +0 -0
  145. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_utils/_project_files.py +0 -0
  146. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_utils/_studio_project.py +0 -0
  147. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_utils/_tracing.py +0 -0
  148. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/_utils/_uv_helpers.py +0 -0
  149. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/cli_auth.py +0 -0
  150. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/cli_deploy.py +0 -0
  151. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/cli_dev.py +0 -0
  152. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/cli_init.py +0 -0
  153. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/cli_invoke.py +0 -0
  154. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/cli_new.py +0 -0
  155. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/cli_pack.py +0 -0
  156. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/cli_publish.py +0 -0
  157. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/cli_pull.py +0 -0
  158. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/cli_push.py +0 -0
  159. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_cli/spinner.py +0 -0
  160. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_config.py +0 -0
  161. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_execution_context.py +0 -0
  162. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_folder_context.py +0 -0
  163. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_services/__init__.py +0 -0
  164. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_services/_base_service.py +0 -0
  165. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_services/actions_service.py +0 -0
  166. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_services/api_client.py +0 -0
  167. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_services/assets_service.py +0 -0
  168. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_services/attachments_service.py +0 -0
  169. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_services/buckets_service.py +0 -0
  170. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_services/connections_service.py +0 -0
  171. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_services/context_grounding_service.py +0 -0
  172. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_services/folder_service.py +0 -0
  173. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_services/jobs_service.py +0 -0
  174. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_services/llm_gateway_service.py +0 -0
  175. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_services/processes_service.py +0 -0
  176. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_services/queues_service.py +0 -0
  177. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_uipath.py +0 -0
  178. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_utils/__init__.py +0 -0
  179. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_utils/_endpoint.py +0 -0
  180. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_utils/_infer_bindings.py +0 -0
  181. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_utils/_logs.py +0 -0
  182. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_utils/_read_overwrites.py +0 -0
  183. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_utils/_request_override.py +0 -0
  184. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_utils/_request_spec.py +0 -0
  185. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_utils/_ssl_context.py +0 -0
  186. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_utils/_url.py +0 -0
  187. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/_utils/_user_agent.py +0 -0
  188. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/agent/conversation/__init__.py +0 -0
  189. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/agent/conversation/async_stream.py +0 -0
  190. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/agent/conversation/citation.py +0 -0
  191. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/agent/conversation/content.py +0 -0
  192. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/agent/conversation/conversation.py +0 -0
  193. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/agent/conversation/event.py +0 -0
  194. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/agent/conversation/exchange.py +0 -0
  195. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/agent/conversation/message.py +0 -0
  196. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/agent/conversation/meta.py +0 -0
  197. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/agent/conversation/tool.py +0 -0
  198. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/models/__init__.py +0 -0
  199. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/models/action_schema.py +0 -0
  200. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/models/actions.py +0 -0
  201. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/models/assets.py +0 -0
  202. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/models/attachment.py +0 -0
  203. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/models/buckets.py +0 -0
  204. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/models/connections.py +0 -0
  205. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/models/context_grounding.py +0 -0
  206. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/models/context_grounding_index.py +0 -0
  207. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/models/errors.py +0 -0
  208. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/models/exceptions.py +0 -0
  209. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/models/interrupt_models.py +0 -0
  210. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/models/job.py +0 -0
  211. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/models/llm_gateway.py +0 -0
  212. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/models/processes.py +0 -0
  213. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/models/queues.py +0 -0
  214. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/py.typed +0 -0
  215. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/telemetry/__init__.py +0 -0
  216. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/telemetry/_constants.py +0 -0
  217. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/telemetry/_track.py +0 -0
  218. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/tracing/__init__.py +0 -0
  219. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/tracing/_otel_exporters.py +0 -0
  220. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/tracing/_traced.py +0 -0
  221. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/tracing/_utils.py +0 -0
  222. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/utils/__init__.py +0 -0
  223. {uipath-2.1.42 → uipath-2.1.43}/src/uipath/utils/_endpoints_manager.py +0 -0
  224. {uipath-2.1.42 → uipath-2.1.43}/tests/__init__.py +0 -0
  225. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/conftest.py +0 -0
  226. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/evaluators/test_json_similarity_evaluator.py +0 -0
  227. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/mocks/bindings_script.py +0 -0
  228. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/mocks/pyproject.toml +0 -0
  229. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/mocks/simple_script.py +0 -0
  230. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/mocks/uipath-mock.json +0 -0
  231. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/mocks/uipath-simple-script-mock.json +0 -0
  232. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/test_auth.py +0 -0
  233. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/test_hitl.py +0 -0
  234. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/test_init.py +0 -0
  235. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/test_input_args.py +0 -0
  236. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/test_invoke.py +0 -0
  237. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/test_new.py +0 -0
  238. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/test_pack.py +0 -0
  239. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/test_portal_service_ensure_valid_token.py +0 -0
  240. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/test_portal_service_refresh_token.py +0 -0
  241. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/test_publish.py +0 -0
  242. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/test_pull.py +0 -0
  243. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/test_push.py +0 -0
  244. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/test_run.py +0 -0
  245. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/test_utils.py +0 -0
  246. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/utils/common.py +0 -0
  247. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/utils/project_details.py +0 -0
  248. {uipath-2.1.42 → uipath-2.1.43}/tests/cli/utils/uipath_json.py +0 -0
  249. {uipath-2.1.42 → uipath-2.1.43}/tests/conftest.py +0 -0
  250. {uipath-2.1.42 → uipath-2.1.43}/tests/sdk/services/conftest.py +0 -0
  251. {uipath-2.1.42 → uipath-2.1.43}/tests/sdk/services/test_actions_service.py +0 -0
  252. {uipath-2.1.42 → uipath-2.1.43}/tests/sdk/services/test_api_client.py +0 -0
  253. {uipath-2.1.42 → uipath-2.1.43}/tests/sdk/services/test_assets_service.py +0 -0
  254. {uipath-2.1.42 → uipath-2.1.43}/tests/sdk/services/test_attachments_service.py +0 -0
  255. {uipath-2.1.42 → uipath-2.1.43}/tests/sdk/services/test_base_service.py +0 -0
  256. {uipath-2.1.42 → uipath-2.1.43}/tests/sdk/services/test_buckets_service.py +0 -0
  257. {uipath-2.1.42 → uipath-2.1.43}/tests/sdk/services/test_connections_service.py +0 -0
  258. {uipath-2.1.42 → uipath-2.1.43}/tests/sdk/services/test_context_grounding_service.py +0 -0
  259. {uipath-2.1.42 → uipath-2.1.43}/tests/sdk/services/test_folder_service.py +0 -0
  260. {uipath-2.1.42 → uipath-2.1.43}/tests/sdk/services/test_jobs_service.py +0 -0
  261. {uipath-2.1.42 → uipath-2.1.43}/tests/sdk/services/test_llm_integration.py +0 -0
  262. {uipath-2.1.42 → uipath-2.1.43}/tests/sdk/services/test_llm_schema_cleanup.py +0 -0
  263. {uipath-2.1.42 → uipath-2.1.43}/tests/sdk/services/test_llm_service.py +0 -0
  264. {uipath-2.1.42 → uipath-2.1.43}/tests/sdk/services/test_processes_service.py +0 -0
  265. {uipath-2.1.42 → uipath-2.1.43}/tests/sdk/services/test_queues_service.py +0 -0
  266. {uipath-2.1.42 → uipath-2.1.43}/tests/sdk/services/test_uipath_llm_integration.py +0 -0
  267. {uipath-2.1.42 → uipath-2.1.43}/tests/sdk/test_bindings_inference.py +0 -0
  268. {uipath-2.1.42 → uipath-2.1.43}/tests/sdk/test_config.py +0 -0
  269. {uipath-2.1.42 → uipath-2.1.43}/tests/sdk/test_overwrites.py +0 -0
  270. {uipath-2.1.42 → uipath-2.1.43}/tests/tracing/test_otel_exporters.py +0 -0
  271. {uipath-2.1.42 → uipath-2.1.43}/tests/tracing/test_span_utils.py +0 -0
  272. {uipath-2.1.42 → uipath-2.1.43}/tests/tracing/test_traced.py +0 -0
  273. {uipath-2.1.42 → uipath-2.1.43}/tests/tracing/test_tracing_manager.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath
3
- Version: 2.1.42
3
+ Version: 2.1.43
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "uipath"
3
- version = "2.1.42"
3
+ version = "2.1.43"
4
4
  description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
5
5
  readme = { file = "README.md", content-type = "text/markdown" }
6
6
  requires-python = ">=3.10"
@@ -0,0 +1,14 @@
1
+ from opentelemetry.sdk.trace import ReadableSpan
2
+ from pydantic import BaseModel, ConfigDict
3
+
4
+ from uipath._cli._runtime._contracts import UiPathRuntimeResult
5
+
6
+
7
+ class UiPathEvalRunExecutionOutput(BaseModel):
8
+ """Result of a single agent response."""
9
+
10
+ model_config = ConfigDict(arbitrary_types_allowed=True)
11
+
12
+ execution_time: float
13
+ spans: list[ReadableSpan]
14
+ result: UiPathRuntimeResult
@@ -0,0 +1,172 @@
1
+ import copy
2
+ from collections import defaultdict
3
+ from time import time
4
+ from typing import Dict, Generic, List, Optional, Sequence, TypeVar
5
+
6
+ from opentelemetry.sdk.trace import ReadableSpan
7
+ from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult
8
+
9
+ from uipath.eval._helpers import auto_discover_entrypoint
10
+
11
+ from .._runtime._contracts import (
12
+ UiPathBaseRuntime,
13
+ UiPathRuntimeContext,
14
+ UiPathRuntimeFactory,
15
+ UiPathRuntimeResult,
16
+ UiPathRuntimeStatus,
17
+ )
18
+ from .._utils._eval_set import EvalHelpers
19
+ from ._models import EvaluationItem
20
+ from ._models._agent_execution_output import UiPathEvalRunExecutionOutput
21
+
22
+ T = TypeVar("T", bound=UiPathBaseRuntime)
23
+ C = TypeVar("C", bound=UiPathRuntimeContext)
24
+
25
+
26
+ class ExecutionSpanExporter(SpanExporter):
27
+ """Custom exporter that stores spans grouped by execution ids."""
28
+
29
+ def __init__(self):
30
+ # { execution_id -> list of spans }
31
+ self._spans: Dict[str, List[ReadableSpan]] = defaultdict(list)
32
+
33
+ def export(self, spans: Sequence[ReadableSpan]) -> SpanExportResult:
34
+ for span in spans:
35
+ if span.attributes is not None:
36
+ exec_id = span.attributes.get("execution.id")
37
+ if exec_id is not None and isinstance(exec_id, str):
38
+ self._spans[exec_id].append(span)
39
+
40
+ return SpanExportResult.SUCCESS
41
+
42
+ def get_spans(self, execution_id: str) -> List[ReadableSpan]:
43
+ """Retrieve spans for a given execution id."""
44
+ return self._spans.get(execution_id, [])
45
+
46
+ def clear(self, execution_id: Optional[str] = None) -> None:
47
+ """Clear stored spans for one or all executions."""
48
+ if execution_id:
49
+ self._spans.pop(execution_id, None)
50
+ else:
51
+ self._spans.clear()
52
+
53
+ def shutdown(self) -> None:
54
+ self.clear()
55
+
56
+
57
+ class UiPathEvalContext(UiPathRuntimeContext, Generic[C]):
58
+ """Context used for evaluation runs."""
59
+
60
+ runtime_context: C
61
+ no_report: bool
62
+ workers: int
63
+ eval_set: Optional[str] = None
64
+ eval_ids: Optional[List[str]] = None
65
+
66
+ def __init__(
67
+ self,
68
+ runtime_context: C,
69
+ no_report: bool,
70
+ workers: int,
71
+ eval_set: Optional[str] = None,
72
+ eval_ids: Optional[List[str]] = None,
73
+ **kwargs,
74
+ ):
75
+ super().__init__(
76
+ runtime_context=runtime_context, # type: ignore
77
+ no_report=no_report,
78
+ workers=workers,
79
+ eval_set=eval_set,
80
+ eval_ids=eval_ids,
81
+ **kwargs,
82
+ )
83
+ self._auto_discover()
84
+
85
+ def _auto_discover(self):
86
+ self.runtime_context.entrypoint = (
87
+ self.runtime_context.entrypoint or auto_discover_entrypoint()
88
+ )
89
+ self.eval_set = self.eval_set or EvalHelpers.auto_discover_eval_set()
90
+
91
+
92
+ class UiPathEvalRuntime(UiPathBaseRuntime, Generic[T, C]):
93
+ """Specialized runtime for evaluation runs, with access to the factory."""
94
+
95
+ def __init__(
96
+ self, context: "UiPathEvalContext[C]", factory: "UiPathRuntimeFactory[T, C]"
97
+ ):
98
+ super().__init__(context)
99
+ self.context: "UiPathEvalContext[C]" = context
100
+ self.factory: UiPathRuntimeFactory[T, C] = factory
101
+ self.span_exporter: ExecutionSpanExporter = ExecutionSpanExporter()
102
+ self.factory.add_span_exporter(self.span_exporter)
103
+
104
+ @classmethod
105
+ def from__eval_context(
106
+ cls,
107
+ context: "UiPathEvalContext[C]",
108
+ factory: "UiPathRuntimeFactory[T, C]",
109
+ ) -> "UiPathEvalRuntime[T, C]":
110
+ return cls(context, factory)
111
+
112
+ async def execute(self) -> Optional[UiPathRuntimeResult]:
113
+ """Evaluation logic. Can spawn other runtimes through the factory."""
114
+ if self.context.eval_set is None:
115
+ raise ValueError("eval_set must be provided for evaluation runs")
116
+
117
+ evaluation_set = EvalHelpers.load_eval_set(
118
+ self.context.eval_set, self.context.eval_ids
119
+ )
120
+ execution_output_list: list[UiPathEvalRunExecutionOutput] = []
121
+ for eval_item in evaluation_set.evaluations:
122
+ execution_output_list.append(await self.execute_agent(eval_item))
123
+
124
+ self.context.result = UiPathRuntimeResult(
125
+ output={
126
+ "results": execution_output_list,
127
+ },
128
+ status=UiPathRuntimeStatus.SUCCESSFUL,
129
+ resume=None,
130
+ )
131
+
132
+ return self.context.runtime_context.result
133
+
134
+ def _prepare_new_runtime_context(self, eval_item: EvaluationItem) -> C:
135
+ runtime_context = copy.deepcopy(self.context.runtime_context)
136
+ runtime_context.execution_id = eval_item.id
137
+ runtime_context.input_json = eval_item.inputs
138
+ # here we can pass other values from eval_item: expectedAgentBehavior, simulationInstructions etc.
139
+ return runtime_context
140
+
141
+ # TODO: this would most likely need to be ported to a public AgentEvaluator class
142
+ async def execute_agent(
143
+ self, eval_item: EvaluationItem
144
+ ) -> "UiPathEvalRunExecutionOutput":
145
+ runtime_context = self._prepare_new_runtime_context(eval_item)
146
+ start_time = time()
147
+ result = await self.factory.execute_in_root_span(
148
+ runtime_context, root_span=eval_item.name
149
+ )
150
+ end_time = time()
151
+ if runtime_context.execution_id is None:
152
+ raise ValueError("execution_id must be set for eval runs")
153
+
154
+ spans = self.span_exporter.get_spans(runtime_context.execution_id)
155
+ self.span_exporter.clear(runtime_context.execution_id)
156
+
157
+ if result is None:
158
+ raise ValueError("Execution result cannot be None for eval runs")
159
+
160
+ return UiPathEvalRunExecutionOutput(
161
+ execution_time=end_time - start_time,
162
+ spans=spans,
163
+ result=result,
164
+ )
165
+
166
+ async def cleanup(self) -> None:
167
+ """Cleanup runtime resources."""
168
+ pass
169
+
170
+ async def validate(self) -> None:
171
+ """Cleanup runtime resources."""
172
+ pass
@@ -9,6 +9,7 @@ from abc import ABC, abstractmethod
9
9
  from enum import Enum
10
10
  from functools import cached_property
11
11
  from typing import Any, Callable, Dict, Generic, List, Optional, Type, TypeVar, Union
12
+ from uuid import uuid4
12
13
 
13
14
  from opentelemetry import context as context_api
14
15
  from opentelemetry import trace
@@ -23,7 +24,7 @@ from opentelemetry.trace import Tracer
23
24
  from pydantic import BaseModel, Field
24
25
 
25
26
  from uipath.agent.conversation import UiPathConversationEvent, UiPathConversationMessage
26
- from uipath.tracing import TracingManager
27
+ from uipath.tracing import LlmOpsHttpExporter, TracingManager
27
28
 
28
29
  from ._logging import LogsInterceptor
29
30
 
@@ -161,6 +162,128 @@ class UiPathTraceContext(BaseModel):
161
162
  reference_id: Optional[str] = None
162
163
 
163
164
 
165
+ class UiPathRuntimeContextBuilder:
166
+ """Builder class for UiPathRuntimeContext following the builder pattern."""
167
+
168
+ def __init__(self):
169
+ self._kwargs = {}
170
+
171
+ def with_defaults(
172
+ self, config_path: Optional[str] = None, **kwargs
173
+ ) -> "UiPathRuntimeContextBuilder":
174
+ """Apply default configuration similar to UiPathRuntimeContext.with_defaults().
175
+
176
+ Args:
177
+ config_path: Path to the configuration file (defaults to UIPATH_CONFIG_PATH env var or "uipath.json")
178
+ **kwargs: Additional keyword arguments to pass to with_defaults
179
+
180
+ Returns:
181
+ Self for method chaining
182
+ """
183
+ from os import environ as env
184
+
185
+ resolved_config_path = config_path or env.get(
186
+ "UIPATH_CONFIG_PATH", "uipath.json"
187
+ )
188
+ self._kwargs["config_path"] = resolved_config_path
189
+
190
+ self._kwargs.update(
191
+ {
192
+ "job_id": env.get("UIPATH_JOB_KEY"),
193
+ "trace_id": env.get("UIPATH_TRACE_ID"),
194
+ "tracing_enabled": env.get("UIPATH_TRACING_ENABLED", True),
195
+ "logs_min_level": env.get("LOG_LEVEL", "INFO"),
196
+ **kwargs, # Allow overriding defaults with provided kwargs
197
+ }
198
+ )
199
+
200
+ self._kwargs["trace_context"] = UiPathTraceContext(
201
+ trace_id=env.get("UIPATH_TRACE_ID"),
202
+ parent_span_id=env.get("UIPATH_PARENT_SPAN_ID"),
203
+ root_span_id=env.get("UIPATH_ROOT_SPAN_ID"),
204
+ enabled=env.get("UIPATH_TRACING_ENABLED", True),
205
+ job_id=env.get("UIPATH_JOB_KEY"),
206
+ org_id=env.get("UIPATH_ORGANIZATION_ID"),
207
+ tenant_id=env.get("UIPATH_TENANT_ID"),
208
+ process_key=env.get("UIPATH_PROCESS_UUID"),
209
+ folder_key=env.get("UIPATH_FOLDER_KEY"),
210
+ reference_id=env.get("UIPATH_JOB_KEY") or str(uuid4()),
211
+ )
212
+
213
+ return self
214
+
215
+ def with_entrypoint(self, entrypoint: str) -> "UiPathRuntimeContextBuilder":
216
+ """Set the entrypoint for the runtime context.
217
+
218
+ Args:
219
+ entrypoint: The entrypoint to execute
220
+
221
+ Returns:
222
+ Self for method chaining
223
+ """
224
+ self._kwargs["entrypoint"] = entrypoint
225
+ return self
226
+
227
+ def with_input(
228
+ self, input_data: Optional[str] = None, input_file: Optional[str] = None
229
+ ) -> "UiPathRuntimeContextBuilder":
230
+ """Set the input data for the runtime context.
231
+
232
+ Args:
233
+ input_data: The input data as a string
234
+ input_file: Path to the input file
235
+
236
+ Returns:
237
+ Self for method chaining
238
+ """
239
+ if input_data is not None:
240
+ self._kwargs["input"] = input_data
241
+ if input_file is not None:
242
+ self._kwargs["input_file"] = input_file
243
+ return self
244
+
245
+ def with_resume(self, enable: bool = True) -> "UiPathRuntimeContextBuilder":
246
+ """Enable or disable resume mode for the runtime context.
247
+
248
+ Args:
249
+ enable: Whether to enable resume mode (defaults to True)
250
+
251
+ Returns:
252
+ Self for method chaining
253
+ """
254
+ self._kwargs["resume"] = enable
255
+ return self
256
+
257
+ def mark_eval_run(self, enable: bool = True) -> "UiPathRuntimeContextBuilder":
258
+ """Mark this as an evaluation run.
259
+
260
+ Args:
261
+ enable: Whether this is an eval run (defaults to True)
262
+
263
+ Returns:
264
+ Self for method chaining
265
+ """
266
+ self._kwargs["is_eval_run"] = enable
267
+ return self
268
+
269
+ def build(self) -> "UiPathRuntimeContext":
270
+ """Build and return the UiPathRuntimeContext instance.
271
+
272
+ Returns:
273
+ A configured UiPathRuntimeContext instance
274
+ """
275
+ config_path = self._kwargs.pop("config_path", None)
276
+ if config_path:
277
+ # Create context from config first, then update with any additional kwargs
278
+ context = UiPathRuntimeContext.from_config(config_path)
279
+ for key, value in self._kwargs.items():
280
+ if hasattr(context, key):
281
+ setattr(context, key, value)
282
+ return context
283
+ else:
284
+ return UiPathRuntimeContext(**self._kwargs)
285
+
286
+
164
287
  class UiPathRuntimeContext(BaseModel):
165
288
  """Context information passed throughout the runtime execution."""
166
289
 
@@ -422,8 +545,8 @@ class UiPathBaseRuntime(ABC):
422
545
  content = execution_result.to_dict()
423
546
  logger.debug(content)
424
547
 
425
- # Always write output file at runtime
426
- if self.context.job_id:
548
+ # Always write output file at runtime, except evaluation runs
549
+ if self.context.job_id and not self.context.is_eval_run:
427
550
  with open(self.output_file_path, "w") as f:
428
551
  json.dump(content, f, indent=2, default=str)
429
552
 
@@ -521,6 +644,9 @@ class UiPathRuntimeFactory(Generic[T, C]):
521
644
  self.tracer_span_processors: List[SpanProcessor] = []
522
645
  trace.set_tracer_provider(self.tracer_provider)
523
646
 
647
+ if os.getenv("UIPATH_JOB_KEY"):
648
+ self.add_span_exporter(LlmOpsHttpExporter())
649
+
524
650
  def add_span_exporter(
525
651
  self,
526
652
  span_exporter: SpanExporter,
@@ -591,9 +717,12 @@ class UiPathExecutionTraceProcessorMixin:
591
717
  parent_span = trace.get_current_span()
592
718
 
593
719
  if parent_span and parent_span.is_recording():
594
- run_id = parent_span.attributes.get("execution.id") # type: ignore[attr-defined]
595
- if run_id:
596
- span.set_attribute("execution.id", run_id)
720
+ execution_id = parent_span.attributes.get("execution.id") # type: ignore[attr-defined]
721
+ if execution_id:
722
+ span.set_attribute("execution.id", execution_id)
723
+ evaluation_id = parent_span.attributes.get("evaluation.id") # type: ignore[attr-defined]
724
+ if evaluation_id:
725
+ span.set_attribute("evaluation.id", evaluation_id)
597
726
 
598
727
 
599
728
  class UiPathExecutionBatchTraceProcessor(
@@ -0,0 +1,84 @@
1
+ import json
2
+ from pathlib import Path
3
+ from typing import List, Optional
4
+
5
+ import click
6
+
7
+ from uipath._cli._evals._models import EvaluationSet
8
+ from uipath._cli._utils._console import ConsoleLogger
9
+
10
+ console = ConsoleLogger()
11
+
12
+
13
+ class EvalHelpers:
14
+ @staticmethod
15
+ def auto_discover_eval_set() -> str:
16
+ """Auto-discover evaluation set from evals/eval-sets directory.
17
+
18
+ Returns:
19
+ Path to the evaluation set file
20
+
21
+ Raises:
22
+ ValueError: If no eval set found or multiple eval sets exist
23
+ """
24
+ eval_sets_dir = Path("evals/eval-sets")
25
+
26
+ if not eval_sets_dir.exists():
27
+ raise ValueError(
28
+ "No 'evals/eval-sets' directory found. "
29
+ "Please set 'UIPATH_PROJECT_ID' env var and run 'uipath pull'."
30
+ )
31
+
32
+ eval_set_files = list(eval_sets_dir.glob("*.json"))
33
+
34
+ if not eval_set_files:
35
+ raise ValueError(
36
+ "No evaluation set files found in 'evals/eval-sets' directory. "
37
+ )
38
+
39
+ if len(eval_set_files) > 1:
40
+ file_names = [f.name for f in eval_set_files]
41
+ raise ValueError(
42
+ f"Multiple evaluation sets found: {file_names}. "
43
+ f"Please specify which evaluation set to use: 'uipath eval [entrypoint] <eval_set_path>'"
44
+ )
45
+
46
+ eval_set_path = str(eval_set_files[0])
47
+ console.info(
48
+ f"Auto-discovered evaluation set: {click.style(eval_set_path, fg='cyan')}"
49
+ )
50
+
51
+ eval_set_path_obj = Path(eval_set_path)
52
+ if not eval_set_path_obj.is_file() or eval_set_path_obj.suffix != ".json":
53
+ raise ValueError("Evaluation set must be a JSON file")
54
+
55
+ return eval_set_path
56
+
57
+ @staticmethod
58
+ def load_eval_set(
59
+ eval_set_path: str, eval_ids: Optional[List[str]] = None
60
+ ) -> EvaluationSet:
61
+ """Load the evaluation set from file.
62
+
63
+ Returns:
64
+ The loaded evaluation set as EvaluationSet model
65
+ """
66
+ try:
67
+ with open(eval_set_path, "r", encoding="utf-8") as f:
68
+ data = json.load(f)
69
+ except json.JSONDecodeError as e:
70
+ raise ValueError(
71
+ f"Invalid JSON in evaluation set file '{eval_set_path}': {str(e)}. "
72
+ f"Please check the file for syntax errors."
73
+ ) from e
74
+
75
+ try:
76
+ eval_set = EvaluationSet(**data)
77
+ except (TypeError, ValueError) as e:
78
+ raise ValueError(
79
+ f"Invalid evaluation set format in '{eval_set_path}': {str(e)}. "
80
+ f"Please verify the evaluation set structure."
81
+ ) from e
82
+ if eval_ids:
83
+ eval_set.extract_selected_evals(eval_ids)
84
+ return eval_set
@@ -0,0 +1,149 @@
1
+ # type: ignore
2
+ import ast
3
+ import asyncio
4
+ import os
5
+ from datetime import datetime, timezone
6
+ from typing import List, Optional
7
+
8
+ import click
9
+
10
+ from uipath._cli._evals._runtime import UiPathEvalContext, UiPathEvalRuntime
11
+ from uipath._cli._runtime._contracts import (
12
+ UiPathRuntimeContext,
13
+ UiPathRuntimeContextBuilder,
14
+ UiPathRuntimeFactory,
15
+ )
16
+ from uipath._cli._runtime._runtime import UiPathRuntime
17
+ from uipath._cli.middlewares import MiddlewareResult, Middlewares
18
+
19
+ from .._utils.constants import ENV_JOB_ID
20
+ from ..telemetry import track
21
+ from ._utils._console import ConsoleLogger
22
+
23
+ console = ConsoleLogger()
24
+
25
+
26
+ class LiteralOption(click.Option):
27
+ def type_cast_value(self, ctx, value):
28
+ try:
29
+ return ast.literal_eval(value)
30
+ except Exception as e:
31
+ raise click.BadParameter(value) from e
32
+
33
+
34
+ def eval_agent_middleware(
35
+ entrypoint: Optional[str] = None,
36
+ eval_set: Optional[str] = None,
37
+ eval_ids: Optional[List[str]] = None,
38
+ workers: int = 8,
39
+ no_report: bool = False,
40
+ **kwargs,
41
+ ) -> MiddlewareResult:
42
+ def generate_eval_context(
43
+ runtime_context: UiPathRuntimeContext,
44
+ ) -> UiPathEvalContext:
45
+ os.makedirs("evals/results", exist_ok=True)
46
+ timestamp = datetime.now(timezone.utc).strftime("%M-%H-%d-%m-%Y")
47
+ base_context = UiPathRuntimeContextBuilder().with_defaults().build()
48
+ # TODO: the name should include the eval_set name. those files should not be commited to SW
49
+ base_context.execution_output_file = (
50
+ f"evals/results/{timestamp}.json"
51
+ if not os.getenv("UIPATH_JOB_KEY")
52
+ else None
53
+ )
54
+ return UiPathEvalContext(
55
+ runtime_context=runtime_context,
56
+ no_report=no_report,
57
+ workers=workers,
58
+ eval_set=eval_set,
59
+ eval_ids=eval_ids,
60
+ **kwargs,
61
+ **base_context.model_dump(),
62
+ )
63
+
64
+ try:
65
+ runtime_factory = UiPathRuntimeFactory(UiPathRuntime, UiPathRuntimeContext)
66
+ context = (
67
+ UiPathRuntimeContextBuilder()
68
+ .with_defaults(**kwargs)
69
+ .with_entrypoint(entrypoint)
70
+ .with_entrypoint(entrypoint)
71
+ .mark_eval_run()
72
+ .build()
73
+ )
74
+
75
+ async def execute():
76
+ async with UiPathEvalRuntime.from__eval_context(
77
+ factory=runtime_factory, context=generate_eval_context(context)
78
+ ) as eval_runtime:
79
+ await eval_runtime.execute()
80
+
81
+ asyncio.run(execute())
82
+ return MiddlewareResult(should_continue=False)
83
+
84
+ except Exception as e:
85
+ return MiddlewareResult(
86
+ should_continue=False, error_message=f"Error running evaluation: {str(e)}"
87
+ )
88
+
89
+
90
+ @click.command()
91
+ @click.argument("entrypoint", required=False)
92
+ @click.argument("eval_set", required=False)
93
+ @click.option("--eval-ids", cls=LiteralOption, default="[]")
94
+ @click.option(
95
+ "--no-report",
96
+ is_flag=True,
97
+ help="Do not report the evaluation results",
98
+ default=False,
99
+ )
100
+ @click.option(
101
+ "--workers",
102
+ type=int,
103
+ default=8,
104
+ help="Number of parallel workers for running evaluations (default: 8)",
105
+ )
106
+ @track(when=lambda *_a, **_kw: os.getenv(ENV_JOB_ID) is None)
107
+ def eval(
108
+ entrypoint: Optional[str],
109
+ eval_set: Optional[str],
110
+ eval_ids: List[str],
111
+ no_report: bool,
112
+ workers: int,
113
+ ) -> None:
114
+ """Run an evaluation set against the agent.
115
+
116
+ Args:
117
+ entrypoint: Path to the agent script to evaluate (optional, will auto-discover if not specified)
118
+ eval_set: Path to the evaluation set JSON file (optional, will auto-discover if not specified)
119
+ eval_ids: Optional list of evaluation IDs
120
+ workers: Number of parallel workers for running evaluations
121
+ no_report: Do not report the evaluation results
122
+ """
123
+ result = Middlewares.next(
124
+ "eval",
125
+ entrypoint,
126
+ eval_set,
127
+ eval_ids,
128
+ no_report=no_report,
129
+ workers=workers,
130
+ )
131
+
132
+ if result.should_continue:
133
+ result = eval_agent_middleware(
134
+ entrypoint=entrypoint,
135
+ eval_set=eval_set,
136
+ eval_ids=eval_ids,
137
+ workers=workers,
138
+ no_report=no_report,
139
+ )
140
+ if result.should_continue:
141
+ console.error("Could not process the request with any available handler.")
142
+ if result.error_message:
143
+ console.error(result.error_message)
144
+
145
+ console.success("Evaluation completed successfully")
146
+
147
+
148
+ if __name__ == "__main__":
149
+ eval()
@@ -4,12 +4,10 @@ import os
4
4
  import traceback
5
5
  from os import environ as env
6
6
  from typing import Optional, Tuple
7
- from uuid import uuid4
8
7
 
9
8
  import click
10
9
 
11
10
  from uipath._cli._utils._debug import setup_debugging
12
- from uipath.tracing import LlmOpsHttpExporter
13
11
 
14
12
  from .._utils.constants import (
15
13
  ENV_JOB_ID,
@@ -17,9 +15,9 @@ from .._utils.constants import (
17
15
  from ..telemetry import track
18
16
  from ._runtime._contracts import (
19
17
  UiPathRuntimeContext,
18
+ UiPathRuntimeContextBuilder,
20
19
  UiPathRuntimeError,
21
20
  UiPathRuntimeFactory,
22
- UiPathTraceContext,
23
21
  )
24
22
  from ._runtime._runtime import UiPathRuntime
25
23
  from ._utils._console import ConsoleLogger
@@ -61,41 +59,17 @@ Usage: `uipath run <entrypoint_path> <input_arguments> [-f <input_json_file_path
61
59
  )
62
60
 
63
61
  try:
64
- context = UiPathRuntimeContext.from_config(
65
- env.get("UIPATH_CONFIG_PATH", "uipath.json"), **kwargs
66
- )
67
- context.entrypoint = entrypoint
68
- context.input = input
69
- context.resume = resume
70
- context.job_id = env.get("UIPATH_JOB_KEY")
71
- context.trace_id = env.get("UIPATH_TRACE_ID")
72
- context.input_file = kwargs.get("input_file", None)
73
- context.execution_output_file = kwargs.get("execution_output_file", None)
74
- context.is_eval_run = kwargs.get("is_eval_run", False)
75
- context.logs_min_level = env.get("LOG_LEVEL", "INFO")
76
- context.tracing_enabled = env.get("UIPATH_TRACING_ENABLED", True)
77
- context.trace_context = UiPathTraceContext(
78
- trace_id=env.get("UIPATH_TRACE_ID"),
79
- parent_span_id=env.get("UIPATH_PARENT_SPAN_ID"),
80
- root_span_id=env.get("UIPATH_ROOT_SPAN_ID"),
81
- enabled=env.get("UIPATH_TRACING_ENABLED", True),
82
- job_id=env.get("UIPATH_JOB_KEY"),
83
- org_id=env.get("UIPATH_ORGANIZATION_ID"),
84
- tenant_id=env.get("UIPATH_TENANT_ID"),
85
- process_key=env.get("UIPATH_PROCESS_UUID"),
86
- folder_key=env.get("UIPATH_FOLDER_KEY"),
87
- reference_id=env.get("UIPATH_JOB_KEY") or str(uuid4()),
88
- )
89
-
90
62
  runtime_factory = UiPathRuntimeFactory(UiPathRuntime, UiPathRuntimeContext)
63
+ context = (
64
+ UiPathRuntimeContextBuilder()
65
+ .with_defaults(**kwargs)
66
+ .with_entrypoint(entrypoint)
67
+ .with_input(input)
68
+ .with_resume(resume)
69
+ .build()
70
+ )
91
71
 
92
- if context.job_id:
93
- runtime_factory.add_span_exporter(LlmOpsHttpExporter())
94
-
95
- async def execute():
96
- await runtime_factory.execute(context)
97
-
98
- asyncio.run(execute())
72
+ asyncio.run(runtime_factory.execute(context))
99
73
 
100
74
  return MiddlewareResult(should_continue=False)
101
75