uipath 2.1.44__tar.gz → 2.1.46__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.
- {uipath-2.1.44 → uipath-2.1.46}/PKG-INFO +1 -1
- {uipath-2.1.44 → uipath-2.1.46}/pyproject.toml +1 -1
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_evals/_runtime.py +17 -52
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_runtime/_contracts.py +94 -36
- uipath-2.1.46/src/uipath/_cli/_runtime/_runtime.py +79 -0
- uipath-2.1.44/src/uipath/_cli/_runtime/_runtime.py → uipath-2.1.46/src/uipath/_cli/_runtime/_script_executor.py +15 -73
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/cli_dev.py +4 -2
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/cli_eval.py +26 -32
- uipath-2.1.46/src/uipath/_cli/cli_run.py +128 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_services/processes_service.py +2 -2
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/test_run.py +1 -5
- {uipath-2.1.44 → uipath-2.1.46}/uv.lock +1 -1
- uipath-2.1.44/src/uipath/_cli/cli_run.py +0 -225
- {uipath-2.1.44 → uipath-2.1.46}/.cursorrules +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/.editorconfig +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/.gitattributes +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/.github/workflows/cd.yml +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/.github/workflows/ci.yml +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/.github/workflows/commitlint.yml +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/.github/workflows/lint.yml +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/.github/workflows/publish-dev.yml +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/.github/workflows/publish-docs.yml +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/.github/workflows/slack.yml +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/.github/workflows/test.yml +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/.gitignore +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/.pre-commit-config.yaml +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/.python-version +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/.vscode/extensions.json +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/.vscode/launch.json +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/.vscode/settings.json +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/CONTRIBUTING.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/LICENSE +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/README.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/CONTRIBUTING.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/FAQ.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/assets/env-preparation-failed-dark.png +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/assets/env-preparation-failed-light.png +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/assets/favicon.png +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/assets/logo-dark.svg +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/assets/logo-light.svg +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/cli/index.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/core/actions.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/core/assets/cloud_env_var_dark.gif +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/core/assets/cloud_env_var_light.gif +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/core/assets/cloud_env_var_secret_dark.png +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/core/assets/cloud_env_var_secret_light.png +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/core/assets/copy_path_dark.png +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/core/assets/copy_path_light.png +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/core/assets.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/core/attachments.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/core/buckets.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/core/connections.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/core/context_grounding.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/core/environment_variables.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/core/getting_started.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/core/jobs.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/core/llm_gateway.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/core/processes.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/core/queues.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/core/traced.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/hooks.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/index.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/javascripts/extra.js +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/overrides/main.html +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/overrides/partials/actions.html +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/overrides/partials/logo.html +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/release_policy.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/sample_images/google-ADK-agent/agent-output.png +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/docs/stylesheets/extra.css +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/justfile +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/mkdocs.yml +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/py.typed +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/samples/calculator/README.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/samples/calculator/main.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/samples/calculator/pyproject.toml +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/samples/event-trigger/.python-version +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/samples/event-trigger/README.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/samples/event-trigger/main.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/samples/event-trigger/pyproject.toml +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/samples/google-ADK-agent/.env.example +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/samples/google-ADK-agent/README.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/samples/google-ADK-agent/input.json +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/samples/google-ADK-agent/multi_tool_agent/__init__.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/samples/google-ADK-agent/multi_tool_agent/agent.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/samples/google-ADK-agent/pyproject.toml +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/samples/google-ADK-agent/uv.lock +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/scripts/debug_test.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/scripts/lint_httpx_client.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/__init__.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/README.md +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/__init__.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_auth/_auth_server.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_auth/_auth_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_auth/_client_credentials.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_auth/_models.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_auth/_oidc_utils.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_auth/_portal_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_auth/_url_utils.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_auth/_utils.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_auth/auth_config.json +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_auth/index.html +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_auth/localhost.crt +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_auth/localhost.key +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_dev/_terminal/__init__.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_dev/_terminal/_components/_chat.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_dev/_terminal/_components/_details.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_dev/_terminal/_components/_history.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_dev/_terminal/_components/_json_input.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_dev/_terminal/_components/_new.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_dev/_terminal/_models/_execution.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_dev/_terminal/_models/_messages.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_dev/_terminal/_styles/terminal.tcss +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_dev/_terminal/_utils/_chat.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_dev/_terminal/_utils/_exporter.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_dev/_terminal/_utils/_logger.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_evals/_evaluators/__init__.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_evals/_evaluators/_deterministic_evaluator_base.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_evals/_evaluators/_evaluator_base.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_evals/_evaluators/_evaluator_factory.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_evals/_evaluators/_exact_match_evaluator.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_evals/_evaluators/_json_similarity_evaluator.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_evals/_evaluators/_llm_as_judge_evaluator.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_evals/_evaluators/_trajectory_evaluator.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_evals/_models/__init__.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_evals/_models/_agent_execution_output.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_evals/_models/_evaluation_set.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_evals/_models/_evaluators.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_evals/progress_reporter.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_push/sw_file_handler.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_runtime/_escalation.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_runtime/_hitl.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_runtime/_logging.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_templates/.psmdcp.template +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_templates/.rels.template +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_templates/[Content_Types].xml.template +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_templates/main.py.template +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_templates/package.nuspec.template +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_utils/_common.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_utils/_console.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_utils/_constants.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_utils/_debug.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_utils/_eval_set.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_utils/_folders.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_utils/_input_args.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_utils/_parse_ast.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_utils/_processes.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_utils/_project_files.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_utils/_studio_project.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_utils/_tracing.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/_utils/_uv_helpers.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/cli_auth.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/cli_deploy.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/cli_init.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/cli_invoke.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/cli_new.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/cli_pack.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/cli_publish.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/cli_pull.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/cli_push.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/middlewares.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_cli/spinner.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_config.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_execution_context.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_folder_context.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_services/__init__.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_services/_base_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_services/actions_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_services/api_client.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_services/assets_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_services/attachments_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_services/buckets_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_services/connections_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_services/context_grounding_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_services/folder_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_services/jobs_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_services/llm_gateway_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_services/queues_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_uipath.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_utils/__init__.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_utils/_endpoint.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_utils/_infer_bindings.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_utils/_logs.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_utils/_read_overwrites.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_utils/_request_override.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_utils/_request_spec.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_utils/_ssl_context.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_utils/_url.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_utils/_user_agent.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/_utils/constants.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/agent/conversation/__init__.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/agent/conversation/async_stream.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/agent/conversation/citation.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/agent/conversation/content.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/agent/conversation/conversation.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/agent/conversation/event.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/agent/conversation/exchange.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/agent/conversation/message.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/agent/conversation/meta.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/agent/conversation/tool.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/eval/_helpers/__init__.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/eval/_helpers/helpers.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/models/__init__.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/models/action_schema.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/models/actions.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/models/assets.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/models/attachment.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/models/buckets.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/models/connections.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/models/context_grounding.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/models/context_grounding_index.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/models/errors.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/models/exceptions.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/models/interrupt_models.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/models/job.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/models/llm_gateway.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/models/processes.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/models/queues.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/py.typed +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/telemetry/__init__.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/telemetry/_constants.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/telemetry/_track.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/tracing/__init__.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/tracing/_otel_exporters.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/tracing/_traced.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/tracing/_utils.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/utils/__init__.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/src/uipath/utils/_endpoints_manager.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/__init__.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/conftest.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/evaluators/test_json_similarity_evaluator.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/mocks/bindings_script.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/mocks/pyproject.toml +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/mocks/simple_script.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/mocks/uipath-mock.json +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/mocks/uipath-simple-script-mock.json +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/test_auth.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/test_hitl.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/test_init.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/test_input_args.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/test_invoke.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/test_new.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/test_pack.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/test_portal_service_ensure_valid_token.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/test_portal_service_refresh_token.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/test_publish.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/test_pull.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/test_push.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/test_utils.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/utils/common.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/utils/project_details.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/cli/utils/uipath_json.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/conftest.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/sdk/services/conftest.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/sdk/services/test_actions_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/sdk/services/test_api_client.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/sdk/services/test_assets_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/sdk/services/test_attachments_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/sdk/services/test_base_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/sdk/services/test_buckets_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/sdk/services/test_connections_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/sdk/services/test_context_grounding_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/sdk/services/test_folder_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/sdk/services/test_jobs_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/sdk/services/test_llm_integration.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/sdk/services/test_llm_schema_cleanup.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/sdk/services/test_llm_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/sdk/services/test_processes_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/sdk/services/test_queues_service.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/sdk/services/test_uipath_llm_integration.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/sdk/test_bindings_inference.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/sdk/test_config.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/sdk/test_overwrites.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/tracing/test_otel_exporters.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/tracing/test_span_utils.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/tests/tracing/test_traced.py +0 -0
- {uipath-2.1.44 → uipath-2.1.46}/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.
|
3
|
+
Version: 2.1.46
|
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.
|
3
|
+
version = "2.1.46"
|
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"
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import copy
|
2
1
|
from collections import defaultdict
|
3
2
|
from time import time
|
4
3
|
from typing import Dict, Generic, List, Optional, Sequence, TypeVar
|
@@ -6,8 +5,6 @@ from typing import Dict, Generic, List, Optional, Sequence, TypeVar
|
|
6
5
|
from opentelemetry.sdk.trace import ReadableSpan
|
7
6
|
from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult
|
8
7
|
|
9
|
-
from uipath.eval._helpers import auto_discover_entrypoint
|
10
|
-
|
11
8
|
from .._runtime._contracts import (
|
12
9
|
UiPathBaseRuntime,
|
13
10
|
UiPathRuntimeContext,
|
@@ -54,49 +51,21 @@ class ExecutionSpanExporter(SpanExporter):
|
|
54
51
|
self.clear()
|
55
52
|
|
56
53
|
|
57
|
-
class UiPathEvalContext(UiPathRuntimeContext
|
54
|
+
class UiPathEvalContext(UiPathRuntimeContext):
|
58
55
|
"""Context used for evaluation runs."""
|
59
56
|
|
60
|
-
|
61
|
-
|
62
|
-
workers: int
|
57
|
+
no_report: Optional[bool] = False
|
58
|
+
workers: Optional[int] = 1
|
63
59
|
eval_set: Optional[str] = None
|
64
60
|
eval_ids: Optional[List[str]] = None
|
65
61
|
|
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
62
|
|
92
63
|
class UiPathEvalRuntime(UiPathBaseRuntime, Generic[T, C]):
|
93
64
|
"""Specialized runtime for evaluation runs, with access to the factory."""
|
94
65
|
|
95
|
-
def __init__(
|
96
|
-
self, context: "UiPathEvalContext[C]", factory: "UiPathRuntimeFactory[T, C]"
|
97
|
-
):
|
66
|
+
def __init__(self, context: UiPathEvalContext, factory: UiPathRuntimeFactory[T, C]):
|
98
67
|
super().__init__(context)
|
99
|
-
self.context:
|
68
|
+
self.context: UiPathEvalContext = context
|
100
69
|
self.factory: UiPathRuntimeFactory[T, C] = factory
|
101
70
|
self.span_exporter: ExecutionSpanExporter = ExecutionSpanExporter()
|
102
71
|
self.factory.add_span_exporter(self.span_exporter)
|
@@ -104,8 +73,8 @@ class UiPathEvalRuntime(UiPathBaseRuntime, Generic[T, C]):
|
|
104
73
|
@classmethod
|
105
74
|
def from_eval_context(
|
106
75
|
cls,
|
107
|
-
context:
|
108
|
-
factory:
|
76
|
+
context: UiPathEvalContext,
|
77
|
+
factory: UiPathRuntimeFactory[T, C],
|
109
78
|
) -> "UiPathEvalRuntime[T, C]":
|
110
79
|
return cls(context, factory)
|
111
80
|
|
@@ -119,30 +88,26 @@ class UiPathEvalRuntime(UiPathBaseRuntime, Generic[T, C]):
|
|
119
88
|
)
|
120
89
|
execution_output_list: list[UiPathEvalRunExecutionOutput] = []
|
121
90
|
for eval_item in evaluation_set.evaluations:
|
122
|
-
|
91
|
+
execution_output = await self.execute_runtime(eval_item)
|
92
|
+
execution_output_list.append(execution_output)
|
123
93
|
|
124
94
|
self.context.result = UiPathRuntimeResult(
|
125
95
|
output={
|
126
96
|
"results": execution_output_list,
|
127
97
|
},
|
128
98
|
status=UiPathRuntimeStatus.SUCCESSFUL,
|
129
|
-
resume=None,
|
130
99
|
)
|
131
100
|
|
132
|
-
return self.context.
|
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
|
101
|
+
return self.context.result
|
140
102
|
|
141
|
-
|
142
|
-
async def execute_agent(
|
103
|
+
async def execute_runtime(
|
143
104
|
self, eval_item: EvaluationItem
|
144
|
-
) ->
|
145
|
-
runtime_context = self.
|
105
|
+
) -> UiPathEvalRunExecutionOutput:
|
106
|
+
runtime_context: C = self.factory.new_context(
|
107
|
+
execution_id=eval_item.id,
|
108
|
+
input_json=eval_item.inputs,
|
109
|
+
is_eval_run=True,
|
110
|
+
)
|
146
111
|
start_time = time()
|
147
112
|
result = await self.factory.execute_in_root_span(
|
148
113
|
runtime_context, root_span=eval_item.name
|
@@ -30,6 +30,9 @@ from ._logging import LogsInterceptor
|
|
30
30
|
|
31
31
|
logger = logging.getLogger(__name__)
|
32
32
|
|
33
|
+
T = TypeVar("T", bound="UiPathBaseRuntime")
|
34
|
+
C = TypeVar("C", bound="UiPathRuntimeContext")
|
35
|
+
|
33
36
|
|
34
37
|
class UiPathResumeTriggerType(str, Enum):
|
35
38
|
"""Constants representing different types of resume job triggers in the system."""
|
@@ -315,21 +318,48 @@ class UiPathRuntimeContext(BaseModel):
|
|
315
318
|
model_config = {"arbitrary_types_allowed": True}
|
316
319
|
|
317
320
|
@classmethod
|
318
|
-
def
|
319
|
-
"""
|
321
|
+
def with_defaults(cls: type[C], config_path: Optional[str] = None, **kwargs) -> C:
|
322
|
+
"""Construct a context with defaults, reading env vars and config file."""
|
323
|
+
resolved_config_path = config_path or os.environ.get(
|
324
|
+
"UIPATH_CONFIG_PATH", "uipath.json"
|
325
|
+
)
|
320
326
|
|
321
|
-
|
322
|
-
|
323
|
-
|
327
|
+
base = cls.from_config(resolved_config_path)
|
328
|
+
|
329
|
+
bool_map = {"true": True, "false": False}
|
330
|
+
tracing_enabled = os.environ.get("UIPATH_TRACING_ENABLED", True)
|
331
|
+
if isinstance(tracing_enabled, str) and tracing_enabled.lower() in bool_map:
|
332
|
+
tracing_enabled = bool_map[tracing_enabled.lower()]
|
333
|
+
|
334
|
+
# Apply defaults from env
|
335
|
+
base.job_id = os.environ.get("UIPATH_JOB_KEY")
|
336
|
+
base.trace_id = os.environ.get("UIPATH_TRACE_ID")
|
337
|
+
base.tracing_enabled = tracing_enabled
|
338
|
+
base.logs_min_level = os.environ.get("LOG_LEVEL", "INFO")
|
339
|
+
|
340
|
+
base.trace_context = UiPathTraceContext(
|
341
|
+
trace_id=os.environ.get("UIPATH_TRACE_ID"),
|
342
|
+
parent_span_id=os.environ.get("UIPATH_PARENT_SPAN_ID"),
|
343
|
+
root_span_id=os.environ.get("UIPATH_ROOT_SPAN_ID"),
|
344
|
+
enabled=tracing_enabled,
|
345
|
+
job_id=os.environ.get("UIPATH_JOB_KEY"),
|
346
|
+
org_id=os.environ.get("UIPATH_ORGANIZATION_ID"),
|
347
|
+
tenant_id=os.environ.get("UIPATH_TENANT_ID"),
|
348
|
+
process_key=os.environ.get("UIPATH_PROCESS_UUID"),
|
349
|
+
folder_key=os.environ.get("UIPATH_FOLDER_KEY"),
|
350
|
+
reference_id=os.environ.get("UIPATH_JOB_KEY") or str(uuid4()),
|
351
|
+
)
|
324
352
|
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
import json
|
329
|
-
import os
|
353
|
+
# Override with kwargs
|
354
|
+
for k, v in kwargs.items():
|
355
|
+
setattr(base, k, v)
|
330
356
|
|
331
|
-
|
357
|
+
return base
|
332
358
|
|
359
|
+
@classmethod
|
360
|
+
def from_config(cls: type[C], config_path: Optional[str] = None, **kwargs) -> C:
|
361
|
+
"""Load configuration from uipath.json file."""
|
362
|
+
path = config_path or "uipath.json"
|
333
363
|
config = {}
|
334
364
|
|
335
365
|
if os.path.exists(path):
|
@@ -346,7 +376,6 @@ class UiPathRuntimeContext(BaseModel):
|
|
346
376
|
}
|
347
377
|
|
348
378
|
attributes_set = set()
|
349
|
-
# set values from config file if available
|
350
379
|
if "runtime" in config:
|
351
380
|
runtime_config = config["runtime"]
|
352
381
|
for config_key, attr_name in mapping.items():
|
@@ -354,10 +383,8 @@ class UiPathRuntimeContext(BaseModel):
|
|
354
383
|
attributes_set.add(attr_name)
|
355
384
|
setattr(instance, attr_name, runtime_config[config_key])
|
356
385
|
|
357
|
-
# fallback to kwargs for any values not set from config file
|
358
386
|
for _, attr_name in mapping.items():
|
359
387
|
if attr_name in kwargs and hasattr(instance, attr_name):
|
360
|
-
# Only set from kwargs if not already set from config file
|
361
388
|
if attr_name not in attributes_set:
|
362
389
|
setattr(instance, attr_name, kwargs[attr_name])
|
363
390
|
|
@@ -383,7 +410,7 @@ class UiPathRuntimeError(Exception):
|
|
383
410
|
if (
|
384
411
|
tb and tb.strip() != "NoneType: None"
|
385
412
|
): # Ensure there's an actual traceback
|
386
|
-
detail = f"{detail}\n\
|
413
|
+
detail = f"{detail}\n\n{tb}"
|
387
414
|
|
388
415
|
if status is None:
|
389
416
|
status = self._extract_http_status()
|
@@ -473,6 +500,21 @@ class UiPathBaseRuntime(ABC):
|
|
473
500
|
with open(self.context.input_file) as f:
|
474
501
|
self.context.input = f.read()
|
475
502
|
|
503
|
+
try:
|
504
|
+
if self.context.input:
|
505
|
+
self.context.input_json = json.loads(self.context.input)
|
506
|
+
if self.context.input_json is None:
|
507
|
+
self.context.input_json = {}
|
508
|
+
except json.JSONDecodeError as e:
|
509
|
+
raise UiPathRuntimeError(
|
510
|
+
"INPUT_INVALID_JSON",
|
511
|
+
"Invalid JSON input",
|
512
|
+
f"The input data is not valid JSON: {str(e)}",
|
513
|
+
UiPathErrorCategory.USER,
|
514
|
+
) from e
|
515
|
+
|
516
|
+
await self.validate()
|
517
|
+
|
476
518
|
# Intercept all stdout/stderr/logs and write them to a file (runtime/evals), stdout (debug)
|
477
519
|
self.logs_interceptor = LogsInterceptor(
|
478
520
|
min_level=self.context.logs_min_level,
|
@@ -620,14 +662,16 @@ class UiPathBaseRuntime(ABC):
|
|
620
662
|
return os.path.join("__uipath", "state.db")
|
621
663
|
|
622
664
|
|
623
|
-
T = TypeVar("T", bound=UiPathBaseRuntime)
|
624
|
-
C = TypeVar("C", bound=UiPathRuntimeContext)
|
625
|
-
|
626
|
-
|
627
665
|
class UiPathRuntimeFactory(Generic[T, C]):
|
628
666
|
"""Generic factory for UiPath runtime classes."""
|
629
667
|
|
630
|
-
def __init__(
|
668
|
+
def __init__(
|
669
|
+
self,
|
670
|
+
runtime_class: Type[T],
|
671
|
+
context_class: Type[C],
|
672
|
+
runtime_generator: Optional[Callable[[C], T]] = None,
|
673
|
+
context_generator: Optional[Callable[..., C]] = None,
|
674
|
+
):
|
631
675
|
if not issubclass(runtime_class, UiPathBaseRuntime):
|
632
676
|
raise TypeError(
|
633
677
|
f"runtime_class {runtime_class.__name__} must inherit from UiPathBaseRuntime"
|
@@ -640,10 +684,11 @@ class UiPathRuntimeFactory(Generic[T, C]):
|
|
640
684
|
|
641
685
|
self.runtime_class = runtime_class
|
642
686
|
self.context_class = context_class
|
687
|
+
self.runtime_generator = runtime_generator
|
688
|
+
self.context_generator = context_generator
|
643
689
|
self.tracer_provider: TracerProvider = TracerProvider()
|
644
690
|
self.tracer_span_processors: List[SpanProcessor] = []
|
645
691
|
trace.set_tracer_provider(self.tracer_provider)
|
646
|
-
|
647
692
|
if os.getenv("UIPATH_JOB_KEY"):
|
648
693
|
self.add_span_exporter(LlmOpsHttpExporter())
|
649
694
|
|
@@ -674,36 +719,49 @@ class UiPathRuntimeFactory(Generic[T, C]):
|
|
674
719
|
|
675
720
|
def new_context(self, **kwargs) -> C:
|
676
721
|
"""Create a new context instance."""
|
722
|
+
if self.context_generator:
|
723
|
+
return self.context_generator(**kwargs)
|
677
724
|
return self.context_class(**kwargs)
|
678
725
|
|
726
|
+
def new_runtime(self) -> T:
|
727
|
+
"""Create a new runtime instance."""
|
728
|
+
context = self.new_context()
|
729
|
+
if self.runtime_generator:
|
730
|
+
return self.runtime_generator(context)
|
731
|
+
return self.runtime_class.from_context(context)
|
732
|
+
|
679
733
|
def from_context(self, context: C) -> T:
|
680
734
|
"""Create runtime instance from context."""
|
735
|
+
if self.runtime_generator:
|
736
|
+
return self.runtime_generator(context)
|
681
737
|
return self.runtime_class.from_context(context)
|
682
738
|
|
683
739
|
async def execute(self, context: C) -> Optional[UiPathRuntimeResult]:
|
684
740
|
"""Execute runtime with context."""
|
685
741
|
async with self.from_context(context) as runtime:
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
742
|
+
try:
|
743
|
+
return await runtime.execute()
|
744
|
+
finally:
|
745
|
+
for span_processor in self.tracer_span_processors:
|
746
|
+
span_processor.force_flush()
|
690
747
|
|
691
748
|
async def execute_in_root_span(
|
692
749
|
self, context: C, root_span: str = "root"
|
693
750
|
) -> Optional[UiPathRuntimeResult]:
|
694
751
|
"""Execute runtime with context."""
|
695
752
|
async with self.from_context(context) as runtime:
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
753
|
+
try:
|
754
|
+
tracer: Tracer = trace.get_tracer("uipath-runtime")
|
755
|
+
with tracer.start_as_current_span(
|
756
|
+
root_span,
|
757
|
+
attributes={"execution.id": context.execution_id}
|
758
|
+
if context.execution_id
|
759
|
+
else {},
|
760
|
+
):
|
761
|
+
return await runtime.execute()
|
762
|
+
finally:
|
763
|
+
for span_processor in self.tracer_span_processors:
|
764
|
+
span_processor.force_flush()
|
707
765
|
|
708
766
|
|
709
767
|
class UiPathExecutionTraceProcessorMixin:
|
@@ -0,0 +1,79 @@
|
|
1
|
+
"""Python script runtime implementation for executing and managing python scripts."""
|
2
|
+
|
3
|
+
import logging
|
4
|
+
from typing import Any, Awaitable, Callable, Optional, TypeVar
|
5
|
+
|
6
|
+
from ._contracts import (
|
7
|
+
UiPathBaseRuntime,
|
8
|
+
UiPathErrorCategory,
|
9
|
+
UiPathRuntimeContext,
|
10
|
+
UiPathRuntimeError,
|
11
|
+
UiPathRuntimeResult,
|
12
|
+
UiPathRuntimeStatus,
|
13
|
+
)
|
14
|
+
from ._script_executor import ScriptExecutor
|
15
|
+
|
16
|
+
logger = logging.getLogger(__name__)
|
17
|
+
|
18
|
+
T = TypeVar("T")
|
19
|
+
R = TypeVar("R")
|
20
|
+
AsyncFunc = Callable[[T], Awaitable[R]]
|
21
|
+
|
22
|
+
|
23
|
+
class UiPathRuntime(UiPathBaseRuntime):
|
24
|
+
def __init__(self, context: UiPathRuntimeContext, executor: AsyncFunc[Any, Any]):
|
25
|
+
self.context = context
|
26
|
+
self.executor = executor
|
27
|
+
|
28
|
+
async def cleanup(self) -> None:
|
29
|
+
"""Cleanup runtime resources."""
|
30
|
+
pass
|
31
|
+
|
32
|
+
async def validate(self):
|
33
|
+
"""Validate runtime context."""
|
34
|
+
pass
|
35
|
+
|
36
|
+
async def execute(self) -> Optional[UiPathRuntimeResult]:
|
37
|
+
"""Execute the Python script with the provided input and configuration.
|
38
|
+
|
39
|
+
Returns:
|
40
|
+
Dictionary with execution results
|
41
|
+
|
42
|
+
Raises:
|
43
|
+
UiPathRuntimeError: If execution fails
|
44
|
+
"""
|
45
|
+
try:
|
46
|
+
script_result = await self.executor(self.context.input_json)
|
47
|
+
|
48
|
+
if self.context.job_id is None:
|
49
|
+
logger.info(script_result)
|
50
|
+
|
51
|
+
self.context.result = UiPathRuntimeResult(
|
52
|
+
output=script_result, status=UiPathRuntimeStatus.SUCCESSFUL
|
53
|
+
)
|
54
|
+
|
55
|
+
return self.context.result
|
56
|
+
|
57
|
+
except Exception as e:
|
58
|
+
if isinstance(e, UiPathRuntimeError):
|
59
|
+
raise
|
60
|
+
|
61
|
+
raise UiPathRuntimeError(
|
62
|
+
"EXECUTION_ERROR",
|
63
|
+
"Python script execution failed",
|
64
|
+
f"Error: {str(e)}",
|
65
|
+
UiPathErrorCategory.SYSTEM,
|
66
|
+
) from e
|
67
|
+
|
68
|
+
|
69
|
+
class UiPathScriptRuntime(UiPathRuntime):
|
70
|
+
"""Runtime for executing Python scripts."""
|
71
|
+
|
72
|
+
def __init__(self, context: UiPathRuntimeContext, entrypoint: str):
|
73
|
+
executor = ScriptExecutor(entrypoint)
|
74
|
+
super().__init__(context, executor)
|
75
|
+
|
76
|
+
@classmethod
|
77
|
+
def from_context(cls, context: UiPathRuntimeContext):
|
78
|
+
"""Create runtime instance from context."""
|
79
|
+
return UiPathScriptRuntime(context, context.entrypoint or "")
|
@@ -2,72 +2,31 @@
|
|
2
2
|
|
3
3
|
import importlib.util
|
4
4
|
import inspect
|
5
|
-
import json
|
6
|
-
import logging
|
7
5
|
import os
|
8
6
|
from dataclasses import asdict, is_dataclass
|
9
|
-
from typing import Any, Dict,
|
7
|
+
from typing import Any, Dict, Type, TypeVar, cast, get_type_hints
|
10
8
|
|
11
9
|
from pydantic import BaseModel
|
12
10
|
|
13
11
|
from ._contracts import (
|
14
|
-
UiPathBaseRuntime,
|
15
12
|
UiPathErrorCategory,
|
16
13
|
UiPathRuntimeError,
|
17
|
-
UiPathRuntimeResult,
|
18
|
-
UiPathRuntimeStatus,
|
19
14
|
)
|
20
15
|
|
21
|
-
logger = logging.getLogger(__name__)
|
22
|
-
|
23
16
|
T = TypeVar("T")
|
24
17
|
|
25
18
|
|
26
|
-
class
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
"""Execute the Python script with the provided input and configuration.
|
31
|
-
|
32
|
-
Returns:
|
33
|
-
Dictionary with execution results
|
34
|
-
|
35
|
-
Raises:
|
36
|
-
UiPathRuntimeError: If execution fails
|
37
|
-
"""
|
38
|
-
await self.validate()
|
39
|
-
|
40
|
-
try:
|
41
|
-
if self.context.entrypoint is None:
|
42
|
-
return None
|
43
|
-
|
44
|
-
script_result = await self._execute_python_script(
|
45
|
-
self.context.entrypoint, self.context.input_json
|
46
|
-
)
|
47
|
-
|
48
|
-
if self.context.job_id is None:
|
49
|
-
logger.info(script_result)
|
50
|
-
|
51
|
-
self.context.result = UiPathRuntimeResult(
|
52
|
-
output=script_result, status=UiPathRuntimeStatus.SUCCESSFUL
|
53
|
-
)
|
54
|
-
|
55
|
-
return self.context.result
|
56
|
-
|
57
|
-
except Exception as e:
|
58
|
-
if isinstance(e, UiPathRuntimeError):
|
59
|
-
raise
|
19
|
+
class ScriptExecutor:
|
20
|
+
def __init__(self, entrypoint: str):
|
21
|
+
self.entrypoint = entrypoint
|
22
|
+
self.validate_entrypoint()
|
60
23
|
|
61
|
-
|
62
|
-
|
63
|
-
"Python script execution failed",
|
64
|
-
f"Error: {str(e)}",
|
65
|
-
UiPathErrorCategory.SYSTEM,
|
66
|
-
) from e
|
24
|
+
async def __call__(self, input: Any) -> Any:
|
25
|
+
return await self._execute_python_script(input)
|
67
26
|
|
68
|
-
|
27
|
+
def validate_entrypoint(self) -> None:
|
69
28
|
"""Validate runtime inputs."""
|
70
|
-
if not self.
|
29
|
+
if not self.entrypoint:
|
71
30
|
raise UiPathRuntimeError(
|
72
31
|
"ENTRYPOINT_MISSING",
|
73
32
|
"No entrypoint specified",
|
@@ -75,39 +34,22 @@ class UiPathRuntime(UiPathBaseRuntime):
|
|
75
34
|
UiPathErrorCategory.USER,
|
76
35
|
)
|
77
36
|
|
78
|
-
if not os.path.exists(self.
|
37
|
+
if not os.path.exists(self.entrypoint):
|
79
38
|
raise UiPathRuntimeError(
|
80
39
|
"ENTRYPOINT_NOT_FOUND",
|
81
40
|
"Script not found",
|
82
|
-
f"Script not found at path {self.
|
41
|
+
f"Script not found at path {self.entrypoint}.",
|
83
42
|
UiPathErrorCategory.USER,
|
84
43
|
)
|
85
44
|
|
86
|
-
|
87
|
-
if self.context.input:
|
88
|
-
self.context.input_json = json.loads(self.context.input)
|
89
|
-
if self.context.input_json is None:
|
90
|
-
self.context.input_json = {}
|
91
|
-
except json.JSONDecodeError as e:
|
92
|
-
raise UiPathRuntimeError(
|
93
|
-
"INPUT_INVALID_JSON",
|
94
|
-
"Invalid JSON input",
|
95
|
-
f"The input data is not valid JSON: {str(e)}",
|
96
|
-
UiPathErrorCategory.USER,
|
97
|
-
) from e
|
98
|
-
|
99
|
-
async def cleanup(self) -> None:
|
100
|
-
"""Cleanup runtime resources."""
|
101
|
-
pass
|
102
|
-
|
103
|
-
async def _execute_python_script(self, script_path: str, input_data: Any) -> Any:
|
45
|
+
async def _execute_python_script(self, input_data: Any) -> Any:
|
104
46
|
"""Execute the Python script with the given input."""
|
105
|
-
spec = importlib.util.spec_from_file_location("dynamic_module",
|
47
|
+
spec = importlib.util.spec_from_file_location("dynamic_module", self.entrypoint)
|
106
48
|
if not spec or not spec.loader:
|
107
49
|
raise UiPathRuntimeError(
|
108
50
|
"IMPORT_ERROR",
|
109
51
|
"Module import failed",
|
110
|
-
f"Could not load spec for {
|
52
|
+
f"Could not load spec for {self.entrypoint}",
|
111
53
|
UiPathErrorCategory.USER,
|
112
54
|
)
|
113
55
|
|
@@ -202,7 +144,7 @@ class UiPathRuntime(UiPathBaseRuntime):
|
|
202
144
|
raise UiPathRuntimeError(
|
203
145
|
"ENTRYPOINT_FUNCTION_MISSING",
|
204
146
|
"No entry function found",
|
205
|
-
f"No main function (main, run, or execute) found in {
|
147
|
+
f"No main function (main, run, or execute) found in {self.entrypoint}",
|
206
148
|
UiPathErrorCategory.USER,
|
207
149
|
)
|
208
150
|
|
@@ -6,7 +6,7 @@ import click
|
|
6
6
|
|
7
7
|
from uipath._cli._dev._terminal import UiPathDevTerminal
|
8
8
|
from uipath._cli._runtime._contracts import UiPathRuntimeContext, UiPathRuntimeFactory
|
9
|
-
from uipath._cli._runtime._runtime import
|
9
|
+
from uipath._cli._runtime._runtime import UiPathScriptRuntime
|
10
10
|
from uipath._cli._utils._console import ConsoleLogger
|
11
11
|
from uipath._cli._utils._debug import setup_debugging
|
12
12
|
from uipath._cli.cli_init import init # type: ignore[attr-defined]
|
@@ -53,7 +53,9 @@ def dev(interface: Optional[str], debug: bool, debug_port: int) -> None:
|
|
53
53
|
|
54
54
|
try:
|
55
55
|
if interface == "terminal":
|
56
|
-
runtime_factory = UiPathRuntimeFactory(
|
56
|
+
runtime_factory = UiPathRuntimeFactory(
|
57
|
+
UiPathScriptRuntime, UiPathRuntimeContext
|
58
|
+
)
|
57
59
|
app = UiPathDevTerminal(runtime_factory)
|
58
60
|
asyncio.run(app.run_async())
|
59
61
|
else:
|
@@ -10,15 +10,16 @@ import click
|
|
10
10
|
from uipath._cli._evals._runtime import UiPathEvalContext, UiPathEvalRuntime
|
11
11
|
from uipath._cli._runtime._contracts import (
|
12
12
|
UiPathRuntimeContext,
|
13
|
-
UiPathRuntimeContextBuilder,
|
14
13
|
UiPathRuntimeFactory,
|
15
14
|
)
|
16
|
-
from uipath._cli._runtime._runtime import
|
15
|
+
from uipath._cli._runtime._runtime import UiPathScriptRuntime
|
17
16
|
from uipath._cli.middlewares import MiddlewareResult, Middlewares
|
17
|
+
from uipath.eval._helpers import auto_discover_entrypoint
|
18
18
|
|
19
19
|
from .._utils.constants import ENV_JOB_ID
|
20
20
|
from ..telemetry import track
|
21
21
|
from ._utils._console import ConsoleLogger
|
22
|
+
from ._utils._eval_set import EvalHelpers
|
22
23
|
|
23
24
|
console = ConsoleLogger()
|
24
25
|
|
@@ -39,42 +40,35 @@ def eval_agent_middleware(
|
|
39
40
|
no_report: bool = False,
|
40
41
|
**kwargs,
|
41
42
|
) -> MiddlewareResult:
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
**kwargs,
|
61
|
-
**base_context.model_dump(),
|
62
|
-
)
|
43
|
+
"""Middleware to run an evaluation set against the agent."""
|
44
|
+
timestamp = datetime.now(timezone.utc).strftime("%M-%H-%d-%m-%Y")
|
45
|
+
|
46
|
+
eval_context = UiPathEvalContext.with_defaults()
|
47
|
+
eval_context.no_report = no_report
|
48
|
+
eval_context.workers = workers
|
49
|
+
eval_context.eval_set = eval_set or EvalHelpers.auto_discover_eval_set()
|
50
|
+
eval_context.eval_ids = eval_ids
|
51
|
+
eval_context.execution_output_file = (
|
52
|
+
f"evals/results/{timestamp}.json" if not os.getenv("UIPATH_JOB_KEY") else None
|
53
|
+
)
|
54
|
+
|
55
|
+
runtime_entrypoint = entrypoint or auto_discover_entrypoint()
|
56
|
+
|
57
|
+
def generate_runtime_context(**context_kwargs) -> UiPathRuntimeContext:
|
58
|
+
runtime_context = UiPathRuntimeContext.with_defaults(**context_kwargs)
|
59
|
+
runtime_context.entrypoint = runtime_entrypoint
|
60
|
+
return runtime_context
|
63
61
|
|
64
62
|
try:
|
65
|
-
runtime_factory = UiPathRuntimeFactory(
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
.with_entrypoint(entrypoint)
|
70
|
-
.with_entrypoint(entrypoint)
|
71
|
-
.mark_eval_run()
|
72
|
-
.build()
|
63
|
+
runtime_factory = UiPathRuntimeFactory(
|
64
|
+
UiPathScriptRuntime,
|
65
|
+
UiPathRuntimeContext,
|
66
|
+
context_generator=generate_runtime_context,
|
73
67
|
)
|
74
68
|
|
75
69
|
async def execute():
|
76
70
|
async with UiPathEvalRuntime.from_eval_context(
|
77
|
-
factory=runtime_factory, context=
|
71
|
+
factory=runtime_factory, context=eval_context
|
78
72
|
) as eval_runtime:
|
79
73
|
await eval_runtime.execute()
|
80
74
|
|