Skip to content
Merged
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.5"
version = "2.12.6"
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.7, <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
41 changes: 29 additions & 12 deletions packages/uipath/src/uipath/_cli/_evals/_telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,23 @@ 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
self._current_agent_type: str | None = None
Comment thread
viswa-uipath marked this conversation as resolved.

@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.
def _resolve_agent_type(agent_type: str | None, entrypoint: str | None) -> str:
"""Emit the historical ``"LowCode"`` / ``"Coded"`` wire values.

Application Insights dashboards filter on those two exact strings.
When the factory supplies a modern label (e.g. ``"uipath_lowcode"``,
``"uipath_coded"``) we normalize; when it supplies nothing we fall
back to the pre-refactor entrypoint check (``agent.json`` ⇒
low-code) so no in-flight consumer breaks.
"""
if agent_type is not None:
if "lowcode" in agent_type.lower() or "low_code" in agent_type.lower():
return "LowCode"
return "Coded"
# Fallback: pre-refactor entrypoint-based derivation.
if entrypoint == "agent.json":
return "LowCode"
return "Coded"
Expand Down Expand Up @@ -105,21 +111,25 @@ 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": self._resolve_agent_type(
event.agent_type, event.entrypoint
),
"Runtime": "URT",
}

Expand Down Expand Up @@ -156,7 +166,9 @@ 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._resolve_agent_type(
self._current_agent_type, self._current_entrypoint
)

self._enrich_properties(properties)

Expand Down Expand Up @@ -207,7 +219,9 @@ 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._resolve_agent_type(
self._current_agent_type, self._current_entrypoint
)

if trace_id:
properties["TraceId"] = trace_id
Expand Down Expand Up @@ -271,7 +285,9 @@ 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"] = self._resolve_agent_type(
set_info.get("agent_type"), set_info["entrypoint"]
)

properties["Runtime"] = "URT"

Expand Down Expand Up @@ -299,6 +315,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