Skip to content

Commit fd18c4c

Browse files
committed
wip: uipath-platform
1 parent ee4dd71 commit fd18c4c

132 files changed

Lines changed: 96 additions & 43465 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

pyproject.toml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
[project]
22
name = "uipath"
3-
version = "2.8.44"
3+
version = "2.9.0"
44
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"
77
dependencies = [
8-
"uipath-core>=0.5.0, <0.6.0",
98
"uipath-runtime>=0.9.0, <0.10.0",
109
"click>=8.3.1",
1110
"httpx>=0.28.1",
@@ -23,6 +22,7 @@ dependencies = [
2322
"mermaid-builder==0.0.3",
2423
"graphtty==0.1.8",
2524
"applicationinsights>=0.11.10",
25+
"uipath-platform==0.0.1.dev1000020013",
2626
]
2727
classifiers = [
2828
"Intended Audience :: Developers",
@@ -148,3 +148,12 @@ name = "testpypi"
148148
url = "https://test.pypi.org/simple/"
149149
publish-url = "https://test.pypi.org/legacy/"
150150
explicit = true
151+
152+
[tool.uv.sources]
153+
uipath-platform = { index = "testpypi" }
154+
uipath-core = { index = "testpypi" }
155+
156+
[tool.uv]
157+
override-dependencies = [
158+
"uipath-core==0.5.1.dev1000450221"
159+
]

src/uipath/_cli/_auth/_portal_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import click
44
import httpx
5+
from uipath.platform.common import TokenData
56
from uipath.runtime.errors import (
67
UiPathErrorCategory,
78
UiPathErrorCode,
@@ -10,7 +11,6 @@
1011

1112
from ..._utils._auth import update_env_file
1213
from ..._utils._ssl_context import get_httpx_client_kwargs
13-
from ...platform.common import TokenData
1414
from .._utils._console import ConsoleLogger
1515
from ._models import OrganizationInfo, TenantInfo, TenantsAndOrganizationInfoResponse
1616
from ._oidc_utils import OidcUtils

src/uipath/_cli/_auth/_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
import os
33
from pathlib import Path
44

5+
from uipath.platform.common import TokenData
6+
57
from ..._utils._auth import parse_access_token
6-
from ...platform.common import TokenData
78
from ._models import AccessTokenData
89

910

src/uipath/_cli/_debug/_bridge.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from pydantic import BaseModel
1111
from rich.console import Console
1212
from rich.tree import Tree
13+
from uipath.core.serialization import serialize_object
1314
from uipath.runtime import (
1415
UiPathBreakpointResult,
1516
UiPathRuntimeContext,
@@ -20,8 +21,6 @@
2021
from uipath.runtime.events import UiPathRuntimeStateEvent, UiPathRuntimeStatePhase
2122
from uipath.runtime.resumable import UiPathResumeTriggerType
2223

23-
from uipath._cli._utils._common import serialize_object
24-
2524
logger = logging.getLogger(__name__)
2625

2726

src/uipath/_cli/_evals/mocks/input_mocker.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
from datetime import datetime
55
from typing import Any
66

7+
from uipath.platform import UiPath
8+
79
from uipath._cli._evals.mocks.types import (
810
InputMockingStrategy,
911
)
10-
from uipath.platform import UiPath
1112
from uipath.tracing import traced
1213

1314
from .mocker import UiPathInputMockingError
@@ -65,11 +66,16 @@ async def generate_llm_input(
6566
from .mocks import cache_manager_context
6667

6768
try:
68-
llm = UiPath(
69+
from uipath.platform.chat import UiPathLlmChatService
70+
71+
uipath = UiPath()
72+
llm = UiPathLlmChatService(
73+
uipath._config,
74+
uipath._execution_context,
6975
requesting_product="agentsplayground",
7076
requesting_feature="agents-evaluations",
7177
agenthub_config="agentsevals",
72-
).llm
78+
)
7379
cache_manager = cache_manager_context.get()
7480

7581
# Ensure additionalProperties is set for strict mode compatibility

src/uipath/_cli/_evals/mocks/llm_mocker.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
from typing import Any, Callable
66

77
from pydantic import BaseModel, TypeAdapter
8+
from uipath.core.tracing import _SpanUtils, traced
89

910
from uipath._cli._evals.mocks.types import (
1011
LLMMockingStrategy,
1112
MockingContext,
1213
)
13-
from uipath.tracing import traced
14-
from uipath.tracing._utils import _SpanUtils
1514

1615
from .._models._mocks import ExampleCall
1716
from .mocker import (
@@ -92,6 +91,7 @@ async def response(
9291
function_name = params.get("name") or func.__name__
9392
if function_name in [x.name for x in self.context.strategy.tools_to_simulate]:
9493
from uipath.platform import UiPath
94+
from uipath.platform.chat import UiPathLlmChatService
9595
from uipath.platform.chat._llm_gateway_service import _cleanup_schema
9696

9797
from .mocks import (
@@ -101,11 +101,14 @@ async def response(
101101
span_collector_context,
102102
)
103103

104-
llm = UiPath(
104+
uipath = UiPath()
105+
llm = UiPathLlmChatService(
106+
uipath._config,
107+
uipath._execution_context,
105108
requesting_product="agentsplayground",
106109
requesting_feature="agents-evaluations",
107110
agenthub_config="agentsevals",
108-
).llm
111+
)
109112
return_type: Any = func.__annotations__.get("return", None)
110113
if return_type is None:
111114
return_type = Any

src/uipath/_cli/_utils/_common.py

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import json
22
import logging
33
import os
4-
import uuid
5-
from datetime import date, datetime, time
4+
from datetime import datetime
65
from pathlib import Path
76
from typing import Literal
87
from urllib.parse import urlparse
98

109
import click
11-
1210
from uipath.platform.common import UiPathConfig
1311

1412
from ..._utils._bindings import ResourceOverwrite, ResourceOverwriteParser
@@ -73,43 +71,6 @@ def get_env_vars(spinner: Spinner | None = None) -> list[str]:
7371
return [base_url, token]
7472

7573

76-
def serialize_object(obj):
77-
"""Recursively serializes an object and all its nested components."""
78-
# Handle Pydantic models
79-
if hasattr(obj, "model_dump"):
80-
return serialize_object(obj.model_dump(by_alias=True))
81-
elif hasattr(obj, "dict"):
82-
return serialize_object(obj.dict())
83-
elif hasattr(obj, "to_dict"):
84-
return serialize_object(obj.to_dict())
85-
# Special handling for UiPathBaseRuntimeErrors
86-
elif hasattr(obj, "as_dict"):
87-
return serialize_object(obj.as_dict)
88-
elif isinstance(obj, (datetime, date, time)):
89-
return obj.isoformat()
90-
# Handle dictionaries
91-
elif isinstance(obj, dict):
92-
return {k: serialize_object(v) for k, v in obj.items()}
93-
# Handle lists
94-
elif isinstance(obj, list):
95-
return [serialize_object(item) for item in obj]
96-
# Handle exceptions
97-
elif isinstance(obj, Exception):
98-
return str(obj)
99-
# Handle other iterable objects (convert to dict first)
100-
elif hasattr(obj, "__iter__") and not isinstance(obj, (str, bytes)):
101-
try:
102-
return serialize_object(dict(obj))
103-
except (TypeError, ValueError):
104-
return obj
105-
# UUIDs must be serialized explicitly
106-
elif isinstance(obj, uuid.UUID):
107-
return str(obj)
108-
# Return primitive types as is
109-
else:
110-
return obj
111-
112-
11374
def get_org_scoped_url(base_url: str) -> str:
11475
"""Get organization scoped URL from base URL.
11576
@@ -154,7 +115,6 @@ async def ensure_coded_agent_project(studio_client: StudioClient):
154115
async def may_override_files(
155116
studio_client: StudioClient, scope: Literal["remote", "local"]
156117
) -> bool:
157-
from datetime import datetime
158118

159119
from packaging import version
160120

src/uipath/_cli/cli_debug.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import click
88
from uipath.core.tracing import UiPathTraceManager
9+
from uipath.platform.common import UiPathConfig
910
from uipath.runtime import (
1011
UiPathExecuteOptions,
1112
UiPathRuntimeContext,
@@ -32,7 +33,6 @@
3233
from uipath._cli._utils._debug import setup_debugging
3334
from uipath._cli._utils._studio_project import StudioClient
3435
from uipath._utils._bindings import ResourceOverwritesContext
35-
from uipath.platform.common import UiPathConfig
3636
from uipath.tracing import LiveTrackingSpanProcessor, LlmOpsHttpExporter
3737

3838
from ._utils._console import ConsoleLogger

src/uipath/eval/evaluators/legacy_context_precision_evaluator.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,16 @@ def model_post_init(self, __context: Any):
109109
def _initialize_llm(self):
110110
"""Initialize the LLM used for evaluation."""
111111
from uipath.platform import UiPath
112+
from uipath.platform.chat import UiPathLlmChatService
112113

113-
uipath = UiPath(
114+
uipath = UiPath()
115+
self.llm = UiPathLlmChatService(
116+
uipath._config,
117+
uipath._execution_context,
114118
requesting_product="agentsplayground",
115119
requesting_feature="agents-evaluations",
116120
agenthub_config="agentsevals",
117121
)
118-
self.llm = uipath.llm
119122

120123
@track_evaluation_metrics
121124
async def evaluate(

src/uipath/eval/evaluators/legacy_faithfulness_evaluator.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
import json
44
from typing import Any, Optional
55

6-
from uipath.eval.models import NumericEvaluationResult
76
from uipath.platform.chat import UiPathLlmChatService
87

8+
from uipath.eval.models import NumericEvaluationResult
9+
910
from ..models.models import AgentExecution, EvaluationResult
1011
from .base_legacy_evaluator import (
1112
BaseLegacyEvaluator,
@@ -47,13 +48,16 @@ def model_post_init(self, __context: Any):
4748
def _initialize_llm(self):
4849
"""Initialize the LLM used for evaluation."""
4950
from uipath.platform import UiPath
51+
from uipath.platform.chat import UiPathLlmChatService
5052

51-
uipath = UiPath(
53+
uipath = UiPath()
54+
self.llm = UiPathLlmChatService(
55+
uipath._config,
56+
uipath._execution_context,
5257
requesting_product="agentsplayground",
5358
requesting_feature="agents-evaluations",
5459
agenthub_config="agentsevals",
5560
)
56-
self.llm = uipath.llm
5761

5862
@track_evaluation_metrics
5963
async def evaluate(

0 commit comments

Comments
 (0)