uipath 2.1.117__py3-none-any.whl → 2.1.118__py3-none-any.whl

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.

Potentially problematic release.


This version of uipath might be problematic. Click here for more details.

@@ -121,7 +121,7 @@ class AuthService:
121
121
  return False
122
122
 
123
123
  def _perform_oauth_flow(self) -> TokenData:
124
- auth_config = OidcUtils.get_auth_config()
124
+ auth_config = OidcUtils.get_auth_config(self._domain)
125
125
  auth_url, code_verifier, state = OidcUtils.get_auth_url(
126
126
  self._domain, auth_config
127
127
  )
@@ -2,8 +2,12 @@ import base64
2
2
  import hashlib
3
3
  import json
4
4
  import os
5
- from urllib.parse import urlencode
5
+ from typing import Optional
6
+ from urllib.parse import urlencode, urlparse
6
7
 
8
+ import httpx
9
+
10
+ from ..._utils._ssl_context import get_httpx_client_kwargs
7
11
  from .._utils._console import ConsoleLogger
8
12
  from ._models import AuthConfig
9
13
  from ._url_utils import build_service_url
@@ -25,6 +29,84 @@ def get_state_param() -> str:
25
29
  return base64.urlsafe_b64encode(os.urandom(32)).decode("utf-8").rstrip("=")
26
30
 
27
31
 
32
+ def _get_version_from_api(domain: str) -> Optional[str]:
33
+ """Fetch the version from the UiPath orchestrator API.
34
+
35
+ Args:
36
+ domain: The UiPath domain (e.g., 'https://alpha.uipath.com')
37
+
38
+ Returns:
39
+ The version string (e.g., '25.10.0-beta.415') or None if unable to fetch
40
+ """
41
+ try:
42
+ version_url = build_service_url(domain, "/orchestrator_/api/status/version")
43
+ client_kwargs = get_httpx_client_kwargs()
44
+ # Override timeout for version check
45
+ client_kwargs["timeout"] = 5.0
46
+
47
+ with httpx.Client(**client_kwargs) as client:
48
+ response = client.get(version_url)
49
+ response.raise_for_status()
50
+ data = response.json()
51
+ return data.get("version")
52
+ except Exception:
53
+ # Silently fail and return None if we can't fetch the version
54
+ return None
55
+
56
+
57
+ def _is_cloud_domain(domain: str) -> bool:
58
+ """Check if the domain is a cloud domain (alpha, staging, or cloud.uipath.com).
59
+
60
+ Args:
61
+ domain: The domain string (e.g., 'https://alpha.uipath.com')
62
+
63
+ Returns:
64
+ True if it's a cloud domain, False otherwise
65
+ """
66
+ parsed = urlparse(domain)
67
+ netloc = parsed.netloc.lower()
68
+ return netloc in [
69
+ "alpha.uipath.com",
70
+ "staging.uipath.com",
71
+ "cloud.uipath.com",
72
+ ]
73
+
74
+
75
+ def _select_config_file(domain: str) -> str:
76
+ """Select the appropriate auth config file based on domain and version.
77
+
78
+ Logic:
79
+ 1. If domain is alpha/staging/cloud.uipath.com -> use auth_config_cloud.json
80
+ 2. Otherwise, try to get version from API
81
+ 3. If version starts with '25.10' -> use auth_config_25_10.json
82
+ 4. If version can't be determined -> fallback to auth_config_cloud.json
83
+ 5. Otherwise -> fallback to auth_config_cloud.json
84
+
85
+ Args:
86
+ domain: The UiPath domain
87
+
88
+ Returns:
89
+ The filename of the config to use
90
+ """
91
+ # Check if it's a known cloud domain
92
+ if _is_cloud_domain(domain):
93
+ return "auth_config_cloud.json"
94
+
95
+ # Try to get version from API
96
+ version = _get_version_from_api(domain)
97
+
98
+ # If we can't determine version, fallback to cloud config
99
+ if version is None:
100
+ return "auth_config_cloud.json"
101
+
102
+ # Check if version is 25.10.*
103
+ if version.startswith("25.10"):
104
+ return "auth_config_25_10.json"
105
+
106
+ # Default fallback to cloud config
107
+ return "auth_config_cloud.json"
108
+
109
+
28
110
  class OidcUtils:
29
111
  _console = ConsoleLogger()
30
112
 
@@ -43,10 +125,24 @@ class OidcUtils:
43
125
  return next((p for p in candidates if is_free(p)), None)
44
126
 
45
127
  @classmethod
46
- def get_auth_config(cls) -> AuthConfig:
47
- with open(
48
- os.path.join(os.path.dirname(__file__), "auth_config.json"), "r"
49
- ) as f:
128
+ def get_auth_config(cls, domain: Optional[str] = None) -> AuthConfig:
129
+ """Get the appropriate auth configuration based on domain.
130
+
131
+ Args:
132
+ domain: The UiPath domain (e.g., 'https://cloud.uipath.com').
133
+ If None, uses default auth_config_cloud.json
134
+
135
+ Returns:
136
+ AuthConfig with the appropriate configuration
137
+ """
138
+ # Select the appropriate config file based on domain
139
+ if domain:
140
+ config_file = _select_config_file(domain)
141
+ else:
142
+ config_file = "auth_config_cloud.json"
143
+
144
+ config_path = os.path.join(os.path.dirname(__file__), config_file)
145
+ with open(config_path, "r") as f:
50
146
  auth_config = json.load(f)
51
147
 
52
148
  custom_port = os.getenv("UIPATH_AUTH_PORT")
@@ -94,7 +94,7 @@ class PortalService:
94
94
 
95
95
  def refresh_access_token(self, refresh_token: str) -> TokenData: # type: ignore
96
96
  url = build_service_url(self.domain, "/identity_/connect/token")
97
- client_id = OidcUtils.get_auth_config().get("client_id")
97
+ client_id = OidcUtils.get_auth_config(self.domain).get("client_id")
98
98
 
99
99
  data = {
100
100
  "grant_type": "refresh_token",
@@ -15,13 +15,20 @@ def resolve_domain(
15
15
  Args:
16
16
  base_url: The base URL explicitly provided.
17
17
  environment: The environment name (e.g., 'alpha', 'staging', 'cloud').
18
- force: Whether to ignore UIPATH_URL from environment variables.
18
+ force: Whether to ignore UIPATH_URL from environment variables when base_url is set.
19
19
 
20
20
  Returns:
21
21
  A valid base URL for UiPath services.
22
22
  """
23
- if not force:
24
- # If UIPATH_URL is set, prefer its domain
23
+ # If base_url is a real URL, prefer it
24
+ if base_url and base_url.startswith("http"):
25
+ parsed = urlparse(base_url)
26
+ domain = f"{parsed.scheme}://{parsed.netloc}"
27
+ if domain:
28
+ return domain
29
+
30
+ # If base_url is not set (or force is False), check UIPATH_URL
31
+ if not base_url or not force:
25
32
  uipath_url = os.getenv("UIPATH_URL")
26
33
  if uipath_url and environment == "cloud":
27
34
  parsed = urlparse(uipath_url)
@@ -34,13 +41,6 @@ def resolve_domain(
34
41
  "Please ensure it includes scheme and netloc (e.g., 'https://cloud.uipath.com')."
35
42
  )
36
43
 
37
- # If base_url is a real URL, prefer it
38
- if base_url and base_url.startswith("http"):
39
- parsed = urlparse(base_url)
40
- domain = f"{parsed.scheme}://{parsed.netloc}"
41
- if domain:
42
- return domain
43
-
44
44
  # Otherwise, fall back to environment
45
45
  return f"https://{environment or 'cloud'}.uipath.com"
46
46
 
@@ -0,0 +1,6 @@
1
+ {
2
+ "client_id": "36dea5b8-e8bb-423d-8e7b-c808df8f1c00",
3
+ "redirect_uri": "http://localhost:__PY_REPLACE_PORT__/oidc/login",
4
+ "scope": "offline_access ProcessMining OrchestratorApiUserAccess StudioWebBackend IdentityServerApi ConnectionService DataService DocumentUnderstanding Du.Digitization.Api Du.Classification.Api Du.Extraction.Api Du.Validation.Api EnterpriseContextService Directory JamJamApi LLMGateway LLMOps OMS RCS.FolderAuthorization TM.Projects TM.TestCases TM.Requirements TM.TestSets",
5
+ "port": 8104
6
+ }
@@ -62,10 +62,10 @@ uv run uipath init --infer-bindings
62
62
  | Option | Type | Default | Description |
63
63
  |--------|------|---------|-------------|
64
64
  | `--resume` | flag | false | Resume execution from a previous state |
65
- | `-f`, `--file` | value | none | File path for the .json input |
66
- | `--input-file` | value | none | Alias for '-f/--file' arguments |
67
- | `--output-file` | value | none | File path where the output will be written |
68
- | `--trace-file` | value | none | File path where the trace spans will be written (JSON Lines format) |
65
+ | `-f`, `--file` | value | `Sentinel.UNSET` | File path for the .json input |
66
+ | `--input-file` | value | `Sentinel.UNSET` | Alias for '-f/--file' arguments |
67
+ | `--output-file` | value | `Sentinel.UNSET` | File path where the output will be written |
68
+ | `--trace-file` | value | `Sentinel.UNSET` | File path where the trace spans will be written (JSON Lines format) |
69
69
  | `--debug` | flag | false | Enable debugging with debugpy. The process will wait for a debugger to attach. |
70
70
  | `--debug-port` | value | `5678` | Port for the debug server (default: 5678) |
71
71
 
@@ -117,7 +117,7 @@ uv run uipath run --resume
117
117
  |--------|------|---------|-------------|
118
118
  | `--no-report` | flag | false | Do not report the evaluation results |
119
119
  | `--workers` | value | `1` | Number of parallel workers for running evaluations (default: 1) |
120
- | `--output-file` | value | none | File path where the output will be written |
120
+ | `--output-file` | value | `Sentinel.UNSET` | File path where the output will be written |
121
121
 
122
122
  **Usage Examples:**
123
123
 
@@ -278,13 +278,25 @@ class AgentContextOutputColumn(BaseModel):
278
278
  )
279
279
 
280
280
 
281
+ class AgentContextRetrievalMode(str, Enum):
282
+ """Enum for retrieval modes."""
283
+
284
+ SEMANTIC = "Semantic"
285
+ STRUCTURED = "Structured"
286
+ DEEP_RAG = "DeepRAG"
287
+ BATCH_TRANSFORM = "BatchTransform"
288
+
289
+
281
290
  class AgentContextSettings(BaseModel):
282
291
  """Settings for context."""
283
292
 
284
293
  result_count: int = Field(alias="resultCount")
285
- retrieval_mode: Literal["Semantic", "Structured", "DeepRAG", "BatchTransform"] = (
286
- Field(alias="retrievalMode")
287
- )
294
+ retrieval_mode: Literal[
295
+ AgentContextRetrievalMode.SEMANTIC,
296
+ AgentContextRetrievalMode.STRUCTURED,
297
+ AgentContextRetrievalMode.DEEP_RAG,
298
+ AgentContextRetrievalMode.BATCH_TRANSFORM,
299
+ ] = Field(alias="retrievalMode")
288
300
  threshold: float = Field(default=0)
289
301
  query: Optional[AgentContextQuerySetting] = Field(None)
290
302
  folder_path_prefix: Optional[Union[Dict[str, Any], AgentContextValueSetting]] = (
@@ -303,6 +315,20 @@ class AgentContextSettings(BaseModel):
303
315
  None, alias="outputColumns"
304
316
  )
305
317
 
318
+ @field_validator("retrieval_mode", mode="before")
319
+ @classmethod
320
+ def normalize_retrieval_mode(cls, v: Any) -> str:
321
+ """Normalize context retrieval mode."""
322
+ if isinstance(v, str):
323
+ lowercase_mapping = {
324
+ "semantic": AgentContextRetrievalMode.SEMANTIC,
325
+ "structured": AgentContextRetrievalMode.STRUCTURED,
326
+ "deeprag": AgentContextRetrievalMode.DEEP_RAG,
327
+ "batchtransform": AgentContextRetrievalMode.BATCH_TRANSFORM,
328
+ }
329
+ return lowercase_mapping.get(v.lower(), v)
330
+ return v
331
+
306
332
  model_config = ConfigDict(
307
333
  validate_by_name=True, validate_by_alias=True, extra="allow"
308
334
  )
@@ -553,7 +579,7 @@ class AgentGuardrailLogAction(BaseModel):
553
579
  """Log action model."""
554
580
 
555
581
  action_type: Literal["log"] = Field(alias="$actionType")
556
- message: str = Field(..., alias="message")
582
+ message: Optional[str] = Field(None, alias="message")
557
583
  severity_level: AgentGuardrailSeverityLevel = Field(alias="severityLevel")
558
584
 
559
585
  model_config = ConfigDict(populate_by_name=True, extra="allow")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath
3
- Version: 2.1.117
3
+ Version: 2.1.118
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
@@ -24,13 +24,14 @@ uipath/_cli/cli_run.py,sha256=9vbmSG_FzS0x8KNNzSrST37FKjUOzhXPjl8xTm2ZEqQ,4203
24
24
  uipath/_cli/middlewares.py,sha256=tb0c4sU1SCYi0PNs956Qmk24NDk0C0mBfVQmTcyORE0,5000
25
25
  uipath/_cli/spinner.py,sha256=bS-U_HA5yne11ejUERu7CQoXmWdabUD2bm62EfEdV8M,1107
26
26
  uipath/_cli/_auth/_auth_server.py,sha256=v_b8KNwn0tAv8jxpeKdllOVzl31q9AcdwpE_koAK_w4,7235
27
- uipath/_cli/_auth/_auth_service.py,sha256=gyOtaHnDmjYccW0R1HVmFgV69a7w53Dx1Mq-PM0uVag,5405
27
+ uipath/_cli/_auth/_auth_service.py,sha256=BoyMytg4tah1558bWzhS33hUacu17vh3Qr6nRBHD1RI,5417
28
28
  uipath/_cli/_auth/_models.py,sha256=kWhqd5FqBo_oi3DW2x1IaJHsEloXq0I24f-pX5zb_O4,753
29
- uipath/_cli/_auth/_oidc_utils.py,sha256=qGpognkz-Ks-8pt-QabSNTix5HE06lQpY3WZxptoJUE,3394
30
- uipath/_cli/_auth/_portal_service.py,sha256=nbJzMEg4MAhUGrXD90Jwd5b1SzxLiHri-ZgiHQwLzu8,8011
31
- uipath/_cli/_auth/_url_utils.py,sha256=MuMYesMQDgetLBzkwd19dPxw3fctys7EVpByDUQMyLE,2844
29
+ uipath/_cli/_auth/_oidc_utils.py,sha256=VEXnri7KinOdZMEPGYUf4mUZpCvSwmIL8TUBx6WhxDU,6446
30
+ uipath/_cli/_auth/_portal_service.py,sha256=fWnHGwd60Q_mrNEeENibqe5wv4ixp-yrG7X4XrXsXNk,8022
31
+ uipath/_cli/_auth/_url_utils.py,sha256=-OD7Gz7pYgJU8CahFZdeX0Na1IB2EIX3u964VmZ1K8Q,2898
32
32
  uipath/_cli/_auth/_utils.py,sha256=To4Ara_UF4g7nzUfKqFA11lTjhQWIZWNm4xwa5nNKmU,896
33
- uipath/_cli/_auth/auth_config.json,sha256=o8J5BBFwiEtjZLHpJ_64lvnTeYeRIHaJ-Bhg0QvcUX8,521
33
+ uipath/_cli/_auth/auth_config_25_10.json,sha256=o8J5BBFwiEtjZLHpJ_64lvnTeYeRIHaJ-Bhg0QvcUX8,521
34
+ uipath/_cli/_auth/auth_config_cloud.json,sha256=o8J5BBFwiEtjZLHpJ_64lvnTeYeRIHaJ-Bhg0QvcUX8,521
34
35
  uipath/_cli/_auth/index.html,sha256=uGK0CDTP8Rys_p4O_Pbd2x4tz0frKNVcumjrXnal5Nc,22814
35
36
  uipath/_cli/_auth/localhost.crt,sha256=oGl9oLLOiouHubAt39B4zEfylFvKEtbtr_43SIliXJc,1226
36
37
  uipath/_cli/_auth/localhost.key,sha256=X31VYXD8scZtmGA837dGX5l6G-LXHLo5ItWJhZXaz3c,1679
@@ -106,7 +107,7 @@ uipath/_events/_event_bus.py,sha256=4-VzstyX69cr7wT1EY7ywp-Ndyz2CyemD3Wk_-QmRpo,
106
107
  uipath/_events/_events.py,sha256=S-3zQiJM6y0pKysXhxQQciNaGcnqJqRw5PrRGgFEKn4,4565
107
108
  uipath/_resources/AGENTS.md,sha256=nRQNAVeEBaBvuMzXw8uXtMnGebLClUgwIMlgb8_qU9o,1039
108
109
  uipath/_resources/CLAUDE.md,sha256=kYsckFWTVe948z_fNWLysCHvi9_YpchBXl3s1Ek03lU,10
109
- uipath/_resources/CLI_REFERENCE.md,sha256=M_SCtSjRhj1XwfgSFLfHJJahYXEd_CSQ_EnjLQAn-2Y,6470
110
+ uipath/_resources/CLI_REFERENCE.md,sha256=v6pVR2jbBP7hTXwAwi3Ia5C96BfDKs4xGCCUOmsbEBM,6530
110
111
  uipath/_resources/REQUIRED_STRUCTURE.md,sha256=3laqGiNa3kauJ7jRI1d7w_fWKUDkqYBjcTT_6_8FAGk,1417
111
112
  uipath/_resources/SDK_REFERENCE.md,sha256=xx6-FzXQpva0eeCeLgscrzaaWrVyFedxxACAD7xVlu4,18663
112
113
  uipath/_services/__init__.py,sha256=_LNy4u--VlhVtTO66bULbCoBjyJBTuyh9jnzjWrv-h4,1140
@@ -150,7 +151,7 @@ uipath/agent/conversation/exchange.py,sha256=nuk1tEMBHc_skrraT17d8U6AtyJ3h07ExGQ
150
151
  uipath/agent/conversation/message.py,sha256=1ZkEs146s79TrOAWCQwzBAEJvjAu4lQBpJ64tKXDgGE,2142
151
152
  uipath/agent/conversation/meta.py,sha256=3t0eS9UHoAPHre97QTUeVbjDhnMX4zj4-qG6ju0B8wY,315
152
153
  uipath/agent/conversation/tool.py,sha256=ol8XI8AVd-QNn5auXNBPcCzOkh9PPFtL7hTK3kqInkU,2191
153
- uipath/agent/models/agent.py,sha256=kAdNWpyzggIYB4ye7vs-hPrHGxYPgTp48DcmQXw-Bcw,22630
154
+ uipath/agent/models/agent.py,sha256=F2KBPORufrqplb6cfBck8YI8GO3miNLD2ebpDqV0xEE,23562
154
155
  uipath/agent/models/evals.py,sha256=QMIqwCuwabD_vYF0KgJpip5BV0pFLf9ZKUd9AL5eU2w,1843
155
156
  uipath/agent/react/__init__.py,sha256=0Ci-uf0gSOReoHQyx3QImY-om3q_SgLT-bJUSlzS3B8,527
156
157
  uipath/agent/react/prompts.py,sha256=0a06TJz2XqZuLK-yC_bvZV9ULXpY6UGtybjjbyVzXII,3375
@@ -224,8 +225,8 @@ uipath/tracing/_utils.py,sha256=zMjiKjNpSN3YQNEU4-u5AAvPtUsi8QuEqNLya89jfAU,1446
224
225
  uipath/utils/__init__.py,sha256=VD-KXFpF_oWexFg6zyiWMkxl2HM4hYJMIUDZ1UEtGx0,105
225
226
  uipath/utils/_endpoints_manager.py,sha256=tnF_FiCx8qI2XaJDQgYkMN_gl9V0VqNR1uX7iawuLp8,8230
226
227
  uipath/utils/dynamic_schema.py,sha256=w0u_54MoeIAB-mf3GmwX1A_X8_HDrRy6p998PvX9evY,3839
227
- uipath-2.1.117.dist-info/METADATA,sha256=i69OX4o8c_XeqRQzg8dZjLkI03RpWgb5VfoGT-hQMrQ,6626
228
- uipath-2.1.117.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
229
- uipath-2.1.117.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
230
- uipath-2.1.117.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
231
- uipath-2.1.117.dist-info/RECORD,,
228
+ uipath-2.1.118.dist-info/METADATA,sha256=dv4-HMQmB6yeHLxSH2P1OVvvKg2sg7LnTmSTMWN8gpA,6626
229
+ uipath-2.1.118.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
230
+ uipath-2.1.118.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
231
+ uipath-2.1.118.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
232
+ uipath-2.1.118.dist-info/RECORD,,