uipath 2.1.106__py3-none-any.whl → 2.1.108__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.
- uipath/_cli/_runtime/_contracts.py +25 -5
- uipath/_resources/SDK_REFERENCE.md +1 -98
- uipath/_services/guardrails_service.py +76 -0
- uipath/_services/llm_gateway_service.py +15 -2
- uipath/_uipath.py +10 -37
- uipath/agent/models/agent.py +147 -2
- uipath/models/guardrails.py +2 -225
- uipath/tracing/_utils.py +18 -4
- {uipath-2.1.106.dist-info → uipath-2.1.108.dist-info}/METADATA +1 -1
- {uipath-2.1.106.dist-info → uipath-2.1.108.dist-info}/RECORD +13 -12
- {uipath-2.1.106.dist-info → uipath-2.1.108.dist-info}/WHEEL +0 -0
- {uipath-2.1.106.dist-info → uipath-2.1.108.dist-info}/entry_points.txt +0 -0
- {uipath-2.1.106.dist-info → uipath-2.1.108.dist-info}/licenses/LICENSE +0 -0
|
@@ -460,12 +460,12 @@ class UiPathRuntimeContext(BaseModel):
|
|
|
460
460
|
return instance
|
|
461
461
|
|
|
462
462
|
|
|
463
|
-
class
|
|
463
|
+
class UiPathBaseRuntimeError(Exception):
|
|
464
464
|
"""Base exception class for UiPath runtime errors with structured error information."""
|
|
465
465
|
|
|
466
466
|
def __init__(
|
|
467
467
|
self,
|
|
468
|
-
code:
|
|
468
|
+
code: str,
|
|
469
469
|
title: str,
|
|
470
470
|
detail: str,
|
|
471
471
|
category: UiPathErrorCategory = UiPathErrorCategory.UNKNOWN,
|
|
@@ -484,10 +484,8 @@ class UiPathRuntimeError(Exception):
|
|
|
484
484
|
if status is None:
|
|
485
485
|
status = self._extract_http_status()
|
|
486
486
|
|
|
487
|
-
code_value = code.value
|
|
488
|
-
|
|
489
487
|
self.error_info = UiPathErrorContract(
|
|
490
|
-
code=f"{prefix}.{
|
|
488
|
+
code=f"{prefix}.{code}",
|
|
491
489
|
title=title,
|
|
492
490
|
detail=detail,
|
|
493
491
|
category=category,
|
|
@@ -529,6 +527,28 @@ class UiPathRuntimeError(Exception):
|
|
|
529
527
|
return self.error_info.model_dump()
|
|
530
528
|
|
|
531
529
|
|
|
530
|
+
class UiPathRuntimeError(UiPathBaseRuntimeError):
|
|
531
|
+
"""Exception class for UiPath runtime errors."""
|
|
532
|
+
|
|
533
|
+
def __init__(
|
|
534
|
+
self,
|
|
535
|
+
code: UiPathErrorCode,
|
|
536
|
+
title: str,
|
|
537
|
+
detail: str,
|
|
538
|
+
category: UiPathErrorCategory = UiPathErrorCategory.UNKNOWN,
|
|
539
|
+
prefix: str = "Python",
|
|
540
|
+
include_traceback: bool = True,
|
|
541
|
+
):
|
|
542
|
+
super().__init__(
|
|
543
|
+
code=code.value,
|
|
544
|
+
title=title,
|
|
545
|
+
detail=detail,
|
|
546
|
+
category=category,
|
|
547
|
+
prefix=prefix,
|
|
548
|
+
include_traceback=include_traceback,
|
|
549
|
+
)
|
|
550
|
+
|
|
551
|
+
|
|
532
552
|
class UiPathRuntimeStreamNotSupportedError(NotImplementedError):
|
|
533
553
|
"""Raised when a runtime does not support streaming."""
|
|
534
554
|
|
|
@@ -70,93 +70,6 @@ sdk.assets.update_async(robot_asset: uipath.models.assets.UserAsset, folder_key:
|
|
|
70
70
|
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
### Attachments
|
|
74
|
-
|
|
75
|
-
Attachments service
|
|
76
|
-
|
|
77
|
-
```python
|
|
78
|
-
# Delete an attachment.
|
|
79
|
-
sdk.attachments.delete(key: uuid.UUID, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> None
|
|
80
|
-
|
|
81
|
-
# Delete an attachment asynchronously.
|
|
82
|
-
sdk.attachments.delete_async(key: uuid.UUID, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> None
|
|
83
|
-
|
|
84
|
-
# Download an attachment.
|
|
85
|
-
sdk.attachments.download(key: uuid.UUID, destination_path: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> str
|
|
86
|
-
|
|
87
|
-
# Download an attachment asynchronously.
|
|
88
|
-
sdk.attachments.download_async(key: uuid.UUID, destination_path: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> str
|
|
89
|
-
|
|
90
|
-
# Upload a file or content to UiPath as an attachment.
|
|
91
|
-
sdk.attachments.upload(name: str, content: Union[str, bytes, NoneType]=None, source_path: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> uuid.UUID
|
|
92
|
-
|
|
93
|
-
# Upload a file or content to UiPath as an attachment asynchronously.
|
|
94
|
-
sdk.attachments.upload_async(name: str, content: Union[str, bytes, NoneType]=None, source_path: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> uuid.UUID
|
|
95
|
-
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### Buckets
|
|
99
|
-
|
|
100
|
-
Buckets service
|
|
101
|
-
|
|
102
|
-
```python
|
|
103
|
-
# Download a file from a bucket.
|
|
104
|
-
sdk.buckets.download(name: Optional[str]=None, key: Optional[str]=None, blob_file_path: str, destination_path: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> None
|
|
105
|
-
|
|
106
|
-
# Download a file from a bucket asynchronously.
|
|
107
|
-
sdk.buckets.download_async(name: Optional[str]=None, key: Optional[str]=None, blob_file_path: str, destination_path: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> None
|
|
108
|
-
|
|
109
|
-
# Retrieve bucket information by its name.
|
|
110
|
-
sdk.buckets.retrieve(name: Optional[str]=None, key: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> uipath.models.buckets.Bucket
|
|
111
|
-
|
|
112
|
-
# Asynchronously retrieve bucket information by its name.
|
|
113
|
-
sdk.buckets.retrieve_async(name: Optional[str]=None, key: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> uipath.models.buckets.Bucket
|
|
114
|
-
|
|
115
|
-
# Upload a file to a bucket.
|
|
116
|
-
sdk.buckets.upload(key: Optional[str]=None, name: Optional[str]=None, blob_file_path: str, content_type: Optional[str]=None, source_path: Optional[str]=None, content: Union[str, bytes, NoneType]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> None
|
|
117
|
-
|
|
118
|
-
# Upload a file to a bucket asynchronously.
|
|
119
|
-
sdk.buckets.upload_async(key: Optional[str]=None, name: Optional[str]=None, blob_file_path: str, content_type: Optional[str]=None, source_path: Optional[str]=None, content: Union[str, bytes, NoneType]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> None
|
|
120
|
-
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### Connections
|
|
124
|
-
|
|
125
|
-
Connections service
|
|
126
|
-
|
|
127
|
-
```python
|
|
128
|
-
# Lists all connections with optional filtering.
|
|
129
|
-
sdk.connections.list(name: Optional[str]=None, folder_path: Optional[str]=None, folder_key: Optional[str]=None, connector_key: Optional[str]=None, skip: Optional[int]=None, top: Optional[int]=None) -> typing.List[uipath.models.connections.Connection]
|
|
130
|
-
|
|
131
|
-
# Asynchronously lists all connections with optional filtering.
|
|
132
|
-
sdk.connections.list_async(name: Optional[str]=None, folder_path: Optional[str]=None, folder_key: Optional[str]=None, connector_key: Optional[str]=None, skip: Optional[int]=None, top: Optional[int]=None) -> typing.List[uipath.models.connections.Connection]
|
|
133
|
-
|
|
134
|
-
# Synchronously retrieve connection API metadata.
|
|
135
|
-
sdk.connections.metadata(element_instance_id: int, tool_path: str, schema_mode: bool=True) -> uipath.models.connections.ConnectionMetadata
|
|
136
|
-
|
|
137
|
-
# Asynchronously retrieve connection API metadata.
|
|
138
|
-
sdk.connections.metadata_async(element_instance_id: int, tool_path: str, schema_mode: bool=True) -> uipath.models.connections.ConnectionMetadata
|
|
139
|
-
|
|
140
|
-
# Retrieve connection details by its key.
|
|
141
|
-
sdk.connections.retrieve(key: str) -> uipath.models.connections.Connection
|
|
142
|
-
|
|
143
|
-
# Asynchronously retrieve connection details by its key.
|
|
144
|
-
sdk.connections.retrieve_async(key: str) -> uipath.models.connections.Connection
|
|
145
|
-
|
|
146
|
-
# Retrieve event payload from UiPath Integration Service.
|
|
147
|
-
sdk.connections.retrieve_event_payload(event_args: uipath.models.connections.EventArguments) -> typing.Dict[str, typing.Any]
|
|
148
|
-
|
|
149
|
-
# Retrieve event payload from UiPath Integration Service.
|
|
150
|
-
sdk.connections.retrieve_event_payload_async(event_args: uipath.models.connections.EventArguments) -> typing.Dict[str, typing.Any]
|
|
151
|
-
|
|
152
|
-
# Retrieve an authentication token for a connection.
|
|
153
|
-
sdk.connections.retrieve_token(key: str, token_type: <enum 'ConnectionTokenType="direct") -> uipath.models.connections.ConnectionToken
|
|
154
|
-
|
|
155
|
-
# Asynchronously retrieve an authentication token for a connection.
|
|
156
|
-
sdk.connections.retrieve_token_async(key: str, token_type: <enum 'ConnectionTokenType="direct") -> uipath.models.connections.ConnectionToken
|
|
157
|
-
|
|
158
|
-
```
|
|
159
|
-
|
|
160
73
|
### Context Grounding
|
|
161
74
|
|
|
162
75
|
Context Grounding service
|
|
@@ -274,16 +187,6 @@ sdk.entities.update_records_async(entity_key: str, records: List[Any], schema: O
|
|
|
274
187
|
|
|
275
188
|
```
|
|
276
189
|
|
|
277
|
-
### Folders
|
|
278
|
-
|
|
279
|
-
Folders service
|
|
280
|
-
|
|
281
|
-
```python
|
|
282
|
-
# Retrieve the folder key by folder path with pagination support.
|
|
283
|
-
sdk.folders.retrieve_key(folder_path: str) -> typing.Optional[str]
|
|
284
|
-
|
|
285
|
-
```
|
|
286
|
-
|
|
287
190
|
### Jobs
|
|
288
191
|
|
|
289
192
|
Jobs service
|
|
@@ -339,7 +242,7 @@ Llm service
|
|
|
339
242
|
|
|
340
243
|
```python
|
|
341
244
|
# Generate chat completions using UiPath's normalized LLM Gateway API.
|
|
342
|
-
sdk.llm.chat_completions(messages: List[Dict[str, str]], model: str="gpt-4o-mini-2024-07-18", max_tokens: int=4096, temperature: float=0, n: int=1, frequency_penalty: float=0, presence_penalty: float=0, top_p: Optional[float]=1, top_k: Optional[int]=None, tools: Optional[List[uipath.models.llm_gateway.ToolDefinition]]=None, tool_choice: Union[uipath.models.llm_gateway.AutoToolChoice, uipath.models.llm_gateway.RequiredToolChoice, uipath.models.llm_gateway.SpecificToolChoice, Literal['auto', 'none'], NoneType]=None, response_format: Union[Dict[str, Any], type[pydantic.main.BaseModel], NoneType]=None, api_version: str="2024-08-01-preview")
|
|
245
|
+
sdk.llm.chat_completions(messages: Union[List[Dict[str, str]], List[tuple[str, str]]], model: str="gpt-4o-mini-2024-07-18", max_tokens: int=4096, temperature: float=0, n: int=1, frequency_penalty: float=0, presence_penalty: float=0, top_p: Optional[float]=1, top_k: Optional[int]=None, tools: Optional[List[uipath.models.llm_gateway.ToolDefinition]]=None, tool_choice: Union[uipath.models.llm_gateway.AutoToolChoice, uipath.models.llm_gateway.RequiredToolChoice, uipath.models.llm_gateway.SpecificToolChoice, Literal['auto', 'none'], NoneType]=None, response_format: Union[Dict[str, Any], type[pydantic.main.BaseModel], NoneType]=None, api_version: str="2024-08-01-preview")
|
|
343
246
|
|
|
344
247
|
```
|
|
345
248
|
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
from typing import Any, Dict, Optional, Union
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
4
|
+
|
|
5
|
+
from .._config import Config
|
|
6
|
+
from .._execution_context import ExecutionContext
|
|
7
|
+
from .._folder_context import FolderContext
|
|
8
|
+
from .._utils import Endpoint, RequestSpec, header_folder
|
|
9
|
+
from ..models.guardrails import BuiltInValidatorGuardrail, Guardrail
|
|
10
|
+
from ..tracing import traced
|
|
11
|
+
from ._base_service import BaseService
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class BuiltInGuardrailValidationResult(BaseModel):
|
|
15
|
+
"""Result from built-in guardrail validation."""
|
|
16
|
+
|
|
17
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
18
|
+
|
|
19
|
+
validation_passed: bool = Field(alias="validation_passed")
|
|
20
|
+
reason: str = Field(alias="reason")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class GuardrailViolationError(Exception):
|
|
24
|
+
"""Exception raised when guardrail validation fails."""
|
|
25
|
+
|
|
26
|
+
def __init__(self, detected_issue: Any):
|
|
27
|
+
self.detected_issue = detected_issue
|
|
28
|
+
super().__init__(f"Guardrail violation detected: {detected_issue}")
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class GuardrailsService(FolderContext, BaseService):
|
|
32
|
+
"""Service for validating text against UiPath Guardrails."""
|
|
33
|
+
|
|
34
|
+
def __init__(self, config: Config, execution_context: ExecutionContext) -> None:
|
|
35
|
+
super().__init__(config=config, execution_context=execution_context)
|
|
36
|
+
|
|
37
|
+
@traced("evaluate_guardrail", run_type="uipath")
|
|
38
|
+
def evaluate_guardrail(
|
|
39
|
+
self,
|
|
40
|
+
input_data: Union[str, Dict[str, Any]],
|
|
41
|
+
guardrail: Guardrail,
|
|
42
|
+
*,
|
|
43
|
+
folder_key: Optional[str] = None,
|
|
44
|
+
folder_path: Optional[str] = None,
|
|
45
|
+
) -> BuiltInGuardrailValidationResult:
|
|
46
|
+
"""Call the API to validate input_data with the given guardrail.
|
|
47
|
+
|
|
48
|
+
Only supports built-in guardrails for now.
|
|
49
|
+
"""
|
|
50
|
+
if isinstance(guardrail, BuiltInValidatorGuardrail):
|
|
51
|
+
parameters = [
|
|
52
|
+
param.model_dump(by_alias=True)
|
|
53
|
+
for param in guardrail.validator_parameters
|
|
54
|
+
]
|
|
55
|
+
payload = {
|
|
56
|
+
"validator": guardrail.validator_type,
|
|
57
|
+
"input": input_data if isinstance(input_data, str) else str(input_data),
|
|
58
|
+
"parameters": parameters,
|
|
59
|
+
}
|
|
60
|
+
spec = RequestSpec(
|
|
61
|
+
method="POST",
|
|
62
|
+
endpoint=Endpoint("/agentsruntime_/api/execution/guardrails/validate"),
|
|
63
|
+
json=payload,
|
|
64
|
+
headers={**header_folder(folder_key, folder_path)},
|
|
65
|
+
)
|
|
66
|
+
response = self.request(
|
|
67
|
+
spec.method,
|
|
68
|
+
url=spec.endpoint,
|
|
69
|
+
json=spec.json,
|
|
70
|
+
headers=spec.headers,
|
|
71
|
+
)
|
|
72
|
+
return BuiltInGuardrailValidationResult.model_validate(response.json())
|
|
73
|
+
else:
|
|
74
|
+
raise NotImplementedError(
|
|
75
|
+
"Custom guardrail validation is not yet supported by the API."
|
|
76
|
+
)
|
|
@@ -344,7 +344,7 @@ class UiPathLlmChatService(BaseService):
|
|
|
344
344
|
@traced(name="llm_chat_completions", run_type="uipath")
|
|
345
345
|
async def chat_completions(
|
|
346
346
|
self,
|
|
347
|
-
messages: List[Dict[str, str]],
|
|
347
|
+
messages: Union[List[Dict[str, str]], List[tuple[str, str]]],
|
|
348
348
|
model: str = ChatModels.gpt_4o_mini_2024_07_18,
|
|
349
349
|
max_tokens: int = 4096,
|
|
350
350
|
temperature: float = 0,
|
|
@@ -475,13 +475,26 @@ class UiPathLlmChatService(BaseService):
|
|
|
475
475
|
This service uses UiPath's normalized API format which provides consistent
|
|
476
476
|
behavior across different underlying model providers and enhanced enterprise features.
|
|
477
477
|
"""
|
|
478
|
+
converted_messages = []
|
|
479
|
+
|
|
480
|
+
for message in messages:
|
|
481
|
+
if isinstance(message, tuple) and len(message) == 2:
|
|
482
|
+
role, content = message
|
|
483
|
+
converted_messages.append({"role": role, "content": content})
|
|
484
|
+
elif isinstance(message, dict):
|
|
485
|
+
converted_messages.append(message)
|
|
486
|
+
else:
|
|
487
|
+
raise ValueError(
|
|
488
|
+
f"Invalid message format: {message}. Expected tuple (role, content) or dict with 'role' and 'content' keys."
|
|
489
|
+
)
|
|
490
|
+
|
|
478
491
|
endpoint = EndpointManager.get_normalized_endpoint().format(
|
|
479
492
|
model=model, api_version=api_version
|
|
480
493
|
)
|
|
481
494
|
endpoint = Endpoint("/" + endpoint)
|
|
482
495
|
|
|
483
496
|
request_body = {
|
|
484
|
-
"messages":
|
|
497
|
+
"messages": converted_messages,
|
|
485
498
|
"max_tokens": max_tokens,
|
|
486
499
|
"temperature": temperature,
|
|
487
500
|
"n": n,
|
uipath/_uipath.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from functools import cached_property
|
|
1
2
|
from typing import Optional
|
|
2
3
|
|
|
3
4
|
from pydantic import ValidationError
|
|
@@ -51,10 +52,6 @@ class UiPath:
|
|
|
51
52
|
raise BaseUrlMissingError() from e
|
|
52
53
|
elif error["loc"][0] == "secret":
|
|
53
54
|
raise SecretMissingError() from e
|
|
54
|
-
self._folders_service: Optional[FolderService] = None
|
|
55
|
-
self._buckets_service: Optional[BucketsService] = None
|
|
56
|
-
self._attachments_service: Optional[AttachmentsService] = None
|
|
57
|
-
self._connections_service: Optional[ConnectionsService] = None
|
|
58
55
|
setup_logging(should_debug=debug)
|
|
59
56
|
self._execution_context = ExecutionContext()
|
|
60
57
|
|
|
@@ -66,13 +63,9 @@ class UiPath:
|
|
|
66
63
|
def assets(self) -> AssetsService:
|
|
67
64
|
return AssetsService(self._config, self._execution_context)
|
|
68
65
|
|
|
69
|
-
@
|
|
66
|
+
@cached_property
|
|
70
67
|
def attachments(self) -> AttachmentsService:
|
|
71
|
-
|
|
72
|
-
self._attachments_service = AttachmentsService(
|
|
73
|
-
self._config, self._execution_context
|
|
74
|
-
)
|
|
75
|
-
return self._attachments_service
|
|
68
|
+
return AttachmentsService(self._config, self._execution_context)
|
|
76
69
|
|
|
77
70
|
@property
|
|
78
71
|
def processes(self) -> ProcessesService:
|
|
@@ -82,39 +75,21 @@ class UiPath:
|
|
|
82
75
|
def actions(self) -> ActionsService:
|
|
83
76
|
return ActionsService(self._config, self._execution_context)
|
|
84
77
|
|
|
85
|
-
@
|
|
78
|
+
@cached_property
|
|
86
79
|
def buckets(self) -> BucketsService:
|
|
87
|
-
if not self._buckets_service:
|
|
88
|
-
self._buckets_service = BucketsService(
|
|
89
|
-
self._config, self._execution_context
|
|
90
|
-
)
|
|
91
80
|
return BucketsService(self._config, self._execution_context)
|
|
92
81
|
|
|
93
|
-
@
|
|
82
|
+
@cached_property
|
|
94
83
|
def connections(self) -> ConnectionsService:
|
|
95
|
-
|
|
96
|
-
if not self._folders_service:
|
|
97
|
-
self._folders_service = FolderService(
|
|
98
|
-
self._config, self._execution_context
|
|
99
|
-
)
|
|
100
|
-
self._connections_service = ConnectionsService(
|
|
101
|
-
self._config, self._execution_context, self._folders_service
|
|
102
|
-
)
|
|
103
|
-
return self._connections_service
|
|
84
|
+
return ConnectionsService(self._config, self._execution_context, self.folders)
|
|
104
85
|
|
|
105
86
|
@property
|
|
106
87
|
def context_grounding(self) -> ContextGroundingService:
|
|
107
|
-
if not self._folders_service:
|
|
108
|
-
self._folders_service = FolderService(self._config, self._execution_context)
|
|
109
|
-
if not self._buckets_service:
|
|
110
|
-
self._buckets_service = BucketsService(
|
|
111
|
-
self._config, self._execution_context
|
|
112
|
-
)
|
|
113
88
|
return ContextGroundingService(
|
|
114
89
|
self._config,
|
|
115
90
|
self._execution_context,
|
|
116
|
-
self.
|
|
117
|
-
self.
|
|
91
|
+
self.folders,
|
|
92
|
+
self.buckets,
|
|
118
93
|
)
|
|
119
94
|
|
|
120
95
|
@property
|
|
@@ -129,11 +104,9 @@ class UiPath:
|
|
|
129
104
|
def jobs(self) -> JobsService:
|
|
130
105
|
return JobsService(self._config, self._execution_context)
|
|
131
106
|
|
|
132
|
-
@
|
|
107
|
+
@cached_property
|
|
133
108
|
def folders(self) -> FolderService:
|
|
134
|
-
|
|
135
|
-
self._folders_service = FolderService(self._config, self._execution_context)
|
|
136
|
-
return self._folders_service
|
|
109
|
+
return FolderService(self._config, self._execution_context)
|
|
137
110
|
|
|
138
111
|
@property
|
|
139
112
|
def llm_openai(self) -> UiPathOpenAIService:
|
uipath/agent/models/agent.py
CHANGED
|
@@ -6,7 +6,11 @@ from typing import Annotated, Any, Dict, List, Literal, Optional, Union
|
|
|
6
6
|
from pydantic import BaseModel, ConfigDict, Discriminator, Field, Tag, field_validator
|
|
7
7
|
|
|
8
8
|
from uipath.models import Connection
|
|
9
|
-
from uipath.models.guardrails import
|
|
9
|
+
from uipath.models.guardrails import (
|
|
10
|
+
BuiltInValidatorGuardrail,
|
|
11
|
+
CustomGuardrail,
|
|
12
|
+
FieldReference,
|
|
13
|
+
)
|
|
10
14
|
|
|
11
15
|
|
|
12
16
|
class AgentResourceType(str, Enum):
|
|
@@ -132,6 +136,37 @@ class AgentProcessToolResourceConfig(BaseAgentToolResourceConfig):
|
|
|
132
136
|
)
|
|
133
137
|
|
|
134
138
|
|
|
139
|
+
class AgentEscalationRecipientType(str, Enum):
|
|
140
|
+
"""Enum for escalation recipient types."""
|
|
141
|
+
|
|
142
|
+
USER_ID = "UserId"
|
|
143
|
+
GROUP_ID = "GroupId"
|
|
144
|
+
USER_EMAIL = "UserEmail"
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
class AgentEscalationRecipient(BaseModel):
|
|
148
|
+
"""Recipient for escalation."""
|
|
149
|
+
|
|
150
|
+
type: Union[AgentEscalationRecipientType, str] = Field(..., alias="type")
|
|
151
|
+
value: str = Field(..., alias="value")
|
|
152
|
+
display_name: Optional[str] = Field(default=None, alias="displayName")
|
|
153
|
+
|
|
154
|
+
@field_validator("type", mode="before")
|
|
155
|
+
@classmethod
|
|
156
|
+
def normalize_type(cls, v: Any) -> str:
|
|
157
|
+
"""Normalize recipient type from int (1=UserId, 2=GroupId, 3=UserEmail) or string. Unknown integers are converted to string."""
|
|
158
|
+
if isinstance(v, int):
|
|
159
|
+
mapping = {
|
|
160
|
+
1: AgentEscalationRecipientType.USER_ID,
|
|
161
|
+
2: AgentEscalationRecipientType.GROUP_ID,
|
|
162
|
+
3: AgentEscalationRecipientType.USER_EMAIL,
|
|
163
|
+
}
|
|
164
|
+
return mapping.get(v, str(v))
|
|
165
|
+
return v
|
|
166
|
+
|
|
167
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
168
|
+
|
|
169
|
+
|
|
135
170
|
class AgentIntegrationToolParameter(BaseModel):
|
|
136
171
|
"""Agent integration tool parameter."""
|
|
137
172
|
|
|
@@ -479,6 +514,116 @@ class AgentSettings(BaseModel):
|
|
|
479
514
|
)
|
|
480
515
|
|
|
481
516
|
|
|
517
|
+
class AgentGuardrailActionType(str, Enum):
|
|
518
|
+
"""Action type enumeration."""
|
|
519
|
+
|
|
520
|
+
BLOCK = "block"
|
|
521
|
+
ESCALATE = "escalate"
|
|
522
|
+
FILTER = "filter"
|
|
523
|
+
LOG = "log"
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
class AgentGuardrailBlockAction(BaseModel):
|
|
527
|
+
"""Block action model."""
|
|
528
|
+
|
|
529
|
+
action_type: Literal["block"] = Field(alias="$actionType")
|
|
530
|
+
reason: str
|
|
531
|
+
|
|
532
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
class AgentGuardrailFilterAction(BaseModel):
|
|
536
|
+
"""Filter action model."""
|
|
537
|
+
|
|
538
|
+
action_type: Literal["filter"] = Field(alias="$actionType")
|
|
539
|
+
fields: List[FieldReference]
|
|
540
|
+
|
|
541
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
class AgentGuardrailSeverityLevel(str, Enum):
|
|
545
|
+
"""Severity level enumeration."""
|
|
546
|
+
|
|
547
|
+
ERROR = "Error"
|
|
548
|
+
INFO = "Info"
|
|
549
|
+
WARNING = "Warning"
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
class AgentGuardrailLogAction(BaseModel):
|
|
553
|
+
"""Log action model."""
|
|
554
|
+
|
|
555
|
+
action_type: Literal["log"] = Field(alias="$actionType")
|
|
556
|
+
message: str = Field(..., alias="message")
|
|
557
|
+
severity_level: AgentGuardrailSeverityLevel = Field(alias="severityLevel")
|
|
558
|
+
|
|
559
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
class AgentGuardrailEscalateActionApp(BaseModel):
|
|
563
|
+
"""Escalate action app model."""
|
|
564
|
+
|
|
565
|
+
id: Optional[str] = None
|
|
566
|
+
version: int
|
|
567
|
+
name: str
|
|
568
|
+
folder_id: Optional[str] = Field(None, alias="folderId")
|
|
569
|
+
folder_name: str = Field(alias="folderName")
|
|
570
|
+
app_process_key: Optional[str] = Field(None, alias="appProcessKey")
|
|
571
|
+
runtime: Optional[str] = None
|
|
572
|
+
|
|
573
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
class AgentGuardrailEscalateAction(BaseModel):
|
|
577
|
+
"""Escalate action model."""
|
|
578
|
+
|
|
579
|
+
action_type: Literal["escalate"] = Field(alias="$actionType")
|
|
580
|
+
app: AgentGuardrailEscalateActionApp
|
|
581
|
+
recipient: AgentEscalationRecipient
|
|
582
|
+
|
|
583
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
GuardrailAction = Annotated[
|
|
587
|
+
Union[
|
|
588
|
+
AgentGuardrailBlockAction,
|
|
589
|
+
AgentGuardrailFilterAction,
|
|
590
|
+
AgentGuardrailLogAction,
|
|
591
|
+
AgentGuardrailEscalateAction,
|
|
592
|
+
],
|
|
593
|
+
Field(discriminator="action_type"),
|
|
594
|
+
]
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
class AgentCustomGuardrail(CustomGuardrail):
|
|
598
|
+
"""Agent custom guardrail with action capabilities."""
|
|
599
|
+
|
|
600
|
+
action: GuardrailAction = Field(
|
|
601
|
+
..., description="Action to take when guardrail is triggered"
|
|
602
|
+
)
|
|
603
|
+
|
|
604
|
+
model_config = ConfigDict(
|
|
605
|
+
validate_by_name=True, validate_by_alias=True, extra="allow"
|
|
606
|
+
)
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
class AgentBuiltInValidatorGuardrail(BuiltInValidatorGuardrail):
|
|
610
|
+
"""Agent built-in validator guardrail with action capabilities."""
|
|
611
|
+
|
|
612
|
+
action: GuardrailAction = Field(
|
|
613
|
+
..., description="Action to take when guardrail is triggered"
|
|
614
|
+
)
|
|
615
|
+
|
|
616
|
+
model_config = ConfigDict(
|
|
617
|
+
validate_by_name=True, validate_by_alias=True, extra="allow"
|
|
618
|
+
)
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
AgentGuardrail = Annotated[
|
|
622
|
+
Union[AgentCustomGuardrail, AgentBuiltInValidatorGuardrail],
|
|
623
|
+
Field(discriminator="guardrail_type"),
|
|
624
|
+
]
|
|
625
|
+
|
|
626
|
+
|
|
482
627
|
class BaseAgentDefinition(BaseModel):
|
|
483
628
|
"""Agent definition model."""
|
|
484
629
|
|
|
@@ -488,7 +633,7 @@ class BaseAgentDefinition(BaseModel):
|
|
|
488
633
|
output_schema: Dict[str, Any] = Field(
|
|
489
634
|
..., alias="outputSchema", description="JSON schema for output arguments"
|
|
490
635
|
)
|
|
491
|
-
guardrails: Optional[List[
|
|
636
|
+
guardrails: Optional[List[AgentGuardrail]] = Field(
|
|
492
637
|
None, description="List of agent guardrails"
|
|
493
638
|
)
|
|
494
639
|
|
uipath/models/guardrails.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from enum import Enum
|
|
2
|
-
from typing import Annotated,
|
|
2
|
+
from typing import Annotated, Dict, List, Literal, Optional, Union
|
|
3
3
|
|
|
4
|
-
from pydantic import BaseModel, ConfigDict, Field
|
|
4
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class FieldSource(str, Enum):
|
|
@@ -183,112 +183,6 @@ Rule = Annotated[
|
|
|
183
183
|
]
|
|
184
184
|
|
|
185
185
|
|
|
186
|
-
class ActionType(str, Enum):
|
|
187
|
-
"""Action type enumeration."""
|
|
188
|
-
|
|
189
|
-
BLOCK = "block"
|
|
190
|
-
ESCALATE = "escalate"
|
|
191
|
-
FILTER = "filter"
|
|
192
|
-
LOG = "log"
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
class BlockAction(BaseModel):
|
|
196
|
-
"""Block action model."""
|
|
197
|
-
|
|
198
|
-
action_type: Literal["block"] = Field(alias="$actionType")
|
|
199
|
-
reason: str
|
|
200
|
-
|
|
201
|
-
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
class FilterAction(BaseModel):
|
|
205
|
-
"""Filter action model."""
|
|
206
|
-
|
|
207
|
-
action_type: Literal["filter"] = Field(alias="$actionType")
|
|
208
|
-
fields: List[FieldReference]
|
|
209
|
-
|
|
210
|
-
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
class SeverityLevel(str, Enum):
|
|
214
|
-
"""Severity level enumeration."""
|
|
215
|
-
|
|
216
|
-
ERROR = "Error"
|
|
217
|
-
INFO = "Info"
|
|
218
|
-
WARNING = "Warning"
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
class LogAction(BaseModel):
|
|
222
|
-
"""Log action model."""
|
|
223
|
-
|
|
224
|
-
action_type: Literal["log"] = Field(alias="$actionType")
|
|
225
|
-
message: str = Field(..., alias="message")
|
|
226
|
-
severity_level: SeverityLevel = Field(alias="severityLevel")
|
|
227
|
-
|
|
228
|
-
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
class EscalateActionApp(BaseModel):
|
|
232
|
-
"""Escalate action app model."""
|
|
233
|
-
|
|
234
|
-
id: Optional[str] = None
|
|
235
|
-
version: int
|
|
236
|
-
name: str
|
|
237
|
-
folder_id: Optional[str] = Field(None, alias="folderId")
|
|
238
|
-
folder_name: str = Field(alias="folderName")
|
|
239
|
-
app_process_key: Optional[str] = Field(None, alias="appProcessKey")
|
|
240
|
-
runtime: Optional[str] = None
|
|
241
|
-
|
|
242
|
-
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
class AgentEscalationRecipientType(str, Enum):
|
|
246
|
-
"""Enum for escalation recipient types."""
|
|
247
|
-
|
|
248
|
-
USER_ID = "UserId"
|
|
249
|
-
GROUP_ID = "GroupId"
|
|
250
|
-
USER_EMAIL = "UserEmail"
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
class AgentEscalationRecipient(BaseModel):
|
|
254
|
-
"""Recipient for escalation."""
|
|
255
|
-
|
|
256
|
-
type: Union[AgentEscalationRecipientType, str] = Field(..., alias="type")
|
|
257
|
-
value: str = Field(..., alias="value")
|
|
258
|
-
display_name: Optional[str] = Field(default=None, alias="displayName")
|
|
259
|
-
|
|
260
|
-
@field_validator("type", mode="before")
|
|
261
|
-
@classmethod
|
|
262
|
-
def normalize_type(cls, v: Any) -> str:
|
|
263
|
-
"""Normalize recipient type from int (1=UserId, 2=GroupId, 3=UserEmail) or string. Unknown integers are converted to string."""
|
|
264
|
-
if isinstance(v, int):
|
|
265
|
-
mapping = {
|
|
266
|
-
1: AgentEscalationRecipientType.USER_ID,
|
|
267
|
-
2: AgentEscalationRecipientType.GROUP_ID,
|
|
268
|
-
3: AgentEscalationRecipientType.USER_EMAIL,
|
|
269
|
-
}
|
|
270
|
-
return mapping.get(v, str(v))
|
|
271
|
-
return v
|
|
272
|
-
|
|
273
|
-
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
class EscalateAction(BaseModel):
|
|
277
|
-
"""Escalate action model."""
|
|
278
|
-
|
|
279
|
-
action_type: Literal["escalate"] = Field(alias="$actionType")
|
|
280
|
-
app: EscalateActionApp
|
|
281
|
-
recipient: AgentEscalationRecipient
|
|
282
|
-
|
|
283
|
-
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
GuardrailAction = Annotated[
|
|
287
|
-
Union[BlockAction, FilterAction, LogAction, EscalateAction],
|
|
288
|
-
Field(discriminator="action_type"),
|
|
289
|
-
]
|
|
290
|
-
|
|
291
|
-
|
|
292
186
|
class GuardrailScope(str, Enum):
|
|
293
187
|
"""Guardrail scope enumeration."""
|
|
294
188
|
|
|
@@ -312,7 +206,6 @@ class BaseGuardrail(BaseModel):
|
|
|
312
206
|
id: str
|
|
313
207
|
name: str
|
|
314
208
|
description: Optional[str] = None
|
|
315
|
-
action: GuardrailAction
|
|
316
209
|
enabled_for_evals: bool = Field(True, alias="enabledForEvals")
|
|
317
210
|
selector: GuardrailSelector
|
|
318
211
|
|
|
@@ -351,119 +244,3 @@ class GuardrailType(str, Enum):
|
|
|
351
244
|
|
|
352
245
|
BUILT_IN_VALIDATOR = "builtInValidator"
|
|
353
246
|
CUSTOM = "custom"
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
# Helper functions for type checking
|
|
357
|
-
def is_boolean_rule(rule: Rule) -> bool:
|
|
358
|
-
"""Check if rule is a BooleanRule."""
|
|
359
|
-
return hasattr(rule, "rule_type") and rule.rule_type == RuleType.BOOLEAN
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
def is_number_rule(rule: Rule) -> bool:
|
|
363
|
-
"""Check if rule is a NumberRule."""
|
|
364
|
-
return hasattr(rule, "rule_type") and rule.rule_type == RuleType.NUMBER
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
def is_universal_rule(rule: Rule) -> bool:
|
|
368
|
-
"""Check if rule is a UniversalRule."""
|
|
369
|
-
return hasattr(rule, "rule_type") and rule.rule_type == RuleType.UNIVERSAL
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
def is_word_rule(rule: Rule) -> bool:
|
|
373
|
-
"""Check if rule is a WordRule."""
|
|
374
|
-
return hasattr(rule, "rule_type") and rule.rule_type == RuleType.WORD
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
def is_custom_guardrail(guardrail: Guardrail) -> bool:
|
|
378
|
-
"""Check if guardrail is a CustomGuardrail."""
|
|
379
|
-
return (
|
|
380
|
-
hasattr(guardrail, "guardrail_type")
|
|
381
|
-
and guardrail.guardrail_type == GuardrailType.CUSTOM
|
|
382
|
-
)
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
def is_built_in_validator_guardrail(guardrail: Guardrail) -> bool:
|
|
386
|
-
"""Check if guardrail is a BuiltInValidatorGuardrail."""
|
|
387
|
-
return (
|
|
388
|
-
hasattr(guardrail, "guardrail_type")
|
|
389
|
-
and guardrail.guardrail_type == GuardrailType.BUILT_IN_VALIDATOR
|
|
390
|
-
)
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
def is_valid_action_type(value: Any) -> bool:
|
|
394
|
-
"""Check if value is a valid ActionType."""
|
|
395
|
-
return isinstance(value, str) and value.lower() in [
|
|
396
|
-
at.value.lower() for at in ActionType
|
|
397
|
-
]
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
def is_valid_severity_level(value: Any) -> bool:
|
|
401
|
-
"""Check if value is a valid SeverityLevel."""
|
|
402
|
-
return isinstance(value, str) and value in [sl.value for sl in SeverityLevel]
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
# Guardrail Models
|
|
406
|
-
class AgentGuardrailRuleParameter(BaseModel):
|
|
407
|
-
"""Parameter for guardrail rules."""
|
|
408
|
-
|
|
409
|
-
parameter_type: str = Field(..., alias="$parameterType")
|
|
410
|
-
parameter_type_alt: Optional[str] = Field(None, alias="parameterType")
|
|
411
|
-
value: Any = Field(..., description="Parameter value")
|
|
412
|
-
id: str = Field(..., description="Parameter identifier")
|
|
413
|
-
|
|
414
|
-
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
class AgentGuardrailRule(BaseModel):
|
|
418
|
-
"""Guardrail validation rule."""
|
|
419
|
-
|
|
420
|
-
rule_type: str = Field(..., alias="$ruleType")
|
|
421
|
-
rule_type_alt: Optional[str] = Field(None, alias="ruleType")
|
|
422
|
-
validator: str = Field(..., description="Validator type")
|
|
423
|
-
parameters: List[AgentGuardrailRuleParameter] = Field(
|
|
424
|
-
default_factory=list, description="Rule parameters"
|
|
425
|
-
)
|
|
426
|
-
|
|
427
|
-
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
class AgentGuardrailActionApp(BaseModel):
|
|
431
|
-
"""App configuration for guardrail actions."""
|
|
432
|
-
|
|
433
|
-
name: str = Field(..., description="App name")
|
|
434
|
-
version: str = Field(..., description="App version")
|
|
435
|
-
folder_name: str = Field(..., alias="folderName", description="Folder name")
|
|
436
|
-
|
|
437
|
-
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
class AgentGuardrailActionRecipient(BaseModel):
|
|
441
|
-
"""Recipient for guardrail actions."""
|
|
442
|
-
|
|
443
|
-
type: int = Field(..., description="Recipient type")
|
|
444
|
-
value: str = Field(..., description="Recipient identifier")
|
|
445
|
-
display_name: str = Field(..., alias="displayName", description="Display name")
|
|
446
|
-
|
|
447
|
-
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
class AgentGuardrailAction(BaseModel):
|
|
451
|
-
"""Action configuration for guardrails."""
|
|
452
|
-
|
|
453
|
-
action_type: str = Field(..., alias="$actionType")
|
|
454
|
-
action_type_alt: Optional[str] = Field(None, alias="actionType")
|
|
455
|
-
app: AgentGuardrailActionApp = Field(..., description="App configuration")
|
|
456
|
-
recipient: AgentGuardrailActionRecipient = Field(..., description="Recipient")
|
|
457
|
-
|
|
458
|
-
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
class AgentGuardrailSelector(BaseModel):
|
|
462
|
-
"""Selector for guardrail application scope."""
|
|
463
|
-
|
|
464
|
-
scopes: List[str] = Field(..., description="Scopes where guardrail applies")
|
|
465
|
-
match_names: List[str] = Field(
|
|
466
|
-
..., alias="matchNames", description="Names to match"
|
|
467
|
-
)
|
|
468
|
-
|
|
469
|
-
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
uipath/tracing/_utils.py
CHANGED
|
@@ -13,16 +13,26 @@ from zoneinfo import ZoneInfo
|
|
|
13
13
|
|
|
14
14
|
from opentelemetry.sdk.trace import ReadableSpan
|
|
15
15
|
from opentelemetry.trace import StatusCode
|
|
16
|
+
from pydantic import BaseModel
|
|
16
17
|
|
|
17
18
|
logger = logging.getLogger(__name__)
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
def _simple_serialize_defaults(obj):
|
|
21
|
-
|
|
22
|
+
# Handle Pydantic BaseModel instances
|
|
23
|
+
if hasattr(obj, "model_dump") and not isinstance(obj, type):
|
|
22
24
|
return obj.model_dump(exclude_none=True, mode="json")
|
|
23
|
-
|
|
25
|
+
|
|
26
|
+
# Handle classes - convert to schema representation
|
|
27
|
+
if isinstance(obj, type) and issubclass(obj, BaseModel):
|
|
28
|
+
return {
|
|
29
|
+
"__class__": obj.__name__,
|
|
30
|
+
"__module__": obj.__module__,
|
|
31
|
+
"schema": obj.model_json_schema(),
|
|
32
|
+
}
|
|
33
|
+
if hasattr(obj, "dict") and not isinstance(obj, type):
|
|
24
34
|
return obj.dict()
|
|
25
|
-
if hasattr(obj, "to_dict"):
|
|
35
|
+
if hasattr(obj, "to_dict") and not isinstance(obj, type):
|
|
26
36
|
return obj.to_dict()
|
|
27
37
|
|
|
28
38
|
# Handle dataclasses
|
|
@@ -31,7 +41,7 @@ def _simple_serialize_defaults(obj):
|
|
|
31
41
|
|
|
32
42
|
# Handle enums
|
|
33
43
|
if isinstance(obj, Enum):
|
|
34
|
-
return obj.value
|
|
44
|
+
return _simple_serialize_defaults(obj.value)
|
|
35
45
|
|
|
36
46
|
if isinstance(obj, (set, tuple)):
|
|
37
47
|
if hasattr(obj, "_asdict") and callable(obj._asdict):
|
|
@@ -44,6 +54,10 @@ def _simple_serialize_defaults(obj):
|
|
|
44
54
|
if isinstance(obj, (timezone, ZoneInfo)):
|
|
45
55
|
return obj.tzname(None)
|
|
46
56
|
|
|
57
|
+
# Allow JSON-serializable primitives to pass through unchanged
|
|
58
|
+
if obj is None or isinstance(obj, (bool, int, float, str)):
|
|
59
|
+
return obj
|
|
60
|
+
|
|
47
61
|
return str(obj)
|
|
48
62
|
|
|
49
63
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: uipath
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.108
|
|
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
|
|
@@ -2,7 +2,7 @@ uipath/__init__.py,sha256=IaeKItOOQXMa95avueJ3dAq-XcRHyZVNjcCGwlSB000,634
|
|
|
2
2
|
uipath/_config.py,sha256=pi3qxPzDTxMEstj_XkGOgKJqD6RTHHv7vYv8sS_-d5Q,92
|
|
3
3
|
uipath/_execution_context.py,sha256=Qo8VMUFgtiL-40KsZrvul5bGv1CRERle_fCw1ORCggY,2374
|
|
4
4
|
uipath/_folder_context.py,sha256=D-bgxdwpwJP4b_QdVKcPODYh15kMDrOar2xNonmMSm4,1861
|
|
5
|
-
uipath/_uipath.py,sha256=
|
|
5
|
+
uipath/_uipath.py,sha256=ycu11bjIUx5priRkB3xSRcilugHuSmfSN4Nq6Yz88gk,3702
|
|
6
6
|
uipath/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
uipath/_cli/README.md,sha256=GLtCfbeIKZKNnGTCsfSVqRQ27V1btT1i2bSAyW_xZl4,474
|
|
8
8
|
uipath/_cli/__init__.py,sha256=ba7gNskJLgN_bNfCPzoGAk7OsHCxaFpWpOvahzcQEf8,2329
|
|
@@ -68,7 +68,7 @@ uipath/_cli/_evals/mocks/mocker_factory.py,sha256=V5QKSTtQxztTo4-fK1TyAaXw2Z3mHf
|
|
|
68
68
|
uipath/_cli/_evals/mocks/mockito_mocker.py,sha256=AO2BmFwA6hz3Lte-STVr7aJDPvMCqKNKa4j2jeNZ_U4,2677
|
|
69
69
|
uipath/_cli/_evals/mocks/mocks.py,sha256=HY0IaSqqO8hioBB3rp5XwAjSpQE4K5hoH6oJQ-sH72I,2207
|
|
70
70
|
uipath/_cli/_push/sw_file_handler.py,sha256=DrGOpX7-dodrROh7YcjHlCBUuOEdVMh8o0550TL-ZYA,22520
|
|
71
|
-
uipath/_cli/_runtime/_contracts.py,sha256=
|
|
71
|
+
uipath/_cli/_runtime/_contracts.py,sha256=fj88vbuNq4-f69LQg6Ykt49ScEksJMYdkC20CtVEZ3s,36232
|
|
72
72
|
uipath/_cli/_runtime/_escalation.py,sha256=x3vI98qsfRA-fL_tNkRVTFXioM5Gv2w0GFcXJJ5eQtg,7981
|
|
73
73
|
uipath/_cli/_runtime/_hitl.py,sha256=JAwTUKvxO4HpnZMwE4E0AegAPw_uYOwgt0OYcu6EvTg,11474
|
|
74
74
|
uipath/_cli/_runtime/_logging.py,sha256=srjAi3Cy6g7b8WNHiYNjaZT4t40F3XRqquuoGd2kh4Y,14019
|
|
@@ -102,7 +102,7 @@ uipath/_resources/AGENTS.md,sha256=nRQNAVeEBaBvuMzXw8uXtMnGebLClUgwIMlgb8_qU9o,1
|
|
|
102
102
|
uipath/_resources/CLAUDE.md,sha256=kYsckFWTVe948z_fNWLysCHvi9_YpchBXl3s1Ek03lU,10
|
|
103
103
|
uipath/_resources/CLI_REFERENCE.md,sha256=M_SCtSjRhj1XwfgSFLfHJJahYXEd_CSQ_EnjLQAn-2Y,6470
|
|
104
104
|
uipath/_resources/REQUIRED_STRUCTURE.md,sha256=3laqGiNa3kauJ7jRI1d7w_fWKUDkqYBjcTT_6_8FAGk,1417
|
|
105
|
-
uipath/_resources/SDK_REFERENCE.md,sha256=
|
|
105
|
+
uipath/_resources/SDK_REFERENCE.md,sha256=0Xbt87pVXzw0ZfpPO4EnVKlwGQRoshVb8zRt8F1jAFs,18211
|
|
106
106
|
uipath/_services/__init__.py,sha256=_LNy4u--VlhVtTO66bULbCoBjyJBTuyh9jnzjWrv-h4,1140
|
|
107
107
|
uipath/_services/_base_service.py,sha256=x9-9jhPzn9Z16KRdFHhJNvV-FZHvTniMsDfxlS4Cutk,5782
|
|
108
108
|
uipath/_services/actions_service.py,sha256=2RPMR-hFMsOlqEyjIf3aF7-lrf57jdrSD0pBjj0Kyko,16040
|
|
@@ -116,8 +116,9 @@ uipath/_services/documents_service.py,sha256=dVv7kYT2wm4gbtqulSAQhtn418xgzV2yt7g
|
|
|
116
116
|
uipath/_services/entities_service.py,sha256=QKCLE6wRgq3HZraF-M2mljy-8il4vsNHrQhUgkewVVk,14028
|
|
117
117
|
uipath/_services/external_application_service.py,sha256=gZhnGgLn7ZYUZzZF7AumB14QEPanVY-D_02FqEcAFtw,5478
|
|
118
118
|
uipath/_services/folder_service.py,sha256=9JqgjKhWD-G_KUnfUTP2BADxL6OK9QNZsBsWZHAULdE,2749
|
|
119
|
+
uipath/_services/guardrails_service.py,sha256=Uch_3Ph3Obg7vG--iemqJUB7I7vSHmQMYtESAyIzqFI,2796
|
|
119
120
|
uipath/_services/jobs_service.py,sha256=tTZNsdZKN3uP7bWPQyBCpJeQxTfuOWbKYOR4L-_yJo4,32736
|
|
120
|
-
uipath/_services/llm_gateway_service.py,sha256=
|
|
121
|
+
uipath/_services/llm_gateway_service.py,sha256=vRnx5MSSkxxR0Xw4_km0_aDBrWgkZmyJ1QRBp_anfog,24995
|
|
121
122
|
uipath/_services/processes_service.py,sha256=O_uHgQ1rnwiV5quG0OQqabAnE6Rf6cWrMENYY2jKWt8,8585
|
|
122
123
|
uipath/_services/queues_service.py,sha256=VaG3dWL2QK6AJBOLoW2NQTpkPfZjsqsYPl9-kfXPFzA,13534
|
|
123
124
|
uipath/_utils/__init__.py,sha256=VdcpnENJIa0R6Y26NoxY64-wUVyvb4pKfTh1wXDQeMk,526
|
|
@@ -143,7 +144,7 @@ uipath/agent/conversation/exchange.py,sha256=nuk1tEMBHc_skrraT17d8U6AtyJ3h07ExGQ
|
|
|
143
144
|
uipath/agent/conversation/message.py,sha256=1ZkEs146s79TrOAWCQwzBAEJvjAu4lQBpJ64tKXDgGE,2142
|
|
144
145
|
uipath/agent/conversation/meta.py,sha256=3t0eS9UHoAPHre97QTUeVbjDhnMX4zj4-qG6ju0B8wY,315
|
|
145
146
|
uipath/agent/conversation/tool.py,sha256=ol8XI8AVd-QNn5auXNBPcCzOkh9PPFtL7hTK3kqInkU,2191
|
|
146
|
-
uipath/agent/models/agent.py,sha256=
|
|
147
|
+
uipath/agent/models/agent.py,sha256=kAdNWpyzggIYB4ye7vs-hPrHGxYPgTp48DcmQXw-Bcw,22630
|
|
147
148
|
uipath/agent/models/evals.py,sha256=QMIqwCuwabD_vYF0KgJpip5BV0pFLf9ZKUd9AL5eU2w,1843
|
|
148
149
|
uipath/agent/react/__init__.py,sha256=0Ci-uf0gSOReoHQyx3QImY-om3q_SgLT-bJUSlzS3B8,527
|
|
149
150
|
uipath/agent/react/prompts.py,sha256=0a06TJz2XqZuLK-yC_bvZV9ULXpY6UGtybjjbyVzXII,3375
|
|
@@ -175,7 +176,7 @@ uipath/models/documents.py,sha256=g3xAhZlGcLuD6a_DHcUQWoLdzh5dENulouYAwrjGHEw,39
|
|
|
175
176
|
uipath/models/entities.py,sha256=x6jbq4o_QhgL_pCgvHFsp9O8l333kQhn8e9ZCBs72UM,9823
|
|
176
177
|
uipath/models/errors.py,sha256=WCxxHBlLzLF17YxjqsFkkyBLwEQM_dc6fFU5qmBjD4A,597
|
|
177
178
|
uipath/models/exceptions.py,sha256=f71VsUyonK2uuH1Cs0tpP6f9dec6v6cffL1Z9EjTxm0,1870
|
|
178
|
-
uipath/models/guardrails.py,sha256=
|
|
179
|
+
uipath/models/guardrails.py,sha256=tyrJ0WTYX0Ds7VtFyX87k7T9mQaGv-u1maQpnO0IPXM,6034
|
|
179
180
|
uipath/models/interrupt_models.py,sha256=UzuVTMVesI204YQ4qFQFaN-gN3kksddkrujofcaC7zQ,881
|
|
180
181
|
uipath/models/job.py,sha256=h1S-ErUk4-oIdrxo4nEBEJdSv1NTTF4AF8LfXx5Exak,3063
|
|
181
182
|
uipath/models/llm_gateway.py,sha256=rUIus7BrUuuRriXqSJUE9FnjOyQ7pYpaX6hWEYvA6AA,1923
|
|
@@ -187,12 +188,12 @@ uipath/telemetry/_track.py,sha256=3RZgJtY8y28Y5rfVmC432OyRu7N3pSxPouwa82KWFso,47
|
|
|
187
188
|
uipath/tracing/__init__.py,sha256=0oUuxJKOHE14iOL4SP93FOiEYRIFLTq-o0NwRcTB8Q4,317
|
|
188
189
|
uipath/tracing/_otel_exporters.py,sha256=LAtaQV5QN4PSLgEbIVvlmUETNbMYqTX87R-3mRKy_S8,12438
|
|
189
190
|
uipath/tracing/_traced.py,sha256=yBIY05PCCrYyx50EIHZnwJaKNdHPNx-YTR1sHQl0a98,19901
|
|
190
|
-
uipath/tracing/_utils.py,sha256=
|
|
191
|
+
uipath/tracing/_utils.py,sha256=zMjiKjNpSN3YQNEU4-u5AAvPtUsi8QuEqNLya89jfAU,14466
|
|
191
192
|
uipath/utils/__init__.py,sha256=VD-KXFpF_oWexFg6zyiWMkxl2HM4hYJMIUDZ1UEtGx0,105
|
|
192
193
|
uipath/utils/_endpoints_manager.py,sha256=tnF_FiCx8qI2XaJDQgYkMN_gl9V0VqNR1uX7iawuLp8,8230
|
|
193
194
|
uipath/utils/dynamic_schema.py,sha256=w0u_54MoeIAB-mf3GmwX1A_X8_HDrRy6p998PvX9evY,3839
|
|
194
|
-
uipath-2.1.
|
|
195
|
-
uipath-2.1.
|
|
196
|
-
uipath-2.1.
|
|
197
|
-
uipath-2.1.
|
|
198
|
-
uipath-2.1.
|
|
195
|
+
uipath-2.1.108.dist-info/METADATA,sha256=3aGq13j9ra3Cm8I53R8yuDjWDcfp3kFCu_uv7hvNuWE,6626
|
|
196
|
+
uipath-2.1.108.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
197
|
+
uipath-2.1.108.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
|
|
198
|
+
uipath-2.1.108.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
|
|
199
|
+
uipath-2.1.108.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|