uipath 2.1.98__py3-none-any.whl → 2.1.100__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/cli_init.py +44 -11
- uipath/_resources/CLI_REFERENCE.md +1 -0
- uipath/_services/documents_service.py +4 -0
- uipath/agent/models/agent.py +4 -33
- uipath/models/guardrails.py +469 -0
- uipath/models/job.py +1 -1
- {uipath-2.1.98.dist-info → uipath-2.1.100.dist-info}/METADATA +1 -1
- {uipath-2.1.98.dist-info → uipath-2.1.100.dist-info}/RECORD +11 -10
- {uipath-2.1.98.dist-info → uipath-2.1.100.dist-info}/WHEEL +0 -0
- {uipath-2.1.98.dist-info → uipath-2.1.100.dist-info}/entry_points.txt +0 -0
- {uipath-2.1.98.dist-info → uipath-2.1.100.dist-info}/licenses/LICENSE +0 -0
uipath/_cli/cli_init.py
CHANGED
|
@@ -60,18 +60,25 @@ def generate_env_file(target_directory):
|
|
|
60
60
|
console.success(f"Created '{relative_path}' file.")
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
def generate_agent_md_file(
|
|
63
|
+
def generate_agent_md_file(
|
|
64
|
+
target_directory: str, file_name: str, no_agents_md_override: bool
|
|
65
|
+
) -> bool:
|
|
64
66
|
"""Generate an agent-specific file from the packaged resource.
|
|
65
67
|
|
|
66
68
|
Args:
|
|
67
69
|
target_directory: The directory where the file should be created.
|
|
68
70
|
file_name: The name of the file should be created.
|
|
71
|
+
no_agents_md_override: Whether to override existing files.
|
|
69
72
|
"""
|
|
70
73
|
target_path = os.path.join(target_directory, file_name)
|
|
71
74
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
will_override = os.path.exists(target_path)
|
|
76
|
+
|
|
77
|
+
if will_override and no_agents_md_override:
|
|
78
|
+
console.success(
|
|
79
|
+
f"File {click.style(target_path, fg='cyan')} already exists. Skipping."
|
|
80
|
+
)
|
|
81
|
+
return False
|
|
75
82
|
|
|
76
83
|
try:
|
|
77
84
|
source_path = importlib.resources.files("uipath._resources").joinpath(file_name)
|
|
@@ -79,15 +86,23 @@ def generate_agent_md_file(target_directory: str, file_name: str) -> None:
|
|
|
79
86
|
with importlib.resources.as_file(source_path) as s_path:
|
|
80
87
|
shutil.copy(s_path, target_path)
|
|
81
88
|
|
|
89
|
+
if will_override:
|
|
90
|
+
logger.debug(f"File '{target_path}' has been overridden.")
|
|
91
|
+
|
|
92
|
+
return will_override
|
|
93
|
+
|
|
82
94
|
except Exception as e:
|
|
83
95
|
console.warning(f"Could not create {file_name}: {e}")
|
|
84
96
|
|
|
97
|
+
return False
|
|
98
|
+
|
|
85
99
|
|
|
86
|
-
def generate_agent_md_files(target_directory: str) -> None:
|
|
100
|
+
def generate_agent_md_files(target_directory: str, no_agents_md_override: bool) -> None:
|
|
87
101
|
"""Generate an agent-specific file from the packaged resource.
|
|
88
102
|
|
|
89
103
|
Args:
|
|
90
104
|
target_directory: The directory where the files should be created.
|
|
105
|
+
no_agents_md_override: Whether to override existing files.
|
|
91
106
|
"""
|
|
92
107
|
agent_dir = os.path.join(target_directory, ".agent")
|
|
93
108
|
os.makedirs(agent_dir, exist_ok=True)
|
|
@@ -96,13 +111,21 @@ def generate_agent_md_files(target_directory: str) -> None:
|
|
|
96
111
|
|
|
97
112
|
agent_files = ["CLI_REFERENCE.md", "REQUIRED_STRUCTURE.md", "SDK_REFERENCE.md"]
|
|
98
113
|
|
|
114
|
+
any_overridden = False
|
|
115
|
+
|
|
99
116
|
for file_name in root_files:
|
|
100
|
-
generate_agent_md_file(target_directory, file_name)
|
|
117
|
+
if generate_agent_md_file(target_directory, file_name, no_agents_md_override):
|
|
118
|
+
any_overridden = True
|
|
101
119
|
|
|
102
120
|
for file_name in agent_files:
|
|
103
|
-
generate_agent_md_file(agent_dir, file_name)
|
|
121
|
+
if generate_agent_md_file(agent_dir, file_name, no_agents_md_override):
|
|
122
|
+
any_overridden = True
|
|
104
123
|
|
|
105
|
-
|
|
124
|
+
if any_overridden:
|
|
125
|
+
console.success(f"Updated {click.style('AGENTS.md', fg='cyan')} related files.")
|
|
126
|
+
return
|
|
127
|
+
|
|
128
|
+
console.success(f"Created {click.style('AGENTS.md', fg='cyan')} related files.")
|
|
106
129
|
|
|
107
130
|
|
|
108
131
|
def get_existing_settings(config_path: str) -> Optional[Dict[str, Any]]:
|
|
@@ -149,8 +172,15 @@ def write_config_file(config_data: Dict[str, Any] | RuntimeSchema) -> None:
|
|
|
149
172
|
default=True,
|
|
150
173
|
help="Infer bindings from the script.",
|
|
151
174
|
)
|
|
175
|
+
@click.option(
|
|
176
|
+
"--no-agents-md-override",
|
|
177
|
+
is_flag=True,
|
|
178
|
+
required=False,
|
|
179
|
+
default=False,
|
|
180
|
+
help="Won't override existing .agent files and AGENTS.md file.",
|
|
181
|
+
)
|
|
152
182
|
@track
|
|
153
|
-
def init(entrypoint: str, infer_bindings: bool) -> None:
|
|
183
|
+
def init(entrypoint: str, infer_bindings: bool, no_agents_md_override: bool) -> None:
|
|
154
184
|
"""Create uipath.json with input/output schemas and bindings."""
|
|
155
185
|
with console.spinner("Initializing UiPath project ..."):
|
|
156
186
|
current_directory = os.getcwd()
|
|
@@ -160,7 +190,10 @@ def init(entrypoint: str, infer_bindings: bool) -> None:
|
|
|
160
190
|
result = Middlewares.next(
|
|
161
191
|
"init",
|
|
162
192
|
entrypoint,
|
|
163
|
-
options={
|
|
193
|
+
options={
|
|
194
|
+
"infer_bindings": infer_bindings,
|
|
195
|
+
"no_agents_md_override": no_agents_md_override,
|
|
196
|
+
},
|
|
164
197
|
write_config=write_config_file,
|
|
165
198
|
)
|
|
166
199
|
|
|
@@ -175,7 +208,7 @@ def init(entrypoint: str, infer_bindings: bool) -> None:
|
|
|
175
208
|
if not result.should_continue:
|
|
176
209
|
return
|
|
177
210
|
|
|
178
|
-
generate_agent_md_files(current_directory)
|
|
211
|
+
generate_agent_md_files(current_directory, no_agents_md_override)
|
|
179
212
|
script_path = get_user_script(current_directory, entrypoint=entrypoint)
|
|
180
213
|
if not script_path:
|
|
181
214
|
return
|
|
@@ -27,6 +27,7 @@ The UiPath Python SDK provides a comprehensive CLI for managing coded agents and
|
|
|
27
27
|
| Option | Type | Default | Description |
|
|
28
28
|
|--------|------|---------|-------------|
|
|
29
29
|
| `--infer-bindings` | flag | false | Infer bindings from the script. |
|
|
30
|
+
| `--no-agents-md-override` | flag | false | Won't override existing .agent files and AGENTS.md file. |
|
|
30
31
|
|
|
31
32
|
**Usage Examples:**
|
|
32
33
|
|
|
@@ -27,6 +27,10 @@ class DocumentsService(FolderContext, BaseService):
|
|
|
27
27
|
"""Service for managing UiPath DocumentUnderstanding Document Operations.
|
|
28
28
|
|
|
29
29
|
This service provides methods to extract data from documents using UiPath's Document Understanding capabilities.
|
|
30
|
+
|
|
31
|
+
!!! warning "Preview Feature"
|
|
32
|
+
This function is currently experimental.
|
|
33
|
+
Behavior and parameters are subject to change in future versions.
|
|
30
34
|
"""
|
|
31
35
|
|
|
32
36
|
def __init__(self, config: Config, execution_context: ExecutionContext) -> None:
|
uipath/agent/models/agent.py
CHANGED
|
@@ -6,6 +6,7 @@ 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 AgentEscalationRecipient, Guardrail
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class AgentResourceType(str, Enum):
|
|
@@ -305,39 +306,6 @@ class AgentMcpResourceConfig(BaseAgentResourceConfig):
|
|
|
305
306
|
)
|
|
306
307
|
|
|
307
308
|
|
|
308
|
-
class AgentEscalationRecipientType(str, Enum):
|
|
309
|
-
"""Enum for escalation recipient types."""
|
|
310
|
-
|
|
311
|
-
USER_ID = "UserId"
|
|
312
|
-
GROUP_ID = "GroupId"
|
|
313
|
-
USER_EMAIL = "UserEmail"
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
class AgentEscalationRecipient(BaseModel):
|
|
317
|
-
"""Recipient for escalation."""
|
|
318
|
-
|
|
319
|
-
type: Union[AgentEscalationRecipientType, str] = Field(..., alias="type")
|
|
320
|
-
value: str = Field(..., alias="value")
|
|
321
|
-
display_name: Optional[str] = Field(default=None, alias="displayName")
|
|
322
|
-
|
|
323
|
-
@field_validator("type", mode="before")
|
|
324
|
-
@classmethod
|
|
325
|
-
def normalize_type(cls, v: Any) -> str:
|
|
326
|
-
"""Normalize recipient type from int (1=UserId, 2=GroupId, 3=UserEmail) or string. Unknown integers are converted to string."""
|
|
327
|
-
if isinstance(v, int):
|
|
328
|
-
mapping = {
|
|
329
|
-
1: AgentEscalationRecipientType.USER_ID,
|
|
330
|
-
2: AgentEscalationRecipientType.GROUP_ID,
|
|
331
|
-
3: AgentEscalationRecipientType.USER_EMAIL,
|
|
332
|
-
}
|
|
333
|
-
return mapping.get(v, str(v))
|
|
334
|
-
return v
|
|
335
|
-
|
|
336
|
-
model_config = ConfigDict(
|
|
337
|
-
validate_by_name=True, validate_by_alias=True, extra="allow"
|
|
338
|
-
)
|
|
339
|
-
|
|
340
|
-
|
|
341
309
|
class AgentEscalationChannelProperties(BaseResourceProperties):
|
|
342
310
|
"""Agent escalation channel properties."""
|
|
343
311
|
|
|
@@ -508,6 +476,9 @@ class BaseAgentDefinition(BaseModel):
|
|
|
508
476
|
output_schema: Dict[str, Any] = Field(
|
|
509
477
|
..., alias="outputSchema", description="JSON schema for output arguments"
|
|
510
478
|
)
|
|
479
|
+
guardrails: Optional[List[Guardrail]] = Field(
|
|
480
|
+
None, description="List of agent guardrails"
|
|
481
|
+
)
|
|
511
482
|
|
|
512
483
|
model_config = ConfigDict(
|
|
513
484
|
validate_by_name=True, validate_by_alias=True, extra="allow"
|
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
from typing import Annotated, Any, Dict, List, Literal, Optional, Union
|
|
3
|
+
|
|
4
|
+
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class FieldSource(str, Enum):
|
|
8
|
+
"""Field source enumeration."""
|
|
9
|
+
|
|
10
|
+
INPUT = "input"
|
|
11
|
+
OUTPUT = "output"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ApplyTo(str, Enum):
|
|
15
|
+
"""Apply to enumeration."""
|
|
16
|
+
|
|
17
|
+
INPUT = "input"
|
|
18
|
+
INPUT_AND_OUTPUT = "inputAndOutput"
|
|
19
|
+
OUTPUT = "output"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class FieldReference(BaseModel):
|
|
23
|
+
"""Field reference model."""
|
|
24
|
+
|
|
25
|
+
path: str
|
|
26
|
+
source: FieldSource
|
|
27
|
+
|
|
28
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class SelectorType(str, Enum):
|
|
32
|
+
"""Selector type enumeration."""
|
|
33
|
+
|
|
34
|
+
ALL = "all"
|
|
35
|
+
SPECIFIC = "specific"
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class AllFieldsSelector(BaseModel):
|
|
39
|
+
"""All fields selector."""
|
|
40
|
+
|
|
41
|
+
selector_type: Literal["all"] = Field(alias="$selectorType")
|
|
42
|
+
|
|
43
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class SpecificFieldsSelector(BaseModel):
|
|
47
|
+
"""Specific fields selector."""
|
|
48
|
+
|
|
49
|
+
selector_type: Literal["specific"] = Field(alias="$selectorType")
|
|
50
|
+
fields: List[FieldReference]
|
|
51
|
+
|
|
52
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
FieldSelector = Annotated[
|
|
56
|
+
Union[AllFieldsSelector, SpecificFieldsSelector],
|
|
57
|
+
Field(discriminator="selector_type"),
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class RuleType(str, Enum):
|
|
62
|
+
"""Rule type enumeration."""
|
|
63
|
+
|
|
64
|
+
BOOLEAN = "boolean"
|
|
65
|
+
NUMBER = "number"
|
|
66
|
+
UNIVERSAL = "always"
|
|
67
|
+
WORD = "word"
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class WordOperator(str, Enum):
|
|
71
|
+
"""Word operator enumeration."""
|
|
72
|
+
|
|
73
|
+
CONTAINS = "contains"
|
|
74
|
+
DOES_NOT_CONTAIN = "doesNotContain"
|
|
75
|
+
DOES_NOT_END_WITH = "doesNotEndWith"
|
|
76
|
+
DOES_NOT_EQUAL = "doesNotEqual"
|
|
77
|
+
DOES_NOT_START_WITH = "doesNotStartWith"
|
|
78
|
+
ENDS_WITH = "endsWith"
|
|
79
|
+
EQUALS = "equals"
|
|
80
|
+
IS_EMPTY = "isEmpty"
|
|
81
|
+
IS_NOT_EMPTY = "isNotEmpty"
|
|
82
|
+
STARTS_WITH = "startsWith"
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class WordRule(BaseModel):
|
|
86
|
+
"""Word rule model."""
|
|
87
|
+
|
|
88
|
+
rule_type: Literal["word"] = Field(alias="$ruleType")
|
|
89
|
+
field_selector: FieldSelector = Field(alias="fieldSelector")
|
|
90
|
+
operator: WordOperator
|
|
91
|
+
value: Optional[str] = None
|
|
92
|
+
|
|
93
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class UniversalRule(BaseModel):
|
|
97
|
+
"""Universal rule model."""
|
|
98
|
+
|
|
99
|
+
rule_type: Literal["always"] = Field(alias="$ruleType")
|
|
100
|
+
apply_to: ApplyTo = Field(alias="applyTo")
|
|
101
|
+
|
|
102
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
class NumberOperator(str, Enum):
|
|
106
|
+
"""Number operator enumeration."""
|
|
107
|
+
|
|
108
|
+
DOES_NOT_EQUAL = "doesNotEqual"
|
|
109
|
+
EQUALS = "equals"
|
|
110
|
+
GREATER_THAN = "greaterThan"
|
|
111
|
+
GREATER_THAN_OR_EQUAL = "greaterThanOrEqual"
|
|
112
|
+
LESS_THAN = "lessThan"
|
|
113
|
+
LESS_THAN_OR_EQUAL = "lessThanOrEqual"
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
class NumberRule(BaseModel):
|
|
117
|
+
"""Number rule model."""
|
|
118
|
+
|
|
119
|
+
rule_type: Literal["number"] = Field(alias="$ruleType")
|
|
120
|
+
field_selector: FieldSelector = Field(alias="fieldSelector")
|
|
121
|
+
operator: NumberOperator
|
|
122
|
+
value: float
|
|
123
|
+
|
|
124
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
class BooleanOperator(str, Enum):
|
|
128
|
+
"""Boolean operator enumeration."""
|
|
129
|
+
|
|
130
|
+
EQUALS = "equals"
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
class BooleanRule(BaseModel):
|
|
134
|
+
"""Boolean rule model."""
|
|
135
|
+
|
|
136
|
+
rule_type: Literal["boolean"] = Field(alias="$ruleType")
|
|
137
|
+
field_selector: FieldSelector = Field(alias="fieldSelector")
|
|
138
|
+
operator: BooleanOperator
|
|
139
|
+
value: bool
|
|
140
|
+
|
|
141
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
class EnumListParameterValue(BaseModel):
|
|
145
|
+
"""Enum list parameter value."""
|
|
146
|
+
|
|
147
|
+
parameter_type: Literal["enum-list"] = Field(alias="$parameterType")
|
|
148
|
+
id: str
|
|
149
|
+
value: List[str]
|
|
150
|
+
|
|
151
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
class MapEnumParameterValue(BaseModel):
|
|
155
|
+
"""Map enum parameter value."""
|
|
156
|
+
|
|
157
|
+
parameter_type: Literal["map-enum"] = Field(alias="$parameterType")
|
|
158
|
+
id: str
|
|
159
|
+
value: Dict[str, float]
|
|
160
|
+
|
|
161
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
class NumberParameterValue(BaseModel):
|
|
165
|
+
"""Number parameter value."""
|
|
166
|
+
|
|
167
|
+
parameter_type: Literal["number"] = Field(alias="$parameterType")
|
|
168
|
+
id: str
|
|
169
|
+
value: float
|
|
170
|
+
|
|
171
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
ValidatorParameter = Annotated[
|
|
175
|
+
Union[EnumListParameterValue, MapEnumParameterValue, NumberParameterValue],
|
|
176
|
+
Field(discriminator="parameter_type"),
|
|
177
|
+
]
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
Rule = Annotated[
|
|
181
|
+
Union[WordRule, NumberRule, BooleanRule, UniversalRule],
|
|
182
|
+
Field(discriminator="rule_type"),
|
|
183
|
+
]
|
|
184
|
+
|
|
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
|
+
class GuardrailScope(str, Enum):
|
|
293
|
+
"""Guardrail scope enumeration."""
|
|
294
|
+
|
|
295
|
+
AGENT = "Agent"
|
|
296
|
+
LLM = "Llm"
|
|
297
|
+
TOOL = "Tool"
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
class GuardrailSelector(BaseModel):
|
|
301
|
+
"""Guardrail selector model."""
|
|
302
|
+
|
|
303
|
+
scopes: List[GuardrailScope] = Field(default=[GuardrailScope.TOOL])
|
|
304
|
+
match_names: Optional[List[str]] = Field(None, alias="matchNames")
|
|
305
|
+
|
|
306
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
class BaseGuardrail(BaseModel):
|
|
310
|
+
"""Base guardrail model."""
|
|
311
|
+
|
|
312
|
+
id: str
|
|
313
|
+
name: str
|
|
314
|
+
description: Optional[str] = None
|
|
315
|
+
action: GuardrailAction
|
|
316
|
+
enabled_for_evals: bool = Field(True, alias="enabledForEvals")
|
|
317
|
+
selector: GuardrailSelector
|
|
318
|
+
|
|
319
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
class CustomGuardrail(BaseGuardrail):
|
|
323
|
+
"""Custom guardrail model."""
|
|
324
|
+
|
|
325
|
+
guardrail_type: Literal["custom"] = Field(alias="$guardrailType")
|
|
326
|
+
rules: List[Rule]
|
|
327
|
+
|
|
328
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
class BuiltInValidatorGuardrail(BaseGuardrail):
|
|
332
|
+
"""Built-in validator guardrail model."""
|
|
333
|
+
|
|
334
|
+
guardrail_type: Literal["builtInValidator"] = Field(alias="$guardrailType")
|
|
335
|
+
validator_type: str = Field(alias="validatorType")
|
|
336
|
+
validator_parameters: List[ValidatorParameter] = Field(
|
|
337
|
+
default_factory=list, alias="validatorParameters"
|
|
338
|
+
)
|
|
339
|
+
|
|
340
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
Guardrail = Annotated[
|
|
344
|
+
Union[CustomGuardrail, BuiltInValidatorGuardrail],
|
|
345
|
+
Field(discriminator="guardrail_type"),
|
|
346
|
+
]
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
class GuardrailType(str, Enum):
|
|
350
|
+
"""Guardrail type enumeration."""
|
|
351
|
+
|
|
352
|
+
BUILT_IN_VALIDATOR = "builtInValidator"
|
|
353
|
+
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/models/job.py
CHANGED
|
@@ -15,7 +15,7 @@ class JobErrorInfo(BaseModel):
|
|
|
15
15
|
title: Optional[str] = Field(default=None, alias="Title")
|
|
16
16
|
detail: Optional[str] = Field(default=None, alias="Detail")
|
|
17
17
|
category: Optional[str] = Field(default=None, alias="Category")
|
|
18
|
-
status: Optional[
|
|
18
|
+
status: Optional[int] = Field(default=None, alias="Status")
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class Job(BaseModel):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: uipath
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.100
|
|
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
|
|
@@ -11,7 +11,7 @@ uipath/_cli/cli_debug.py,sha256=-s6Nmy0DnDyITjZAf6f71hZ1YDDt0Yl57XklEkuL0FU,4068
|
|
|
11
11
|
uipath/_cli/cli_deploy.py,sha256=KPCmQ0c_NYD5JofSDao5r6QYxHshVCRxlWDVnQvlp5w,645
|
|
12
12
|
uipath/_cli/cli_dev.py,sha256=nEfpjw1PZ72O6jmufYWVrueVwihFxDPOeJakdvNHdOA,2146
|
|
13
13
|
uipath/_cli/cli_eval.py,sha256=6evrUtaHnQ1NTEQKZKltgH7mpYOy6YP88L2LZcnnnfs,5139
|
|
14
|
-
uipath/_cli/cli_init.py,sha256=
|
|
14
|
+
uipath/_cli/cli_init.py,sha256=hAPMV_0HGZD0cDh7KqHDwMRlUfLoJl2NCp4T3Ilw8y0,7487
|
|
15
15
|
uipath/_cli/cli_invoke.py,sha256=m-te-EjhDpk_fhFDkt-yQFzmjEHGo5lQDGEQWxSXisQ,4395
|
|
16
16
|
uipath/_cli/cli_new.py,sha256=9378NYUBc9j-qKVXV7oja-jahfJhXBg8zKVyaon7ctY,2102
|
|
17
17
|
uipath/_cli/cli_pack.py,sha256=U5rXVbUnHFgdEsXyhkjmWza8dfob1wU9lyl4yrYnUss,11076
|
|
@@ -98,7 +98,7 @@ uipath/_events/_event_bus.py,sha256=4-VzstyX69cr7wT1EY7ywp-Ndyz2CyemD3Wk_-QmRpo,
|
|
|
98
98
|
uipath/_events/_events.py,sha256=eCgqEP4rzDgZShXMC9wgBVx-AcpwaJZlo2yiL7OyxdA,4441
|
|
99
99
|
uipath/_resources/AGENTS.md,sha256=nRQNAVeEBaBvuMzXw8uXtMnGebLClUgwIMlgb8_qU9o,1039
|
|
100
100
|
uipath/_resources/CLAUDE.md,sha256=kYsckFWTVe948z_fNWLysCHvi9_YpchBXl3s1Ek03lU,10
|
|
101
|
-
uipath/_resources/CLI_REFERENCE.md,sha256
|
|
101
|
+
uipath/_resources/CLI_REFERENCE.md,sha256=-eCe1hZSRvv9QGLltE3xl8muGWGNzmaHX8htRt3cgy8,6366
|
|
102
102
|
uipath/_resources/REQUIRED_STRUCTURE.md,sha256=3laqGiNa3kauJ7jRI1d7w_fWKUDkqYBjcTT_6_8FAGk,1417
|
|
103
103
|
uipath/_resources/SDK_REFERENCE.md,sha256=4wX8a1W5EJCta-iEHy_cDRahn0ENpJykwn-w4k_Lh6s,23245
|
|
104
104
|
uipath/_services/__init__.py,sha256=_LNy4u--VlhVtTO66bULbCoBjyJBTuyh9jnzjWrv-h4,1140
|
|
@@ -110,7 +110,7 @@ uipath/_services/attachments_service.py,sha256=NPQYK7CGjfBaNT_1S5vEAfODmOChTbQZf
|
|
|
110
110
|
uipath/_services/buckets_service.py,sha256=5s8tuivd7GUZYj774DDUYTa0axxlUuesc4EBY1V5sdk,18496
|
|
111
111
|
uipath/_services/connections_service.py,sha256=tKJHHOKQYKR6LkgB-V_2d0vFpLEdFeMzwj_xmBVHUDw,18416
|
|
112
112
|
uipath/_services/context_grounding_service.py,sha256=Pjx-QQQEiSKD-hY6ityj3QUSALN3fIcKLLHr_NZ0d_g,37117
|
|
113
|
-
uipath/_services/documents_service.py,sha256=
|
|
113
|
+
uipath/_services/documents_service.py,sha256=dVv7kYT2wm4gbtqulSAQhtn418xgzV2yt7gB7JvDsWU,24973
|
|
114
114
|
uipath/_services/entities_service.py,sha256=QKCLE6wRgq3HZraF-M2mljy-8il4vsNHrQhUgkewVVk,14028
|
|
115
115
|
uipath/_services/external_application_service.py,sha256=gZhnGgLn7ZYUZzZF7AumB14QEPanVY-D_02FqEcAFtw,5478
|
|
116
116
|
uipath/_services/folder_service.py,sha256=9JqgjKhWD-G_KUnfUTP2BADxL6OK9QNZsBsWZHAULdE,2749
|
|
@@ -144,7 +144,7 @@ uipath/agent/conversation/tool.py,sha256=ol8XI8AVd-QNn5auXNBPcCzOkh9PPFtL7hTK3kq
|
|
|
144
144
|
uipath/agent/loop/__init__.py,sha256=EZlNqrh8xod0VtTJqc-1pyUofaeS6PKjbsDfWoveVtI,424
|
|
145
145
|
uipath/agent/loop/prompts.py,sha256=qPwyd6Ple2m-Kt0m2foa6ZEmxD3kyCXOmGfXvzHi8Rc,3372
|
|
146
146
|
uipath/agent/loop/tools.py,sha256=OsT3x431KqOEzLi2jLxy2B9xXbcFq16xMfmyAqFaqZQ,1351
|
|
147
|
-
uipath/agent/models/agent.py,sha256=
|
|
147
|
+
uipath/agent/models/agent.py,sha256=o_nkrFtZFQdSNMK5NH9rCo346ABZcQLfW5h2Wv9yUhg,17791
|
|
148
148
|
uipath/agent/models/evals.py,sha256=QMIqwCuwabD_vYF0KgJpip5BV0pFLf9ZKUd9AL5eU2w,1843
|
|
149
149
|
uipath/eval/_helpers/__init__.py,sha256=GSmZMryjuO3Wo_zdxZdrHCRRsgOxsVFYkYgJ15YNC3E,86
|
|
150
150
|
uipath/eval/_helpers/helpers.py,sha256=iE2HHdMiAdAMLqxHkPKHpfecEtAuN5BTBqvKFTI8ciE,1315
|
|
@@ -173,8 +173,9 @@ uipath/models/documents.py,sha256=g3xAhZlGcLuD6a_DHcUQWoLdzh5dENulouYAwrjGHEw,39
|
|
|
173
173
|
uipath/models/entities.py,sha256=x6jbq4o_QhgL_pCgvHFsp9O8l333kQhn8e9ZCBs72UM,9823
|
|
174
174
|
uipath/models/errors.py,sha256=WCxxHBlLzLF17YxjqsFkkyBLwEQM_dc6fFU5qmBjD4A,597
|
|
175
175
|
uipath/models/exceptions.py,sha256=F0ITAhJsl6Agvmnv4nxvgY5oC_lrYIlxWTLs0yx859M,1636
|
|
176
|
+
uipath/models/guardrails.py,sha256=3LQf8CJj1ipnUqdUJuDenC4MS8o9GlWj_AsS2naP_tM,12976
|
|
176
177
|
uipath/models/interrupt_models.py,sha256=UzuVTMVesI204YQ4qFQFaN-gN3kksddkrujofcaC7zQ,881
|
|
177
|
-
uipath/models/job.py,sha256=
|
|
178
|
+
uipath/models/job.py,sha256=h1S-ErUk4-oIdrxo4nEBEJdSv1NTTF4AF8LfXx5Exak,3063
|
|
178
179
|
uipath/models/llm_gateway.py,sha256=rUIus7BrUuuRriXqSJUE9FnjOyQ7pYpaX6hWEYvA6AA,1923
|
|
179
180
|
uipath/models/processes.py,sha256=bV31xTyF0hRWZmwy3bWj5L8dBD9wttWxfJjwzhjETmk,1924
|
|
180
181
|
uipath/models/queues.py,sha256=gnbeEyYlHtdqdxBalio0lw8mq-78YBG9MPMSkv1BWOg,6934
|
|
@@ -188,8 +189,8 @@ uipath/tracing/_utils.py,sha256=X-LFsyIxDeNOGuHPvkb6T5o9Y8ElYhr_rP3CEBJSu4s,1383
|
|
|
188
189
|
uipath/utils/__init__.py,sha256=VD-KXFpF_oWexFg6zyiWMkxl2HM4hYJMIUDZ1UEtGx0,105
|
|
189
190
|
uipath/utils/_endpoints_manager.py,sha256=tnF_FiCx8qI2XaJDQgYkMN_gl9V0VqNR1uX7iawuLp8,8230
|
|
190
191
|
uipath/utils/dynamic_schema.py,sha256=w0u_54MoeIAB-mf3GmwX1A_X8_HDrRy6p998PvX9evY,3839
|
|
191
|
-
uipath-2.1.
|
|
192
|
-
uipath-2.1.
|
|
193
|
-
uipath-2.1.
|
|
194
|
-
uipath-2.1.
|
|
195
|
-
uipath-2.1.
|
|
192
|
+
uipath-2.1.100.dist-info/METADATA,sha256=K8dpdNDLy0rwzQon8JSyQJLutfnTIuVLDBBlav901UE,6626
|
|
193
|
+
uipath-2.1.100.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
194
|
+
uipath-2.1.100.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
|
|
195
|
+
uipath-2.1.100.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
|
|
196
|
+
uipath-2.1.100.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|