uipath 2.0.10__py3-none-any.whl → 2.0.12__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 CHANGED
@@ -3,6 +3,7 @@ import json
3
3
  import os
4
4
  import traceback
5
5
  import uuid
6
+ from pathlib import Path
6
7
  from typing import Optional
7
8
 
8
9
  import click
@@ -75,7 +76,7 @@ def init(entrypoint: str) -> None:
75
76
  try:
76
77
  args = generate_args(script_path)
77
78
 
78
- relative_path = os.path.relpath(script_path, current_directory)
79
+ relative_path = Path(script_path).relative_to(current_directory).as_posix()
79
80
 
80
81
  config_data = {
81
82
  "entryPoints": [
uipath/_cli/cli_pack.py CHANGED
@@ -232,7 +232,7 @@ def pack_fn(projectName, description, entryPoints, version, authors, directory):
232
232
  os.makedirs(".uipath", exist_ok=True)
233
233
 
234
234
  # Define the allowlist of file extensions to include
235
- file_extensions_allowlist = [".py", ".mermaid", ".json"]
235
+ file_extensions_allowlist = [".py", ".mermaid", ".json", ".yaml", ".yml"]
236
236
 
237
237
  with zipfile.ZipFile(
238
238
  f".uipath/{projectName}.{version}.nupkg", "w", zipfile.ZIP_DEFLATED
@@ -14,6 +14,7 @@ from .._utils.constants import (
14
14
  HEADER_TENANT_ID,
15
15
  )
16
16
  from ..models import Action, ActionSchema
17
+ from ..tracing._traced import traced
17
18
  from ._base_service import BaseService
18
19
 
19
20
 
@@ -175,6 +176,7 @@ class ActionsService(FolderContext, BaseService):
175
176
  """
176
177
  super().__init__(config=config, execution_context=execution_context)
177
178
 
179
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
178
180
  async def create_async(
179
181
  self,
180
182
  title: str,
@@ -232,6 +234,7 @@ class ActionsService(FolderContext, BaseService):
232
234
  await self.request_async(spec.method, spec.endpoint, content=spec.content)
233
235
  return Action.model_validate(json_response)
234
236
 
237
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
235
238
  def create(
236
239
  self,
237
240
  title: str,
@@ -287,6 +290,7 @@ class ActionsService(FolderContext, BaseService):
287
290
  self.request(spec.method, spec.endpoint, content=spec.content)
288
291
  return Action.model_validate(json_response)
289
292
 
293
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
290
294
  def retrieve(
291
295
  self, action_key: str, app_folder_path: str = "", app_folder_key: str = ""
292
296
  ) -> Action:
@@ -311,6 +315,7 @@ class ActionsService(FolderContext, BaseService):
311
315
 
312
316
  return Action.model_validate(response.json())
313
317
 
318
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
314
319
  async def retrieve_async(
315
320
  self, action_key: str, app_folder_path: str = "", app_folder_key: str = ""
316
321
  ) -> Action:
@@ -7,6 +7,7 @@ from .._execution_context import ExecutionContext
7
7
  from .._folder_context import FolderContext
8
8
  from .._utils import Endpoint, RequestSpec, header_folder, infer_bindings
9
9
  from ..models import UserAsset
10
+ from ..tracing._traced import traced
10
11
  from ._base_service import BaseService
11
12
 
12
13
 
@@ -21,6 +22,7 @@ class AssetsService(FolderContext, BaseService):
21
22
  super().__init__(config=config, execution_context=execution_context)
22
23
 
23
24
  @infer_bindings()
25
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
24
26
  def retrieve(
25
27
  self,
26
28
  name: str,
@@ -56,6 +58,7 @@ class AssetsService(FolderContext, BaseService):
56
58
 
57
59
  return UserAsset.model_validate(response.json())
58
60
 
61
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
59
62
  async def retrieve_async(
60
63
  self,
61
64
  name: str,
@@ -83,6 +86,7 @@ class AssetsService(FolderContext, BaseService):
83
86
  return UserAsset.model_validate(response.json())
84
87
 
85
88
  @infer_bindings()
89
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
86
90
  def retrieve_credential(
87
91
  self,
88
92
  name: str,
@@ -118,6 +122,7 @@ class AssetsService(FolderContext, BaseService):
118
122
  return user_asset.credential_password
119
123
 
120
124
  @infer_bindings()
125
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
121
126
  async def retrieve_credential_async(
122
127
  self,
123
128
  name: str,
@@ -153,6 +158,7 @@ class AssetsService(FolderContext, BaseService):
153
158
 
154
159
  return user_asset.credential_password
155
160
 
161
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
156
162
  def update(
157
163
  self,
158
164
  robot_asset: UserAsset,
@@ -181,6 +187,7 @@ class AssetsService(FolderContext, BaseService):
181
187
  headers=spec.headers,
182
188
  )
183
189
 
190
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
184
191
  async def update_async(
185
192
  self,
186
193
  robot_asset: UserAsset,
@@ -6,6 +6,7 @@ from .._config import Config
6
6
  from .._execution_context import ExecutionContext
7
7
  from .._folder_context import FolderContext
8
8
  from .._utils import Endpoint, RequestSpec, infer_bindings
9
+ from ..tracing._traced import traced
9
10
  from ._base_service import BaseService
10
11
 
11
12
 
@@ -19,6 +20,7 @@ class BucketsService(FolderContext, BaseService):
19
20
  def __init__(self, config: Config, execution_context: ExecutionContext) -> None:
20
21
  super().__init__(config=config, execution_context=execution_context)
21
22
 
23
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
22
24
  def download(
23
25
  self,
24
26
  bucket_key: str,
@@ -57,6 +59,7 @@ class BucketsService(FolderContext, BaseService):
57
59
  file_content = request("GET", read_uri, headers=headers).content
58
60
  file.write(file_content)
59
61
 
62
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
60
63
  def upload(
61
64
  self,
62
65
  *,
@@ -108,6 +111,7 @@ class BucketsService(FolderContext, BaseService):
108
111
  else:
109
112
  request("PUT", write_uri, headers=headers, files={"file": file})
110
113
 
114
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
111
115
  def upload_from_memory(
112
116
  self,
113
117
  *,
@@ -163,6 +167,7 @@ class BucketsService(FolderContext, BaseService):
163
167
  request("PUT", write_uri, headers=headers, content=content)
164
168
 
165
169
  @infer_bindings()
170
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
166
171
  def retrieve(self, name: str) -> Any:
167
172
  """Retrieve bucket information by its name.
168
173
 
@@ -187,6 +192,7 @@ class BucketsService(FolderContext, BaseService):
187
192
  return response.json()["value"][0]
188
193
 
189
194
  @infer_bindings()
195
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
190
196
  async def retrieve_async(self, name: str) -> Any:
191
197
  """Asynchronously retrieve bucket information by its name.
192
198
 
@@ -210,6 +216,7 @@ class BucketsService(FolderContext, BaseService):
210
216
 
211
217
  return response.json()["value"][0]
212
218
 
219
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
213
220
  def retrieve_by_key(self, key: str) -> Any:
214
221
  """Retrieve bucket information by its key.
215
222
 
@@ -229,6 +236,7 @@ class BucketsService(FolderContext, BaseService):
229
236
 
230
237
  return response.json()
231
238
 
239
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
232
240
  async def retrieve_by_key_async(self, key: str) -> Any:
233
241
  """Asynchronously retrieve bucket information by its key.
234
242
 
@@ -7,6 +7,7 @@ from .._execution_context import ExecutionContext
7
7
  from .._utils import Endpoint, RequestSpec
8
8
  from .._utils.constants import ENTRYPOINT
9
9
  from ..models import Connection, ConnectionToken
10
+ from ..tracing._traced import traced
10
11
  from ._base_service import BaseService
11
12
 
12
13
  T_co = TypeVar("T_co", covariant=True)
@@ -72,6 +73,7 @@ class ConnectionsService(BaseService):
72
73
  except AttributeError as e:
73
74
  raise PluginNotFoundError(f"Plugin '{name}' is not installed") from e
74
75
 
76
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
75
77
  def retrieve(self, key: str) -> Connection:
76
78
  """Retrieve connection details by its key.
77
79
 
@@ -89,6 +91,7 @@ class ConnectionsService(BaseService):
89
91
  response = self.request(spec.method, url=spec.endpoint)
90
92
  return Connection.model_validate(response.json())
91
93
 
94
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
92
95
  async def retrieve_async(self, key: str) -> Connection:
93
96
  """Asynchronously retrieve connection details by its key.
94
97
 
@@ -106,6 +109,7 @@ class ConnectionsService(BaseService):
106
109
  response = await self.request_async(spec.method, url=spec.endpoint)
107
110
  return Connection.model_validate(response.json())
108
111
 
112
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
109
113
  def retrieve_token(self, key: str) -> ConnectionToken:
110
114
  """Retrieve an authentication token for a connection.
111
115
 
@@ -124,6 +128,7 @@ class ConnectionsService(BaseService):
124
128
  response = self.request(spec.method, url=spec.endpoint, params=spec.params)
125
129
  return ConnectionToken.model_validate(response.json())
126
130
 
131
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
127
132
  async def retrieve_token_async(self, key: str) -> ConnectionToken:
128
133
  """Asynchronously retrieve an authentication token for a connection.
129
134
 
@@ -15,6 +15,7 @@ from .._utils.constants import (
15
15
  from ..models import IngestionInProgressException
16
16
  from ..models.context_grounding import ContextGroundingQueryResponse
17
17
  from ..models.context_grounding_index import ContextGroundingIndex
18
+ from ..tracing._traced import traced
18
19
  from ._base_service import BaseService
19
20
  from .folder_service import FolderService
20
21
 
@@ -41,6 +42,7 @@ class ContextGroundingService(FolderContext, BaseService):
41
42
  self._folders_service = folders_service
42
43
  super().__init__(config=config, execution_context=execution_context)
43
44
 
45
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
44
46
  def retrieve(self, name: str) -> Optional[ContextGroundingIndex]:
45
47
  """Retrieve context grounding index information by its name.
46
48
 
@@ -70,6 +72,7 @@ class ContextGroundingService(FolderContext, BaseService):
70
72
  None,
71
73
  )
72
74
 
75
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
73
76
  async def retrieve_async(self, name: str) -> Optional[ContextGroundingIndex]:
74
77
  """Retrieve asynchronously context grounding index information by its name.
75
78
 
@@ -102,6 +105,7 @@ class ContextGroundingService(FolderContext, BaseService):
102
105
  None,
103
106
  )
104
107
 
108
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
105
109
  def retrieve_by_id(self, id: str) -> Any:
106
110
  """Retrieve context grounding index information by its ID.
107
111
 
@@ -122,6 +126,7 @@ class ContextGroundingService(FolderContext, BaseService):
122
126
  params=spec.params,
123
127
  ).json()
124
128
 
129
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
125
130
  async def retrieve_by_id_async(self, id: str) -> Any:
126
131
  """Retrieve asynchronously context grounding index information by its ID.
127
132
 
@@ -145,6 +150,7 @@ class ContextGroundingService(FolderContext, BaseService):
145
150
 
146
151
  return response.json()
147
152
 
153
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
148
154
  def search(
149
155
  self,
150
156
  name: str,
@@ -183,6 +189,7 @@ class ContextGroundingService(FolderContext, BaseService):
183
189
  response.json()
184
190
  )
185
191
 
192
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
186
193
  async def search_async(
187
194
  self,
188
195
  name: str,
@@ -220,6 +227,7 @@ class ContextGroundingService(FolderContext, BaseService):
220
227
  response.json()
221
228
  )
222
229
 
230
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
223
231
  def get_or_create_index(
224
232
  self,
225
233
  name: str,
@@ -248,6 +256,7 @@ class ContextGroundingService(FolderContext, BaseService):
248
256
  ).json()
249
257
  return ContextGroundingIndex.model_validate(response)
250
258
 
259
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
251
260
  async def get_or_create_index_async(
252
261
  self,
253
262
  name: str,
@@ -278,6 +287,7 @@ class ContextGroundingService(FolderContext, BaseService):
278
287
  ).json()
279
288
  return ContextGroundingIndex.model_validate(response)
280
289
 
290
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
281
291
  def ingest_data(self, index: ContextGroundingIndex) -> None:
282
292
  if not index.id:
283
293
  return
@@ -288,6 +298,7 @@ class ContextGroundingService(FolderContext, BaseService):
288
298
  headers=spec.headers,
289
299
  )
290
300
 
301
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
291
302
  async def ingest_data_async(self, index: ContextGroundingIndex) -> None:
292
303
  if not index.id:
293
304
  return
@@ -298,6 +309,7 @@ class ContextGroundingService(FolderContext, BaseService):
298
309
  headers=spec.headers,
299
310
  )
300
311
 
312
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
301
313
  def delete_index(self, index: ContextGroundingIndex) -> None:
302
314
  if not index.id:
303
315
  return
@@ -308,6 +320,7 @@ class ContextGroundingService(FolderContext, BaseService):
308
320
  headers=spec.headers,
309
321
  )
310
322
 
323
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
311
324
  async def delete_index_async(self, index: ContextGroundingIndex) -> None:
312
325
  if not index.id:
313
326
  return
@@ -1,5 +1,7 @@
1
1
  from typing import Optional
2
2
 
3
+ from uipath.tracing._traced import traced
4
+
3
5
  from .._config import Config
4
6
  from .._execution_context import ExecutionContext
5
7
  from .._utils import Endpoint, RequestSpec
@@ -31,6 +33,7 @@ class FolderService(BaseService):
31
33
  def __init__(self, config: Config, execution_context: ExecutionContext) -> None:
32
34
  super().__init__(config=config, execution_context=execution_context)
33
35
 
36
+ @traced(run_type="uipath")
34
37
  def retrieve_key_by_folder_path(self, folder_path: str) -> Optional[str]:
35
38
  spec = _retrieve_spec(folder_path)
36
39
  response = self.request(
@@ -6,6 +6,7 @@ from .._execution_context import ExecutionContext
6
6
  from .._folder_context import FolderContext
7
7
  from .._utils import Endpoint, RequestSpec, header_folder
8
8
  from ..models.job import Job
9
+ from ..tracing._traced import traced
9
10
  from ._base_service import BaseService
10
11
 
11
12
 
@@ -26,6 +27,7 @@ class JobsService(FolderContext, BaseService):
26
27
  @overload
27
28
  def resume(self, *, job_id: str, payload: Any) -> None: ...
28
29
 
30
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
29
31
  def resume(
30
32
  self,
31
33
  *,
@@ -12,6 +12,7 @@ from ..models.llm_gateway import (
12
12
  ToolDefinition,
13
13
  UsageInfo,
14
14
  )
15
+ from ..tracing._traced import traced
15
16
  from ._base_service import BaseService
16
17
 
17
18
  # Common constants
@@ -53,6 +54,7 @@ class UiPathOpenAIService(BaseService):
53
54
  def __init__(self, config: Config, execution_context: ExecutionContext) -> None:
54
55
  super().__init__(config=config, execution_context=execution_context)
55
56
 
57
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
56
58
  async def embeddings_usage(
57
59
  self, input: str, embedding_model: str = EmbeddingModels.text_embedding_ada_002
58
60
  ):
@@ -79,6 +81,7 @@ class UiPathOpenAIService(BaseService):
79
81
 
80
82
  return UsageInfo.model_validate(response.json())
81
83
 
84
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
82
85
  async def embeddings(
83
86
  self, input: str, embedding_model: str = EmbeddingModels.text_embedding_ada_002
84
87
  ):
@@ -104,6 +107,7 @@ class UiPathOpenAIService(BaseService):
104
107
 
105
108
  return TextEmbedding.model_validate(response.json())
106
109
 
110
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
107
111
  async def chat_completions(
108
112
  self,
109
113
  messages: List[Dict[str, str]],
@@ -153,6 +157,7 @@ class UiPathOpenAIService(BaseService):
153
157
 
154
158
  return ChatCompletion.model_validate(response.json())
155
159
 
160
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
156
161
  async def chat_completions_usage(
157
162
  self,
158
163
  messages: List[Dict[str, str]],
@@ -211,6 +216,7 @@ class UiPathLlmChatService(BaseService):
211
216
  def __init__(self, config: Config, execution_context: ExecutionContext) -> None:
212
217
  super().__init__(config=config, execution_context=execution_context)
213
218
 
219
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
214
220
  async def chat_completions(
215
221
  self,
216
222
  messages: List[Dict[str, str]],
@@ -8,6 +8,7 @@ from .._folder_context import FolderContext
8
8
  from .._utils import Endpoint, RequestSpec, header_folder, infer_bindings
9
9
  from .._utils.constants import ENV_JOB_ID, HEADER_JOB_KEY
10
10
  from ..models.job import Job
11
+ from ..tracing._traced import traced
11
12
  from ._base_service import BaseService
12
13
 
13
14
 
@@ -22,6 +23,7 @@ class ProcessesService(FolderContext, BaseService):
22
23
  def __init__(self, config: Config, execution_context: ExecutionContext) -> None:
23
24
  super().__init__(config=config, execution_context=execution_context)
24
25
 
26
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
25
27
  def invoke(
26
28
  self,
27
29
  name: str,
@@ -79,6 +81,7 @@ class ProcessesService(FolderContext, BaseService):
79
81
  return Job.model_validate(response.json()["value"][0])
80
82
 
81
83
  @infer_bindings()
84
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
82
85
  async def invoke_async(
83
86
  self,
84
87
  name: str,
@@ -7,6 +7,7 @@ from .._execution_context import ExecutionContext
7
7
  from .._folder_context import FolderContext
8
8
  from .._utils import Endpoint, RequestSpec
9
9
  from ..models import CommitType, QueueItem, TransactionItem, TransactionItemResult
10
+ from ..tracing._traced import traced
10
11
  from ._base_service import BaseService
11
12
 
12
13
 
@@ -20,6 +21,7 @@ class QueuesService(FolderContext, BaseService):
20
21
  def __init__(self, config: Config, execution_context: ExecutionContext) -> None:
21
22
  super().__init__(config=config, execution_context=execution_context)
22
23
 
24
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
23
25
  def list_items(self) -> Response:
24
26
  """Retrieves a list of queue items from the Orchestrator.
25
27
 
@@ -29,6 +31,7 @@ class QueuesService(FolderContext, BaseService):
29
31
  spec = self._list_items_spec()
30
32
  return self.request(spec.method, url=spec.endpoint)
31
33
 
34
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
32
35
  async def list_items_async(self) -> Response:
33
36
  """Asynchronously retrieves a list of queue items from the Orchestrator.
34
37
 
@@ -38,6 +41,7 @@ class QueuesService(FolderContext, BaseService):
38
41
  spec = self._list_items_spec()
39
42
  return await self.request_async(spec.method, url=spec.endpoint)
40
43
 
44
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
41
45
  def create_item(self, item: Union[Dict[str, Any], QueueItem]) -> Response:
42
46
  """Creates a new queue item in the Orchestrator.
43
47
 
@@ -52,6 +56,7 @@ class QueuesService(FolderContext, BaseService):
52
56
  spec = self._create_item_spec(item)
53
57
  return self.request(spec.method, url=spec.endpoint, json=spec.json)
54
58
 
59
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
55
60
  async def create_item_async(
56
61
  self, item: Union[Dict[str, Any], QueueItem]
57
62
  ) -> Response:
@@ -68,6 +73,7 @@ class QueuesService(FolderContext, BaseService):
68
73
  spec = self._create_item_spec(item)
69
74
  return await self.request_async(spec.method, url=spec.endpoint, json=spec.json)
70
75
 
76
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
71
77
  def create_items(
72
78
  self,
73
79
  items: List[Union[Dict[str, Any], QueueItem]],
@@ -87,6 +93,7 @@ class QueuesService(FolderContext, BaseService):
87
93
  spec = self._create_items_spec(items, queue_name, commit_type)
88
94
  return self.request(spec.method, url=spec.endpoint, json=spec.json)
89
95
 
96
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
90
97
  async def create_items_async(
91
98
  self,
92
99
  items: List[Union[Dict[str, Any], QueueItem]],
@@ -106,6 +113,7 @@ class QueuesService(FolderContext, BaseService):
106
113
  spec = self._create_items_spec(items, queue_name, commit_type)
107
114
  return await self.request_async(spec.method, url=spec.endpoint, json=spec.json)
108
115
 
116
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
109
117
  def create_transaction_item(
110
118
  self, item: Union[Dict[str, Any], TransactionItem], no_robot: bool = False
111
119
  ) -> Response:
@@ -121,6 +129,7 @@ class QueuesService(FolderContext, BaseService):
121
129
  spec = self._create_transaction_item_spec(item, no_robot)
122
130
  return self.request(spec.method, url=spec.endpoint, json=spec.json)
123
131
 
132
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
124
133
  async def create_transaction_item_async(
125
134
  self, item: Union[Dict[str, Any], TransactionItem], no_robot: bool = False
126
135
  ) -> Response:
@@ -136,6 +145,7 @@ class QueuesService(FolderContext, BaseService):
136
145
  spec = self._create_transaction_item_spec(item, no_robot)
137
146
  return await self.request_async(spec.method, url=spec.endpoint, json=spec.json)
138
147
 
148
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
139
149
  def update_progress_of_transaction_item(
140
150
  self, transaction_key: str, progress: str
141
151
  ) -> Response:
@@ -153,6 +163,7 @@ class QueuesService(FolderContext, BaseService):
153
163
  spec = self._update_progress_of_transaction_item_spec(transaction_key, progress)
154
164
  return self.request(spec.method, url=spec.endpoint, json=spec.json)
155
165
 
166
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
156
167
  async def update_progress_of_transaction_item_async(
157
168
  self, transaction_key: str, progress: str
158
169
  ) -> Response:
@@ -170,6 +181,7 @@ class QueuesService(FolderContext, BaseService):
170
181
  spec = self._update_progress_of_transaction_item_spec(transaction_key, progress)
171
182
  return await self.request_async(spec.method, url=spec.endpoint, json=spec.json)
172
183
 
184
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
173
185
  def complete_transaction_item(
174
186
  self, transaction_key: str, result: Union[Dict[str, Any], TransactionItemResult]
175
187
  ) -> Response:
@@ -187,6 +199,7 @@ class QueuesService(FolderContext, BaseService):
187
199
  spec = self._complete_transaction_item_spec(transaction_key, result)
188
200
  return self.request(spec.method, url=spec.endpoint, json=spec.json)
189
201
 
202
+ @traced(run_type="uipath", hide_input=True, hide_output=True)
190
203
  async def complete_transaction_item_async(
191
204
  self, transaction_key: str, result: Union[Dict[str, Any], TransactionItemResult]
192
205
  ) -> Response:
uipath/tracing/_traced.py CHANGED
@@ -2,7 +2,7 @@ import inspect
2
2
  import json
3
3
  import logging
4
4
  from functools import wraps
5
- from typing import Any
5
+ from typing import Any, Callable, Optional
6
6
 
7
7
  from opentelemetry import trace
8
8
  from opentelemetry.sdk.trace import TracerProvider
@@ -23,6 +23,16 @@ def wait_for_tracers():
23
23
  trace.get_tracer_provider().shutdown() # type: ignore
24
24
 
25
25
 
26
+ def _default_input_processor(inputs):
27
+ """Default input processor that doesn't log any actual input data."""
28
+ return {"redacted": "Input data not logged for privacy/security"}
29
+
30
+
31
+ def _default_output_processor(outputs):
32
+ """Default output processor that doesn't log any actual output data."""
33
+ return {"redacted": "Output data not logged for privacy/security"}
34
+
35
+
26
36
  class TracedDecoratorRegistry:
27
37
  """Registry for tracing decorators."""
28
38
 
@@ -42,23 +52,42 @@ class TracedDecoratorRegistry:
42
52
  return cls._decorators.get(cls._active_decorator)
43
53
 
44
54
 
45
- def _opentelemetry_traced():
55
+ def _opentelemetry_traced(
56
+ run_type: Optional[str] = None,
57
+ span_type: Optional[str] = None,
58
+ input_processor: Optional[Callable[..., Any]] = None,
59
+ output_processor: Optional[Callable[..., Any]] = None,
60
+ ):
46
61
  def decorator(func):
47
62
  @wraps(func)
48
63
  def sync_wrapper(*args, **kwargs):
49
64
  with tracer.start_as_current_span(func.__name__) as span:
50
- span.set_attribute("span_type", "function_call_sync")
65
+ default_span_type = "function_call_sync"
51
66
  span.set_attribute(
52
- "inputs",
53
- _SpanUtils.format_args_for_trace_json(
54
- inspect.signature(func), *args, **kwargs
55
- ),
67
+ "span_type",
68
+ span_type if span_type is not None else default_span_type,
56
69
  )
70
+ if run_type is not None:
71
+ span.set_attribute("run_type", run_type)
72
+
73
+ # Format arguments for tracing
74
+ inputs = _SpanUtils.format_args_for_trace_json(
75
+ inspect.signature(func), *args, **kwargs
76
+ )
77
+ # Apply input processor if provided
78
+ if input_processor is not None:
79
+ processed_inputs = input_processor(json.loads(inputs))
80
+ inputs = json.dumps(processed_inputs, default=str)
81
+
82
+ span.set_attribute("inputs", inputs)
83
+
57
84
  try:
58
85
  result = func(*args, **kwargs)
59
- span.set_attribute(
60
- "output", json.dumps(result, default=str)
61
- ) # Record output
86
+ # Process output if processor is provided
87
+ output = result
88
+ if output_processor is not None:
89
+ output = output_processor(result)
90
+ span.set_attribute("output", json.dumps(output, default=str))
62
91
  return result
63
92
  except Exception as e:
64
93
  span.record_exception(e)
@@ -70,18 +99,32 @@ def _opentelemetry_traced():
70
99
  @wraps(func)
71
100
  async def async_wrapper(*args, **kwargs):
72
101
  with tracer.start_as_current_span(func.__name__) as span:
73
- span.set_attribute("span_type", "function_call_async")
102
+ default_span_type = "function_call_async"
74
103
  span.set_attribute(
75
- "inputs",
76
- _SpanUtils.format_args_for_trace_json(
77
- inspect.signature(func), *args, **kwargs
78
- ),
104
+ "span_type",
105
+ span_type if span_type is not None else default_span_type,
106
+ )
107
+ if run_type is not None:
108
+ span.set_attribute("run_type", run_type)
109
+
110
+ # Format arguments for tracing
111
+ inputs = _SpanUtils.format_args_for_trace_json(
112
+ inspect.signature(func), *args, **kwargs
79
113
  )
114
+ # Apply input processor if provided
115
+ if input_processor is not None:
116
+ processed_inputs = input_processor(json.loads(inputs))
117
+ inputs = json.dumps(processed_inputs, default=str)
118
+
119
+ span.set_attribute("inputs", inputs)
120
+
80
121
  try:
81
122
  result = await func(*args, **kwargs)
82
- span.set_attribute(
83
- "output", json.dumps(result, default=str)
84
- ) # Record output
123
+ # Process output if processor is provided
124
+ output = result
125
+ if output_processor is not None:
126
+ output = output_processor(result)
127
+ span.set_attribute("output", json.dumps(output, default=str))
85
128
  return result
86
129
  except Exception as e:
87
130
  span.record_exception(e)
@@ -93,22 +136,39 @@ def _opentelemetry_traced():
93
136
  @wraps(func)
94
137
  def generator_wrapper(*args, **kwargs):
95
138
  with tracer.start_as_current_span(func.__name__) as span:
96
- span.set_attribute("span_type", "function_call_generator_sync")
139
+ default_span_type = "function_call_generator_sync"
97
140
  span.set_attribute(
98
- "inputs",
99
- _SpanUtils.format_args_for_trace_json(
100
- inspect.signature(func), *args, **kwargs
101
- ),
141
+ "span_type",
142
+ span_type if span_type is not None else default_span_type,
102
143
  )
144
+ if run_type is not None:
145
+ span.set_attribute("run_type", run_type)
146
+
147
+ # Format arguments for tracing
148
+ inputs = _SpanUtils.format_args_for_trace_json(
149
+ inspect.signature(func), *args, **kwargs
150
+ )
151
+ # Apply input processor if provided
152
+ if input_processor is not None:
153
+ processed_inputs = input_processor(json.loads(inputs))
154
+ inputs = json.dumps(processed_inputs, default=str)
155
+
156
+ span.set_attribute("inputs", inputs)
157
+
103
158
  outputs = []
104
159
  try:
105
160
  for item in func(*args, **kwargs):
106
161
  outputs.append(item)
107
162
  span.add_event(f"Yielded: {item}") # Add event for each yield
108
163
  yield item
164
+
165
+ # Process output if processor is provided
166
+ output_to_record = outputs
167
+ if output_processor is not None:
168
+ output_to_record = output_processor(outputs)
109
169
  span.set_attribute(
110
- "output", json.dumps(outputs, default=str)
111
- ) # Record aggregated outputs
170
+ "output", json.dumps(output_to_record, default=str)
171
+ )
112
172
  except Exception as e:
113
173
  span.record_exception(e)
114
174
  span.set_status(
@@ -119,22 +179,39 @@ def _opentelemetry_traced():
119
179
  @wraps(func)
120
180
  async def async_generator_wrapper(*args, **kwargs):
121
181
  with tracer.start_as_current_span(func.__name__) as span:
122
- span.set_attribute("span_type", "function_call_generator_async")
182
+ default_span_type = "function_call_generator_async"
123
183
  span.set_attribute(
124
- "inputs",
125
- _SpanUtils.format_args_for_trace_json(
126
- inspect.signature(func), *args, **kwargs
127
- ),
184
+ "span_type",
185
+ span_type if span_type is not None else default_span_type,
186
+ )
187
+ if run_type is not None:
188
+ span.set_attribute("run_type", run_type)
189
+
190
+ # Format arguments for tracing
191
+ inputs = _SpanUtils.format_args_for_trace_json(
192
+ inspect.signature(func), *args, **kwargs
128
193
  )
194
+ # Apply input processor if provided
195
+ if input_processor is not None:
196
+ processed_inputs = input_processor(json.loads(inputs))
197
+ inputs = json.dumps(processed_inputs, default=str)
198
+
199
+ span.set_attribute("inputs", inputs)
200
+
129
201
  outputs = []
130
202
  try:
131
203
  async for item in func(*args, **kwargs):
132
204
  outputs.append(item)
133
205
  span.add_event(f"Yielded: {item}") # Add event for each yield
134
206
  yield item
207
+
208
+ # Process output if processor is provided
209
+ output_to_record = outputs
210
+ if output_processor is not None:
211
+ output_to_record = output_processor(outputs)
135
212
  span.set_attribute(
136
- "output", json.dumps(outputs, default=str)
137
- ) # Record aggregated outputs
213
+ "output", json.dumps(output_to_record, default=str)
214
+ )
138
215
  except Exception as e:
139
216
  span.record_exception(e)
140
217
  span.set_status(
@@ -154,12 +231,39 @@ def _opentelemetry_traced():
154
231
  return decorator
155
232
 
156
233
 
157
- def traced():
158
- """Decorator that will trace function invocations."""
234
+ def traced(
235
+ run_type: Optional[str] = None,
236
+ span_type: Optional[str] = None,
237
+ input_processor: Optional[Callable[..., Any]] = None,
238
+ output_processor: Optional[Callable[..., Any]] = None,
239
+ hide_input: bool = False,
240
+ hide_output: bool = False,
241
+ ):
242
+ """Decorator that will trace function invocations.
243
+
244
+ Args:
245
+ run_type: Optional string to categorize the run type
246
+ span_type: Optional string to categorize the span type
247
+ input_processor: Optional function to process function inputs before recording
248
+ Should accept a dictionary of inputs and return a processed dictionary
249
+ output_processor: Optional function to process function outputs before recording
250
+ Should accept the function output and return a processed value
251
+ hide_input: If True, don't log any input data
252
+ hide_output: If True, don't log any output data
253
+ """
254
+ # Apply default processors selectively based on hide flags
255
+ if hide_input:
256
+ input_processor = _default_input_processor
257
+
258
+ if hide_output:
259
+ output_processor = _default_output_processor
260
+
159
261
  decorator_factory = TracedDecoratorRegistry.get_decorator()
160
262
 
161
263
  if decorator_factory:
162
- return decorator_factory()
264
+ return decorator_factory(run_type, span_type, input_processor, output_processor)
163
265
  else:
164
266
  # Fallback to original implementation if no active decorator
165
- return _opentelemetry_traced()
267
+ return _opentelemetry_traced(
268
+ run_type, span_type, input_processor, output_processor
269
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath
3
- Version: 2.0.10
3
+ Version: 2.0.12
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
@@ -16,6 +16,7 @@ Requires-Python: >=3.10
16
16
  Requires-Dist: click>=8.1.8
17
17
  Requires-Dist: httpx>=0.28.1
18
18
  Requires-Dist: opentelemetry-sdk>=1.32.1
19
+ Requires-Dist: pathlib>=1.0.1
19
20
  Requires-Dist: pydantic>=2.11.1
20
21
  Requires-Dist: pytest-asyncio>=0.25.3
21
22
  Requires-Dist: python-dotenv>=1.0.1
@@ -8,9 +8,9 @@ uipath/_cli/README.md,sha256=GLtCfbeIKZKNnGTCsfSVqRQ27V1btT1i2bSAyW_xZl4,474
8
8
  uipath/_cli/__init__.py,sha256=CAyMecQhBBD6s4MzYQNa01bz0TIXXCqkQ5DR2kCb00w,1574
9
9
  uipath/_cli/cli_auth.py,sha256=ANaYUc2q1t0hDbGBRT3ags6K6Lef_3tyC8Mmc611jow,3141
10
10
  uipath/_cli/cli_deploy.py,sha256=h8qwJkXnW6JURsg4YcocJInGA4dwkl4CZkpT1Cn9A3c,268
11
- uipath/_cli/cli_init.py,sha256=dPzwbfB0hJL5jRLxJJJ67DHI_i3b34_oepDHwqQN7Yw,3701
11
+ uipath/_cli/cli_init.py,sha256=idoqlGhhzXZKmLAg-3JgZ2fYMrK7qFXYV0EhnNaI3bg,3738
12
12
  uipath/_cli/cli_new.py,sha256=SP7eWOa5valmCpc8UsOCIezL25euhglB3yJkx-N92W8,1903
13
- uipath/_cli/cli_pack.py,sha256=pszhSGxb6DZtYeHymS6Pys7kewx1hFvKKYilfw7aUzE,12859
13
+ uipath/_cli/cli_pack.py,sha256=x7Je61NYzR7CR8TUoT-xeZMrXXFAsXO9PGFDUVfBU8s,12876
14
14
  uipath/_cli/cli_publish.py,sha256=_b9rehjsbxwkpH5_DtgFUaWWJqcZTg5nate-M5BnE_c,3586
15
15
  uipath/_cli/cli_run.py,sha256=dV0a-sx78T0HJHArfZP2M9YhT8d8aOuf-9OdkBqj3fE,4577
16
16
  uipath/_cli/middlewares.py,sha256=IiJgjsqrJVKSXx4RcIKHWoH-SqWqpHPbhzkQEybmAos,3937
@@ -36,18 +36,18 @@ uipath/_cli/_utils/_input_args.py,sha256=pyQhEcQXHdFHYTVNzvfWp439aii5StojoptnmCv
36
36
  uipath/_cli/_utils/_parse_ast.py,sha256=3XVjnhJNnSfjXlitct91VOtqSl0l-sqDpoWww28mMc0,20663
37
37
  uipath/_services/__init__.py,sha256=VPbwLDsvN26nWZgvR-8_-tc3i0rk5doqjTJbSrK0nN4,818
38
38
  uipath/_services/_base_service.py,sha256=3YClCoZBkVQGNJZGy-4NTk-HGsGA61XtwVQFYv9mwWk,7955
39
- uipath/_services/actions_service.py,sha256=muTw0jJ71pyLyrnzMZ-QIKjcmHEsLSzpd_UCLTAIrFM,14685
39
+ uipath/_services/actions_service.py,sha256=Dl0ppz4lLiTMAvaS44Qp20FBjRIZbL-58FlifYIoXI8,14986
40
40
  uipath/_services/api_client.py,sha256=1hYLc_90dQzCGnqqirEHpPqvL3Gkv2sSKoeOV_iTmlk,2903
41
- uipath/_services/assets_service.py,sha256=OdnhlHfEmwA0SQqkXO4XHl3bV26QLgIxj6sFycseZ0g,8647
42
- uipath/_services/buckets_service.py,sha256=JeSFoEOBeGi-i_aevaMAyu5gpauq1KC_JkANRTmyxEs,8655
43
- uipath/_services/connections_service.py,sha256=J_eKhMuBmiDKIhr5bA4_9g8xND185lh_MuBh2hmWMs4,6853
41
+ uipath/_services/assets_service.py,sha256=UUWzQiYruNAWk3P8qPrccDDWRUD_ycfqf3eRM-E9N44,9080
42
+ uipath/_services/buckets_service.py,sha256=h1Rx9H4XV2cxIZ1xIcYjNYFa1YZEHgIhQpQ10jZIinU,9154
43
+ uipath/_services/connections_service.py,sha256=5impJ5O0Wj2n0-RYnwI1TfOPAp5JStFwTjn_yCGySE8,7154
44
44
  uipath/_services/connections_service.pyi,sha256=6OOnh0aCfxhETL8n_JZ6Xoe2BE3ST_7Vz-FgLZc53lM,2465
45
- uipath/_services/context_grounding_service.py,sha256=eYxmkfBkLIxbMypBEzvyQ6_Jh7PF3OCrwzIe0PQXIs8,13372
46
- uipath/_services/folder_service.py,sha256=1BRTnfA-iMzAGZTJqTUtOXzNZLzbGCoWpH3g45YBEuQ,1556
47
- uipath/_services/jobs_service.py,sha256=iNs4hvr8Qyy_zbJjEkPK-0ygCM1l0OqpD1D_0PRgmf4,8126
48
- uipath/_services/llm_gateway_service.py,sha256=1YCgW2c0Hh3uXctUKPLcytAMJe4Qk_L8LLCd8Plgvvs,11695
49
- uipath/_services/processes_service.py,sha256=3A7EQrwY2fzKrnLk-MBowKnba4rmUAXIhtw1LlnU1yw,5510
50
- uipath/_services/queues_service.py,sha256=R9QMTIGeOa76uZJznbNXZ0PPAztah8JnSMjKsZkdNwU,12225
45
+ uipath/_services/context_grounding_service.py,sha256=reEMo9vMJLjo-gAsJH7wL7PMD5O1lK_0PYoLnKRRnug,14201
46
+ uipath/_services/folder_service.py,sha256=CBrEPjHFg6zAaNBbpcdrqaoPZWbgpTzWtAVz04J39mY,1630
47
+ uipath/_services/jobs_service.py,sha256=IpsqXo0QAjUK8AdA_pSMu2g9ncPccNxHh-yMF-Gy58I,8229
48
+ uipath/_services/llm_gateway_service.py,sha256=I1WcpIVWAMkkkY7uT_EU8Mqc_53LbRlo40GvSxNfiXg,12062
49
+ uipath/_services/processes_service.py,sha256=nzNlxJnTiM5NVtFxFX2WuWOxE0YrVb0WG6QE7f4Csg0,5679
50
+ uipath/_services/queues_service.py,sha256=yIDLxFEmVTt39ISSL2AaBJYq2hQH4CXxUP4Zc2MVTRI,13054
51
51
  uipath/_utils/__init__.py,sha256=y8asYKjU5j3v72TbgShEpUafAAJXJ6bngqdzXIl-Lhk,481
52
52
  uipath/_utils/_endpoint.py,sha256=yYHwqbQuJIevpaTkdfYJS9CrtlFeEyfb5JQK5osTCog,2489
53
53
  uipath/_utils/_infer_bindings.py,sha256=ysAftopcCBj4ojYyeVwbSl20qYhCDmqyldCinj6sICM,905
@@ -71,10 +71,10 @@ uipath/models/processes.py,sha256=Atvfrt6X4TYST3iA62jpS_Uxc3hg6uah11p-RaKZ6dk,20
71
71
  uipath/models/queues.py,sha256=N_s0GKucbyjh0RnO8SxPk6wlRgvq8KIIYsfaoIY46tM,6446
72
72
  uipath/tracing/__init__.py,sha256=mQEKHs47ufpy3MxphTJRh6AQsH90y6pWW80Nqbs0Q9c,157
73
73
  uipath/tracing/_otel_exporters.py,sha256=Fo10ofCWGd6PN5ndEsHkw6FZgQT5zOlob2XGnkiWvZE,2056
74
- uipath/tracing/_traced.py,sha256=HareJwZXD_z1EtaMrSDdK14AVH_sBmelIkG3hag6WaY,6271
74
+ uipath/tracing/_traced.py,sha256=9EUy7-OlBOApcKx4L8pwXCUJQQSl0Qh5IPvLGd27cS0,10913
75
75
  uipath/tracing/_utils.py,sha256=5SwsTGpHkIouXBndw-u8eCLnN4p7LM8DsTCCuf2jJgs,10165
76
- uipath-2.0.10.dist-info/METADATA,sha256=vUcBFQGPWH6AawCi2VEudyEzy2bsucbWu3ZuIJllwqM,6048
77
- uipath-2.0.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
78
- uipath-2.0.10.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
79
- uipath-2.0.10.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
80
- uipath-2.0.10.dist-info/RECORD,,
76
+ uipath-2.0.12.dist-info/METADATA,sha256=hzh4ODa7bKR-z6ee1CqMLOkzWGIXCAXm6TkEgI9r0JE,6078
77
+ uipath-2.0.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
78
+ uipath-2.0.12.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
79
+ uipath-2.0.12.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
80
+ uipath-2.0.12.dist-info/RECORD,,