Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/uipath/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[project]
name = "uipath"
version = "2.12.4"
version = "2.12.5"
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
dependencies = [
"uipath-core>=0.5.26, <0.6.0",
"uipath-runtime>=0.11.5, <0.12.0",
"uipath-runtime>=0.11.6, <0.12.0",
"uipath-platform>=0.1.89, <0.2.0",
"click>=8.3.1",
"httpx>=0.28.1",
Expand All @@ -24,6 +24,7 @@ dependencies = [
"mermaid-builder==0.0.3",
"graphtty==0.1.8",
"applicationinsights>=0.11.10",
"pyyaml>=6.0, <7.0",
]
classifiers = [
"Intended Audience :: Developers",
Expand Down Expand Up @@ -75,6 +76,7 @@ dev = [
"mkdocs-llmstxt>=0.5.0",
"inflection>=0.5.1",
"types-toml>=0.10.8",
"types-PyYAML>=6.0",
"pytest-timeout>=2.4.0",
]

Expand Down
26 changes: 8 additions & 18 deletions packages/uipath/src/uipath/_cli/_evals/_telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,7 @@ def __init__(self) -> None:
self._eval_run_info: dict[str, dict[str, Any]] = {}
self._current_eval_set_run_id: str | None = None
self._current_entrypoint: str | None = None

@staticmethod
def _get_agent_type(entrypoint: str) -> str:
"""Determine agent type from entrypoint.
Args:
entrypoint: The entrypoint path.
Returns:
"LowCode" if entrypoint is "agent.json", "Coded" otherwise.
"""
if entrypoint == "agent.json":
return "LowCode"
return "Coded"
self._current_agent_type: str | None = None

async def subscribe_to_eval_runtime_events(self, event_bus: EventBus) -> None:
"""Subscribe to evaluation runtime events.
Expand Down Expand Up @@ -105,21 +92,23 @@ async def _on_eval_set_run_created(self, event: EvalSetRunCreatedEvent) -> None:
"eval_set_id": event.eval_set_id,
"eval_set_run_id": eval_set_run_id,
"entrypoint": event.entrypoint,
"agent_type": event.agent_type,
"no_of_evals": event.no_of_evals,
"evaluator_count": len(event.evaluators),
}

# Store for child events
self._current_eval_set_run_id = eval_set_run_id
self._current_entrypoint = event.entrypoint
self._current_agent_type = event.agent_type

properties: dict[str, Any] = {
"EvalSetId": event.eval_set_id,
"EvalSetRunId": eval_set_run_id,
"Entrypoint": event.entrypoint,
"EvalCount": event.no_of_evals,
"EvaluatorCount": len(event.evaluators),
"AgentType": self._get_agent_type(event.entrypoint),
"AgentType": event.agent_type or "unknown",
"Runtime": "URT",
}

Expand Down Expand Up @@ -156,7 +145,7 @@ async def _on_eval_run_created(self, event: EvalRunCreatedEvent) -> None:
# Add entrypoint and agent type
if self._current_entrypoint:
properties["Entrypoint"] = self._current_entrypoint
properties["AgentType"] = self._get_agent_type(self._current_entrypoint)
properties["AgentType"] = self._current_agent_type or "unknown"

self._enrich_properties(properties)

Expand Down Expand Up @@ -207,7 +196,7 @@ async def _on_eval_run_updated(self, event: EvalRunUpdatedEvent) -> None:

if self._current_entrypoint:
properties["Entrypoint"] = self._current_entrypoint
properties["AgentType"] = self._get_agent_type(self._current_entrypoint)
properties["AgentType"] = self._current_agent_type or "unknown"

if trace_id:
properties["TraceId"] = trace_id
Expand Down Expand Up @@ -271,7 +260,7 @@ async def _on_eval_set_run_updated(self, event: EvalSetRunUpdatedEvent) -> None:

if set_info.get("entrypoint"):
properties["Entrypoint"] = set_info["entrypoint"]
properties["AgentType"] = self._get_agent_type(set_info["entrypoint"])
properties["AgentType"] = set_info.get("agent_type") or "unknown"

properties["Runtime"] = "URT"

Expand Down Expand Up @@ -299,6 +288,7 @@ async def _on_eval_set_run_updated(self, event: EvalSetRunUpdatedEvent) -> None:

self._current_eval_set_run_id = None
self._current_entrypoint = None
self._current_agent_type = None

except Exception as e:
logger.debug(f"Error tracking eval set run updated: {e}")
Expand Down
16 changes: 16 additions & 0 deletions packages/uipath/src/uipath/_cli/_governance/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""CLI-side governance helpers.
Host-only glue that turns provider responses into inputs the runtime
consumes. Owns the YAML → :class:`PolicyIndex` compiler (the runtime
layer stays format-agnostic and only accepts a compiled index).
Public helpers:
- :func:`build_policy_index_from_yaml` — parse a YAML policy pack (as
returned by :meth:`GovernancePolicyProvider.get_policy_async`) into
a :class:`uipath.runtime.governance.native.PolicyIndex`.
"""

from .yaml_index import build_policy_index_from_yaml

__all__ = ["build_policy_index_from_yaml"]
Loading
Loading