uipath 2.1.15__py3-none-any.whl → 2.1.17__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.
- uipath/_cli/_evals/_models/_evaluators.py +1 -1
- uipath/_cli/_evals/evaluation_service.py +1 -1
- uipath/_cli/_evals/progress_reporter.py +29 -84
- uipath/_cli/_utils/_project_files.py +2 -0
- uipath/models/exceptions.py +6 -0
- {uipath-2.1.15.dist-info → uipath-2.1.17.dist-info}/METADATA +1 -1
- {uipath-2.1.15.dist-info → uipath-2.1.17.dist-info}/RECORD +10 -10
- {uipath-2.1.15.dist-info → uipath-2.1.17.dist-info}/WHEEL +0 -0
- {uipath-2.1.15.dist-info → uipath-2.1.17.dist-info}/entry_points.txt +0 -0
- {uipath-2.1.15.dist-info → uipath-2.1.17.dist-info}/licenses/LICENSE +0 -0
@@ -58,7 +58,7 @@ class EvaluationResult(BaseModel):
|
|
58
58
|
evaluator_id: str
|
59
59
|
evaluator_name: str
|
60
60
|
score: float
|
61
|
-
#
|
61
|
+
# this is marked as optional, as it is populated inside the 'measure_execution_time' decorator
|
62
62
|
evaluation_time: Optional[float] = None
|
63
63
|
input: Dict[str, Any]
|
64
64
|
expected_output: Dict[str, Any]
|
@@ -337,7 +337,7 @@ class EvaluationService:
|
|
337
337
|
try:
|
338
338
|
if self._progress_reporter:
|
339
339
|
await self._progress_reporter.update_eval_run(
|
340
|
-
eval_results, eval_run_id,
|
340
|
+
eval_results, eval_run_id, execution_time
|
341
341
|
)
|
342
342
|
sw_progress_reporter_queue.task_done()
|
343
343
|
except Exception as e:
|
@@ -35,7 +35,9 @@ class ProgressReporter:
|
|
35
35
|
self._eval_set_id = eval_set_id
|
36
36
|
self.agent_snapshot = agent_snapshot
|
37
37
|
self._no_of_evals = no_of_evals
|
38
|
-
self._evaluators =
|
38
|
+
self._evaluators: dict[str, EvaluatorBase] = {
|
39
|
+
evaluator.id: evaluator for evaluator in evaluators
|
40
|
+
}
|
39
41
|
self._evaluator_scores: dict[str, list[float]] = {
|
40
42
|
evaluator.id: [] for evaluator in evaluators
|
41
43
|
}
|
@@ -56,6 +58,18 @@ class ProgressReporter:
|
|
56
58
|
"Cannot report data to StudioWeb. Please set UIPATH_PROJECT_ID."
|
57
59
|
)
|
58
60
|
|
61
|
+
async def create_eval_set_run(self):
|
62
|
+
"""Create a new evaluation set run in StudioWeb."""
|
63
|
+
spec = self._create_eval_set_run_spec()
|
64
|
+
response = await self._client.request_async(
|
65
|
+
method=spec.method,
|
66
|
+
url=spec.endpoint,
|
67
|
+
params=spec.params,
|
68
|
+
content=spec.content,
|
69
|
+
headers=spec.headers,
|
70
|
+
)
|
71
|
+
self._eval_set_run_id = json.loads(response.content)["id"]
|
72
|
+
|
59
73
|
async def create_eval_run(self, eval_item: dict[str, Any]):
|
60
74
|
"""Create a new evaluation run in StudioWeb.
|
61
75
|
|
@@ -72,7 +86,6 @@ class ProgressReporter:
|
|
72
86
|
params=spec.params,
|
73
87
|
content=spec.content,
|
74
88
|
headers=spec.headers,
|
75
|
-
scoped="org",
|
76
89
|
)
|
77
90
|
return json.loads(response.content)["id"]
|
78
91
|
|
@@ -80,7 +93,6 @@ class ProgressReporter:
|
|
80
93
|
self,
|
81
94
|
eval_results: list[EvalItemResult],
|
82
95
|
eval_run_id: str,
|
83
|
-
success: bool,
|
84
96
|
execution_time: float,
|
85
97
|
):
|
86
98
|
"""Update an evaluation run with results.
|
@@ -88,7 +100,6 @@ class ProgressReporter:
|
|
88
100
|
Args:
|
89
101
|
eval_results: Dictionary mapping evaluator IDs to evaluation results
|
90
102
|
eval_run_id: ID of the evaluation run to update
|
91
|
-
success: Whether the evaluation was successful
|
92
103
|
execution_time: The agent execution time
|
93
104
|
"""
|
94
105
|
assertion_runs, evaluator_scores, actual_output = self._collect_results(
|
@@ -107,22 +118,8 @@ class ProgressReporter:
|
|
107
118
|
params=spec.params,
|
108
119
|
content=spec.content,
|
109
120
|
headers=spec.headers,
|
110
|
-
scoped="org",
|
111
121
|
)
|
112
122
|
|
113
|
-
async def create_eval_set_run(self):
|
114
|
-
"""Create a new evaluation set run in StudioWeb."""
|
115
|
-
spec = self._create_eval_set_run_spec()
|
116
|
-
response = await self._client.request_async(
|
117
|
-
method=spec.method,
|
118
|
-
url=spec.endpoint,
|
119
|
-
params=spec.params,
|
120
|
-
content=spec.content,
|
121
|
-
headers=spec.headers,
|
122
|
-
scoped="org",
|
123
|
-
)
|
124
|
-
self._eval_set_run_id = json.loads(response.content)["id"]
|
125
|
-
|
126
123
|
async def update_eval_set_run(self):
|
127
124
|
"""Update the evaluation set run status to complete."""
|
128
125
|
spec = self._update_eval_set_run_spec()
|
@@ -132,7 +129,6 @@ class ProgressReporter:
|
|
132
129
|
params=spec.params,
|
133
130
|
content=spec.content,
|
134
131
|
headers=spec.headers,
|
135
|
-
scoped="org",
|
136
132
|
)
|
137
133
|
|
138
134
|
def _collect_results(
|
@@ -158,14 +154,6 @@ class ProgressReporter:
|
|
158
154
|
{
|
159
155
|
"status": EvaluationStatus.COMPLETED.value,
|
160
156
|
"evaluatorId": eval_result.evaluator_id,
|
161
|
-
"result": {
|
162
|
-
"output": {"content": {**eval_result.result.actual_output}},
|
163
|
-
"score": {
|
164
|
-
"type": ScoreType.NUMERICAL.value,
|
165
|
-
"value": eval_result.result.score,
|
166
|
-
"justification": eval_result.result.details,
|
167
|
-
},
|
168
|
-
},
|
169
157
|
"completionMetrics": {
|
170
158
|
"duration": eval_result.result.evaluation_time,
|
171
159
|
"cost": None,
|
@@ -173,6 +161,14 @@ class ProgressReporter:
|
|
173
161
|
"completionTokens": 0,
|
174
162
|
"promptTokens": 0,
|
175
163
|
},
|
164
|
+
"assertionSnapshot": {
|
165
|
+
"assertionType": self._evaluators[
|
166
|
+
eval_result.evaluator_id
|
167
|
+
].type.name,
|
168
|
+
"outputKey": self._evaluators[
|
169
|
+
eval_result.evaluator_id
|
170
|
+
].target_output_key,
|
171
|
+
},
|
176
172
|
}
|
177
173
|
)
|
178
174
|
|
@@ -192,7 +188,7 @@ class ProgressReporter:
|
|
192
188
|
return RequestSpec(
|
193
189
|
method="PUT",
|
194
190
|
endpoint=Endpoint(
|
195
|
-
f"
|
191
|
+
f"agentsruntime_/api/execution/agents/{self._project_id}/evalRun"
|
196
192
|
),
|
197
193
|
content=json.dumps(
|
198
194
|
{
|
@@ -213,7 +209,7 @@ class ProgressReporter:
|
|
213
209
|
return RequestSpec(
|
214
210
|
method="POST",
|
215
211
|
endpoint=Endpoint(
|
216
|
-
f"
|
212
|
+
f"agentsruntime_/api/execution/agents/{self._project_id}/evalRun"
|
217
213
|
),
|
218
214
|
content=json.dumps(
|
219
215
|
{
|
@@ -221,41 +217,10 @@ class ProgressReporter:
|
|
221
217
|
"evalSnapshot": {
|
222
218
|
"id": eval_item["id"],
|
223
219
|
"name": eval_item["name"],
|
224
|
-
"assertionType": "unknown",
|
225
|
-
"assertionProperties": {},
|
226
220
|
"inputs": eval_item.get("inputs"),
|
227
|
-
"
|
221
|
+
"expectedOutput": eval_item.get("expectedOutput", {}),
|
228
222
|
},
|
229
223
|
"status": EvaluationStatus.IN_PROGRESS.value,
|
230
|
-
"assertionRuns": [
|
231
|
-
# TODO: replace default values
|
232
|
-
{
|
233
|
-
"assertionSnapshot": {
|
234
|
-
"assertionProperties": {
|
235
|
-
"expectedOutput": eval_item.get(
|
236
|
-
"expectedOutput", {}
|
237
|
-
),
|
238
|
-
"prompt": "No prompt for coded agents",
|
239
|
-
"simulationInstructions": "",
|
240
|
-
"expectedAgentBehavior": "",
|
241
|
-
"inputGenerationInstructions": "",
|
242
|
-
"simulateTools": False,
|
243
|
-
"simulateInput": False,
|
244
|
-
"toolsToSimulate": [],
|
245
|
-
**(
|
246
|
-
{"model": evaluator.model}
|
247
|
-
if hasattr(evaluator, "model")
|
248
|
-
else {}
|
249
|
-
),
|
250
|
-
},
|
251
|
-
"assertionType": "Custom",
|
252
|
-
"outputKey": "*",
|
253
|
-
},
|
254
|
-
"status": 1,
|
255
|
-
"evaluatorId": evaluator.id,
|
256
|
-
}
|
257
|
-
for evaluator in self._evaluators
|
258
|
-
],
|
259
224
|
}
|
260
225
|
),
|
261
226
|
headers=self._tenant_header(),
|
@@ -264,13 +229,12 @@ class ProgressReporter:
|
|
264
229
|
def _create_eval_set_run_spec(
|
265
230
|
self,
|
266
231
|
) -> RequestSpec:
|
267
|
-
self._add_defaults_to_agent_snapshot()
|
268
232
|
agent_snapshot_dict = json.loads(self.agent_snapshot)
|
269
233
|
|
270
234
|
return RequestSpec(
|
271
235
|
method="POST",
|
272
236
|
endpoint=Endpoint(
|
273
|
-
f"
|
237
|
+
f"agentsruntime_/api/execution/agents/{self._project_id}/evalSetRun"
|
274
238
|
),
|
275
239
|
content=json.dumps(
|
276
240
|
{
|
@@ -288,7 +252,7 @@ class ProgressReporter:
|
|
288
252
|
evaluator_scores = []
|
289
253
|
evaluator_averages = []
|
290
254
|
|
291
|
-
for evaluator in self._evaluators:
|
255
|
+
for evaluator in self._evaluators.values():
|
292
256
|
scores = self._evaluator_scores[evaluator.id]
|
293
257
|
if scores:
|
294
258
|
avg_score = sum(scores) / len(scores)
|
@@ -316,14 +280,11 @@ class ProgressReporter:
|
|
316
280
|
return RequestSpec(
|
317
281
|
method="PUT",
|
318
282
|
endpoint=Endpoint(
|
319
|
-
f"
|
283
|
+
f"agentsruntime_/api/execution/agents/{self._project_id}/evalSetRun"
|
320
284
|
),
|
321
285
|
content=json.dumps(
|
322
286
|
{
|
323
|
-
## TODO: send the actual data here (do we need to send those again? isn't it redundant?)
|
324
287
|
"evalSetRunId": self._eval_set_run_id,
|
325
|
-
## this should be removed. not used but enforced by the API
|
326
|
-
"score": overall_score,
|
327
288
|
"status": EvaluationStatus.COMPLETED.value,
|
328
289
|
"evaluatorScores": evaluator_scores,
|
329
290
|
}
|
@@ -331,22 +292,6 @@ class ProgressReporter:
|
|
331
292
|
headers=self._tenant_header(),
|
332
293
|
)
|
333
294
|
|
334
|
-
def _add_defaults_to_agent_snapshot(self):
|
335
|
-
## TODO: remove this after properties are marked as optional at api level
|
336
|
-
agent_snapshot_dict = json.loads(self.agent_snapshot)
|
337
|
-
agent_snapshot_dict["tools"] = []
|
338
|
-
agent_snapshot_dict["contexts"] = []
|
339
|
-
agent_snapshot_dict["escalations"] = []
|
340
|
-
agent_snapshot_dict["systemPrompt"] = ""
|
341
|
-
agent_snapshot_dict["userPrompt"] = ""
|
342
|
-
agent_snapshot_dict["settings"] = {
|
343
|
-
"model": "",
|
344
|
-
"maxTokens": 0,
|
345
|
-
"temperature": 0,
|
346
|
-
"engine": "",
|
347
|
-
}
|
348
|
-
self.agent_snapshot = json.dumps(agent_snapshot_dict)
|
349
|
-
|
350
295
|
def _tenant_header(self) -> dict[str, str]:
|
351
296
|
tenant_id = os.getenv(ENV_TENANT_ID, None)
|
352
297
|
if not tenant_id:
|
@@ -329,6 +329,8 @@ def files_to_include(
|
|
329
329
|
file_extensions_included.extend(settings["fileExtensionsIncluded"])
|
330
330
|
if "filesIncluded" in settings:
|
331
331
|
files_included.extend(settings["filesIncluded"])
|
332
|
+
if directories_to_ignore is None:
|
333
|
+
directories_to_ignore = []
|
332
334
|
|
333
335
|
def is_venv_dir(d: str) -> bool:
|
334
336
|
"""Check if a directory is a Python virtual environment.
|
uipath/models/exceptions.py
CHANGED
@@ -20,6 +20,11 @@ class EnrichedException(Exception):
|
|
20
20
|
# Extract the relevant details from the HTTPStatusError
|
21
21
|
self.status_code = error.response.status_code if error.response else "Unknown"
|
22
22
|
self.url = str(error.request.url) if error.request else "Unknown"
|
23
|
+
self.http_method = (
|
24
|
+
error.request.method
|
25
|
+
if error.request and error.request.method
|
26
|
+
else "Unknown"
|
27
|
+
)
|
23
28
|
self.response_content = (
|
24
29
|
error.response.content.decode("utf-8")
|
25
30
|
if error.response and error.response.content
|
@@ -28,6 +33,7 @@ class EnrichedException(Exception):
|
|
28
33
|
|
29
34
|
enriched_message = (
|
30
35
|
f"\nRequest URL: {self.url}"
|
36
|
+
f"\nHTTP Method: {self.http_method}"
|
31
37
|
f"\nStatus Code: {self.status_code}"
|
32
38
|
f"\nResponse Content: {self.response_content}"
|
33
39
|
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: uipath
|
3
|
-
Version: 2.1.
|
3
|
+
Version: 2.1.17
|
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
|
@@ -29,8 +29,8 @@ uipath/_cli/_auth/auth_config.json,sha256=UnAhdum8phjuZaZKE5KLp0IcPCbIltDEU1M_G8
|
|
29
29
|
uipath/_cli/_auth/index.html,sha256=_Q2OtqPfapG_6vumbQYqtb2PfFe0smk7TlGERKEBvB4,22518
|
30
30
|
uipath/_cli/_auth/localhost.crt,sha256=oGl9oLLOiouHubAt39B4zEfylFvKEtbtr_43SIliXJc,1226
|
31
31
|
uipath/_cli/_auth/localhost.key,sha256=X31VYXD8scZtmGA837dGX5l6G-LXHLo5ItWJhZXaz3c,1679
|
32
|
-
uipath/_cli/_evals/evaluation_service.py,sha256=
|
33
|
-
uipath/_cli/_evals/progress_reporter.py,sha256=
|
32
|
+
uipath/_cli/_evals/evaluation_service.py,sha256=VVxZxoCJoB2SUhej_c0DzC9AlnIlWMKnug7z5weNSoE,22077
|
33
|
+
uipath/_cli/_evals/progress_reporter.py,sha256=6IVALHC-_vblLWMMKiI0k8xERf7HmQfCYM58GXsVa8s,10999
|
34
34
|
uipath/_cli/_evals/_evaluators/__init__.py,sha256=eXUozXTNJIVCoV54_btA5mXmm1uNnp0qcfysrz9JQu4,629
|
35
35
|
uipath/_cli/_evals/_evaluators/_agent_scorer_evaluator.py,sha256=qv4YjNiwqi5gWA24mRTC3QQ73o2Djkn1aY-AnHRyUMI,1545
|
36
36
|
uipath/_cli/_evals/_evaluators/_deterministic_evaluator.py,sha256=P0du9KWz5MP5Pw70Ze7piqeBfFq7w0aU7DLeEiNC3k4,1398
|
@@ -40,7 +40,7 @@ uipath/_cli/_evals/_evaluators/_llm_as_judge_evaluator.py,sha256=GdX5CsdfcPxCeSk
|
|
40
40
|
uipath/_cli/_evals/_evaluators/_trajectory_evaluator.py,sha256=dnogQTOskpI4_cNF0Ge3hBceJJocvOgxBWAwaCWnzB0,1595
|
41
41
|
uipath/_cli/_evals/_models/__init__.py,sha256=Ewjp3u2YeTH2MmzY9LWf7EIbAoIf_nW9fMYbj7pGlPs,420
|
42
42
|
uipath/_cli/_evals/_models/_evaluation_set.py,sha256=UIapFwn_Ti9zHUIcL3xyHDcLZ4lq4sHJ3JXLvY5OYI0,1080
|
43
|
-
uipath/_cli/_evals/_models/_evaluators.py,sha256=
|
43
|
+
uipath/_cli/_evals/_models/_evaluators.py,sha256=TW6bcGZk7cn9JVfzM9MFWIzog5x-7_BG9Zo0h8GfZOk,2091
|
44
44
|
uipath/_cli/_push/sw_file_handler.py,sha256=tRE9n68xv0r20ulwOyALHtYwzbjGneiASwzNm8xtBN0,16372
|
45
45
|
uipath/_cli/_runtime/_contracts.py,sha256=WlpaiQAMWCo-JFHjee35Klf49A3GsKjOU1Mf2IpUGHY,16033
|
46
46
|
uipath/_cli/_runtime/_escalation.py,sha256=x3vI98qsfRA-fL_tNkRVTFXioM5Gv2w0GFcXJJ5eQtg,7981
|
@@ -60,7 +60,7 @@ uipath/_cli/_utils/_folders.py,sha256=UVJcKPfPAVR5HF4AP6EXdlNVcfEF1v5pwGCpoAgBY3
|
|
60
60
|
uipath/_cli/_utils/_input_args.py,sha256=pyQhEcQXHdFHYTVNzvfWp439aii5StojoptnmCv5lfs,4094
|
61
61
|
uipath/_cli/_utils/_parse_ast.py,sha256=A-QToBIf-oP7yP2DQTHO6blkk6ik5z_IeaIwtEWO4e0,19516
|
62
62
|
uipath/_cli/_utils/_processes.py,sha256=q7DfEKHISDWf3pngci5za_z0Pbnf_shWiYEcTOTCiyk,1855
|
63
|
-
uipath/_cli/_utils/_project_files.py,sha256
|
63
|
+
uipath/_cli/_utils/_project_files.py,sha256=-zwoPePypqMvC-UxuoGuTGWn3dTP0EYUIz-mfQrgDyg,12742
|
64
64
|
uipath/_cli/_utils/_studio_project.py,sha256=iVcCm-aps-EQ7Pym_OWGOA48xeDigzcofUxXKy29x6U,13727
|
65
65
|
uipath/_cli/_utils/_tracing.py,sha256=2igb03j3EHjF_A406UhtCKkPfudVfFPjUq5tXUEG4oo,1541
|
66
66
|
uipath/_cli/_utils/_uv_helpers.py,sha256=6SvoLnZPoKIxW0sjMvD1-ENV_HOXDYzH34GjBqwT138,3450
|
@@ -99,7 +99,7 @@ uipath/models/connections.py,sha256=perIqW99YEg_0yWZPdpZlmNpZcwY_toR1wkqDUBdAN0,
|
|
99
99
|
uipath/models/context_grounding.py,sha256=S9PeOlFlw7VxzzJVR_Fs28OObW3MLHUPCFqNgkEz24k,1315
|
100
100
|
uipath/models/context_grounding_index.py,sha256=0ADlH8fC10qIbakgwU89pRVawzJ36TiSDKIqOhUdhuA,2580
|
101
101
|
uipath/models/errors.py,sha256=gPyU4sKYn57v03aOVqm97mnU9Do2e7bwMQwiSQVp9qc,461
|
102
|
-
uipath/models/exceptions.py,sha256=
|
102
|
+
uipath/models/exceptions.py,sha256=F0ITAhJsl6Agvmnv4nxvgY5oC_lrYIlxWTLs0yx859M,1636
|
103
103
|
uipath/models/interrupt_models.py,sha256=UzuVTMVesI204YQ4qFQFaN-gN3kksddkrujofcaC7zQ,881
|
104
104
|
uipath/models/job.py,sha256=f9L6_kg_VP0dAYvdcz1DWEWzy4NZPdlpHREod0uNK1E,3099
|
105
105
|
uipath/models/llm_gateway.py,sha256=rUIus7BrUuuRriXqSJUE9FnjOyQ7pYpaX6hWEYvA6AA,1923
|
@@ -114,8 +114,8 @@ uipath/tracing/_traced.py,sha256=qeVDrds2OUnpdUIA0RhtF0kg2dlAZhyC1RRkI-qivTM,185
|
|
114
114
|
uipath/tracing/_utils.py,sha256=ZeensQexnw69jVcsVrGyED7mPlAU-L1agDGm6_1A3oc,10388
|
115
115
|
uipath/utils/__init__.py,sha256=VD-KXFpF_oWexFg6zyiWMkxl2HM4hYJMIUDZ1UEtGx0,105
|
116
116
|
uipath/utils/_endpoints_manager.py,sha256=hiGEu6vyfQJoeiiql6w21TNiG6tADUfXlVBimxPU1-Q,4160
|
117
|
-
uipath-2.1.
|
118
|
-
uipath-2.1.
|
119
|
-
uipath-2.1.
|
120
|
-
uipath-2.1.
|
121
|
-
uipath-2.1.
|
117
|
+
uipath-2.1.17.dist-info/METADATA,sha256=OHfpvhVLjNz9n7-lTN7huLmlhpbjxMi-wruUh0DMFAk,6367
|
118
|
+
uipath-2.1.17.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
119
|
+
uipath-2.1.17.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
|
120
|
+
uipath-2.1.17.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
|
121
|
+
uipath-2.1.17.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|