uipath 2.1.49__py3-none-any.whl → 2.1.51__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/__init__.py CHANGED
@@ -8,6 +8,7 @@ from .cli_auth import auth as auth
8
8
  from .cli_deploy import deploy as deploy # type: ignore
9
9
  from .cli_dev import dev as dev
10
10
  from .cli_eval import eval as eval # type: ignore
11
+ from .cli_init import generate_agents_md as generate_agents_md # type: ignore
11
12
  from .cli_init import init as init # type: ignore
12
13
  from .cli_invoke import invoke as invoke # type: ignore
13
14
  from .cli_new import new as new # type: ignore
@@ -65,7 +65,7 @@ class ProgressReporter:
65
65
  method=spec.method,
66
66
  url=spec.endpoint,
67
67
  params=spec.params,
68
- content=spec.content,
68
+ json=spec.json,
69
69
  headers=spec.headers,
70
70
  )
71
71
  self._eval_set_run_id = json.loads(response.content)["id"]
@@ -84,7 +84,7 @@ class ProgressReporter:
84
84
  method=spec.method,
85
85
  url=spec.endpoint,
86
86
  params=spec.params,
87
- content=spec.content,
87
+ json=spec.json,
88
88
  headers=spec.headers,
89
89
  )
90
90
  return json.loads(response.content)["id"]
@@ -116,7 +116,7 @@ class ProgressReporter:
116
116
  method=spec.method,
117
117
  url=spec.endpoint,
118
118
  params=spec.params,
119
- content=spec.content,
119
+ json=spec.json,
120
120
  headers=spec.headers,
121
121
  )
122
122
 
@@ -127,7 +127,7 @@ class ProgressReporter:
127
127
  method=spec.method,
128
128
  url=spec.endpoint,
129
129
  params=spec.params,
130
- content=spec.content,
130
+ json=spec.json,
131
131
  headers=spec.headers,
132
132
  )
133
133
 
@@ -201,18 +201,16 @@ class ProgressReporter:
201
201
  endpoint=Endpoint(
202
202
  f"agentsruntime_/api/execution/agents/{self._project_id}/evalRun"
203
203
  ),
204
- content=json.dumps(
205
- {
206
- "evalRunId": eval_run_id,
207
- "status": EvaluationStatus.COMPLETED.value,
208
- "result": {
209
- "output": {"content": {**actual_output}},
210
- "evaluatorScores": evaluator_scores,
211
- },
212
- "completionMetrics": {"duration": int(execution_time)},
213
- "assertionRuns": assertion_runs,
214
- }
215
- ),
204
+ json={
205
+ "evalRunId": eval_run_id,
206
+ "status": EvaluationStatus.COMPLETED.value,
207
+ "result": {
208
+ "output": {"content": {**actual_output}},
209
+ "evaluatorScores": evaluator_scores,
210
+ },
211
+ "completionMetrics": {"duration": int(execution_time)},
212
+ "assertionRuns": assertion_runs,
213
+ },
216
214
  headers=self._tenant_header(),
217
215
  )
218
216
 
@@ -222,18 +220,16 @@ class ProgressReporter:
222
220
  endpoint=Endpoint(
223
221
  f"agentsruntime_/api/execution/agents/{self._project_id}/evalRun"
224
222
  ),
225
- content=json.dumps(
226
- {
227
- "evalSetRunId": self._eval_set_run_id,
228
- "evalSnapshot": {
229
- "id": eval_item["id"],
230
- "name": eval_item["name"],
231
- "inputs": eval_item.get("inputs"),
232
- "expectedOutput": eval_item.get("expectedOutput", {}),
233
- },
234
- "status": EvaluationStatus.IN_PROGRESS.value,
235
- }
236
- ),
223
+ json={
224
+ "evalSetRunId": self._eval_set_run_id,
225
+ "evalSnapshot": {
226
+ "id": eval_item["id"],
227
+ "name": eval_item["name"],
228
+ "inputs": eval_item.get("inputs"),
229
+ "expectedOutput": eval_item.get("expectedOutput", {}),
230
+ },
231
+ "status": EvaluationStatus.IN_PROGRESS.value,
232
+ },
237
233
  headers=self._tenant_header(),
238
234
  )
239
235
 
@@ -247,15 +243,13 @@ class ProgressReporter:
247
243
  endpoint=Endpoint(
248
244
  f"agentsruntime_/api/execution/agents/{self._project_id}/evalSetRun"
249
245
  ),
250
- content=json.dumps(
251
- {
252
- "agentId": self._project_id,
253
- "evalSetId": self._eval_set_id,
254
- "agentSnapshot": agent_snapshot_dict,
255
- "status": EvaluationStatus.IN_PROGRESS.value,
256
- "numberOfEvalsExecuted": self._no_of_evals,
257
- }
258
- ),
246
+ json={
247
+ "agentId": self._project_id,
248
+ "evalSetId": self._eval_set_id,
249
+ "agentSnapshot": agent_snapshot_dict,
250
+ "status": EvaluationStatus.IN_PROGRESS.value,
251
+ "numberOfEvalsExecuted": self._no_of_evals,
252
+ },
259
253
  headers=self._tenant_header(),
260
254
  )
261
255
 
@@ -293,13 +287,11 @@ class ProgressReporter:
293
287
  endpoint=Endpoint(
294
288
  f"agentsruntime_/api/execution/agents/{self._project_id}/evalSetRun"
295
289
  ),
296
- content=json.dumps(
297
- {
298
- "evalSetRunId": self._eval_set_run_id,
299
- "status": EvaluationStatus.COMPLETED.value,
300
- "evaluatorScores": evaluator_scores,
301
- }
302
- ),
290
+ json={
291
+ "evalSetRunId": self._eval_set_run_id,
292
+ "status": EvaluationStatus.COMPLETED.value,
293
+ "evaluatorScores": evaluator_scores,
294
+ },
303
295
  headers=self._tenant_header(),
304
296
  )
305
297
 
uipath/_cli/cli_init.py CHANGED
@@ -1,6 +1,8 @@
1
1
  # type: ignore
2
+ import importlib.resources
2
3
  import json
3
4
  import os
5
+ import shutil
4
6
  import uuid
5
7
  from pathlib import Path
6
8
  from typing import Any, Dict, Optional
@@ -56,6 +58,34 @@ def generate_env_file(target_directory):
56
58
  console.success(f" Created '{relative_path}' file.")
57
59
 
58
60
 
61
+ def generate_agents_md(target_directory: str) -> None:
62
+ """Generate AGENTS.md file from the packaged resource.
63
+
64
+ Args:
65
+ target_directory: The directory where AGENTS.md should be created.
66
+ """
67
+ target_path = os.path.join(target_directory, "AGENTS.md")
68
+
69
+ # Skip if file already exists
70
+ if os.path.exists(target_path):
71
+ console.info("Skipping 'AGENTS.md' creation as it already exists.")
72
+ return
73
+
74
+ try:
75
+ # Get the resource path using importlib.resources
76
+ source_path = importlib.resources.files("uipath._resources").joinpath(
77
+ "AGENTS.md"
78
+ )
79
+
80
+ # Copy the file to the target directory
81
+ with importlib.resources.as_file(source_path) as s_path:
82
+ shutil.copy(s_path, target_path)
83
+
84
+ console.success(" Created 'AGENTS.md' file.")
85
+ except Exception as e:
86
+ console.warning(f"Could not create AGENTS.md: {e}")
87
+
88
+
59
89
  def get_existing_settings(config_path: str) -> Optional[Dict[str, Any]]:
60
90
  """Read existing settings from uipath.json if it exists.
61
91
 
@@ -130,6 +160,7 @@ def init(entrypoint: str, infer_bindings: bool) -> None:
130
160
  current_directory = os.getcwd()
131
161
  generate_env_file(current_directory)
132
162
  create_telemetry_config_file(current_directory)
163
+ generate_agents_md(current_directory)
133
164
 
134
165
  result = Middlewares.next(
135
166
  "init",