uipath 2.1.121__py3-none-any.whl → 2.1.123__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/models/__init__.py CHANGED
@@ -2,7 +2,7 @@ from .action_schema import ActionSchema
2
2
  from .actions import Action
3
3
  from .assets import Asset, UserAsset
4
4
  from .attachment import Attachment
5
- from .buckets import Bucket
5
+ from .buckets import Bucket, BucketFile
6
6
  from .connections import Connection, ConnectionMetadata, ConnectionToken, EventArguments
7
7
  from .context_grounding import ContextGroundingQueryResponse
8
8
  from .context_grounding_index import ContextGroundingIndex
@@ -51,4 +51,5 @@ __all__ = [
51
51
  "BaseUrlMissingError",
52
52
  "SecretMissingError",
53
53
  "Bucket",
54
+ "BucketFile",
54
55
  ]
uipath/models/buckets.py CHANGED
@@ -1,6 +1,55 @@
1
1
  from typing import List, Optional
2
2
 
3
- from pydantic import BaseModel, ConfigDict, Field
3
+ from pydantic import AliasChoices, BaseModel, ConfigDict, Field
4
+
5
+
6
+ class BucketFile(BaseModel):
7
+ """Represents a file within a bucket.
8
+
9
+ Supports both ListFiles API (lowercase fields) and GetFiles API (PascalCase fields).
10
+ """
11
+
12
+ model_config = ConfigDict(
13
+ populate_by_name=True,
14
+ validate_by_alias=True,
15
+ extra="allow",
16
+ )
17
+
18
+ full_path: str = Field(
19
+ validation_alias=AliasChoices("fullPath", "FullPath"),
20
+ description="Full path within bucket",
21
+ )
22
+ content_type: Optional[str] = Field(
23
+ default=None,
24
+ validation_alias=AliasChoices("contentType", "ContentType"),
25
+ description="MIME type",
26
+ )
27
+ size: int = Field(
28
+ validation_alias=AliasChoices("size", "Size"),
29
+ description="File size in bytes",
30
+ )
31
+ last_modified: Optional[str] = Field(
32
+ default=None,
33
+ validation_alias=AliasChoices("lastModified", "LastModified"),
34
+ description="Last modification timestamp (ISO format)",
35
+ )
36
+ is_directory: bool = Field(
37
+ default=False,
38
+ validation_alias=AliasChoices("IsDirectory", "isDirectory"),
39
+ description="Whether this entry is a directory",
40
+ )
41
+
42
+ @property
43
+ def path(self) -> str:
44
+ """Alias for full_path for consistency."""
45
+ return self.full_path
46
+
47
+ @property
48
+ def name(self) -> str:
49
+ """Extract filename from full path."""
50
+ return (
51
+ self.full_path.split("/")[-1] if "/" in self.full_path else self.full_path
52
+ )
4
53
 
5
54
 
6
55
  class Bucket(BaseModel):
uipath/tracing/_traced.py CHANGED
@@ -7,7 +7,7 @@ from functools import wraps
7
7
  from typing import Any, Callable, List, Optional, Tuple
8
8
 
9
9
  from opentelemetry import context, trace
10
- from opentelemetry.trace import set_span_in_context
10
+ from opentelemetry.trace import NonRecordingSpan, set_span_in_context
11
11
 
12
12
  from ._utils import _SpanUtils
13
13
 
@@ -175,6 +175,7 @@ def _opentelemetry_traced(
175
175
  span_type: Optional[str] = None,
176
176
  input_processor: Optional[Callable[..., Any]] = None,
177
177
  output_processor: Optional[Callable[..., Any]] = None,
178
+ recording: bool = True,
178
179
  ):
179
180
  """Default tracer implementation using OpenTelemetry."""
180
181
 
@@ -184,7 +185,10 @@ def _opentelemetry_traced(
184
185
  def get_parent_context():
185
186
  """Return a context object for starting the new span."""
186
187
  current_span = _active_traced_span.get()
187
- if current_span is not None and current_span.get_span_context().is_valid:
188
+ if current_span is not None and (
189
+ current_span.get_span_context().is_valid
190
+ or isinstance(current_span, NonRecordingSpan)
191
+ ):
188
192
  return set_span_in_context(current_span)
189
193
 
190
194
  if TracingManager._current_span_provider is not None:
@@ -197,12 +201,22 @@ def _opentelemetry_traced(
197
201
 
198
202
  return context.get_current()
199
203
 
204
+ def get_span():
205
+ if recording and not isinstance(
206
+ _active_traced_span.get(), NonRecordingSpan
207
+ ):
208
+ ctx = get_parent_context()
209
+ span_cm = get_tracer().start_as_current_span(trace_name, context=ctx)
210
+ span = span_cm.__enter__()
211
+ else:
212
+ span_cm = None
213
+ span = NonRecordingSpan(trace.INVALID_SPAN_CONTEXT)
214
+ return span_cm, span
215
+
200
216
  # --------- Sync wrapper ---------
201
217
  @wraps(func)
202
218
  def sync_wrapper(*args, **kwargs):
203
- ctx = get_parent_context()
204
- span_cm = get_tracer().start_as_current_span(trace_name, context=ctx)
205
- span = span_cm.__enter__()
219
+ span_cm, span = get_span()
206
220
  token = _active_traced_span.set(span)
207
221
  try:
208
222
  span.set_attribute("span_type", span_type or "function_call_sync")
@@ -241,14 +255,13 @@ def _opentelemetry_traced(
241
255
  raise
242
256
  finally:
243
257
  _active_traced_span.reset(token)
244
- span_cm.__exit__(None, None, None)
258
+ if span_cm:
259
+ span_cm.__exit__(None, None, None)
245
260
 
246
261
  # --------- Async wrapper ---------
247
262
  @wraps(func)
248
263
  async def async_wrapper(*args, **kwargs):
249
- ctx = get_parent_context()
250
- span_cm = get_tracer().start_as_current_span(trace_name, context=ctx)
251
- span = span_cm.__enter__()
264
+ span_cm, span = get_span()
252
265
  token = _active_traced_span.set(span)
253
266
  try:
254
267
  span.set_attribute("span_type", span_type or "function_call_async")
@@ -287,14 +300,13 @@ def _opentelemetry_traced(
287
300
  raise
288
301
  finally:
289
302
  _active_traced_span.reset(token)
290
- span_cm.__exit__(None, None, None)
303
+ if span_cm:
304
+ span_cm.__exit__(None, None, None)
291
305
 
292
306
  # --------- Generator wrapper ---------
293
307
  @wraps(func)
294
308
  def generator_wrapper(*args, **kwargs):
295
- ctx = get_parent_context()
296
- span_cm = get_tracer().start_as_current_span(trace_name, context=ctx)
297
- span = span_cm.__enter__()
309
+ span_cm, span = get_span()
298
310
  token = _active_traced_span.set(span)
299
311
  try:
300
312
  span.set_attribute(
@@ -330,14 +342,13 @@ def _opentelemetry_traced(
330
342
  raise
331
343
  finally:
332
344
  _active_traced_span.reset(token)
333
- span_cm.__exit__(None, None, None)
345
+ if span_cm:
346
+ span_cm.__exit__(None, None, None)
334
347
 
335
348
  # --------- Async generator wrapper ---------
336
349
  @wraps(func)
337
350
  async def async_generator_wrapper(*args, **kwargs):
338
- ctx = get_parent_context()
339
- span_cm = get_tracer().start_as_current_span(trace_name, context=ctx)
340
- span = span_cm.__enter__()
351
+ span_cm, span = get_span()
341
352
  token = _active_traced_span.set(span)
342
353
  try:
343
354
  span.set_attribute(
@@ -373,7 +384,8 @@ def _opentelemetry_traced(
373
384
  raise
374
385
  finally:
375
386
  _active_traced_span.reset(token)
376
- span_cm.__exit__(None, None, None)
387
+ if span_cm:
388
+ span_cm.__exit__(None, None, None)
377
389
 
378
390
  if inspect.iscoroutinefunction(func):
379
391
  return async_wrapper
@@ -425,6 +437,7 @@ def traced(
425
437
  output_processor: Optional[Callable[..., Any]] = None,
426
438
  hide_input: bool = False,
427
439
  hide_output: bool = False,
440
+ recording: bool = True,
428
441
  ):
429
442
  """Decorator that will trace function invocations.
430
443
 
@@ -437,6 +450,7 @@ def traced(
437
450
  Should accept the function output and return a processed value
438
451
  hide_input: If True, don't log any input data
439
452
  hide_output: If True, don't log any output data
453
+ recording: If False, current span and all child spans are not captured regardless of their recording status.
440
454
  """
441
455
  # Apply default processors selectively based on hide flags
442
456
  if hide_input:
@@ -451,6 +465,7 @@ def traced(
451
465
  "span_type": span_type,
452
466
  "input_processor": input_processor,
453
467
  "output_processor": output_processor,
468
+ "recording": recording,
454
469
  }
455
470
 
456
471
  # Check for custom implementation first
uipath/tracing/_utils.py CHANGED
@@ -364,34 +364,12 @@ class _SpanUtils:
364
364
  )
365
365
  return {"args": args, "kwargs": kwargs}
366
366
 
367
- @staticmethod
368
- def _has_ancestor_with_name(
369
- span: ReadableSpan, ancestor_name: str, span_map: Dict[int, ReadableSpan]
370
- ) -> bool:
371
- """Check if this span or any of its ancestors has a given name."""
372
- if span.name == ancestor_name:
373
- return True
374
-
375
- current = span
376
- while current.parent is not None:
377
- parent_span = span_map.get(current.parent.span_id)
378
- if parent_span is None:
379
- break
380
- if parent_span.name == ancestor_name:
381
- return True
382
- current = parent_span
383
-
384
- return False
385
-
386
367
  @staticmethod
387
368
  def spans_to_llm_context(spans: list[ReadableSpan]) -> str:
388
369
  """Convert spans to a formatted conversation history string suitable for LLM context.
389
370
 
390
371
  Includes function calls (including LLM calls) with their inputs and outputs.
391
372
  """
392
- # Build span_id -> span map for parent chain traversal
393
- span_map = {span.get_span_context().span_id: span for span in spans}
394
-
395
373
  history = []
396
374
  for span in spans:
397
375
  attributes = dict(span.attributes) if span.attributes else {}
@@ -402,10 +380,6 @@ class _SpanUtils:
402
380
  if not input_value or not output_value:
403
381
  continue
404
382
 
405
- # Skip spans that are internal LLM calls (eg. for tool mocking in evals)
406
- if _SpanUtils._has_ancestor_with_name(span, "__mocker__", span_map):
407
- continue
408
-
409
383
  history.append(f"Function: {span.name}")
410
384
  history.append(f"Input: {input_value}")
411
385
  history.append(f"Output: {output_value}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath
3
- Version: 2.1.121
3
+ Version: 2.1.123
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
@@ -65,15 +65,15 @@ uipath/_cli/_evals/_models/_mocks.py,sha256=mlD9qvdZNniuKxzY_ttJtwLVFvKGvvIukYvy
65
65
  uipath/_cli/_evals/_models/_output.py,sha256=ZQiRCqFZWUsPrJ96E_xQlup6xUlz0lmbJQdsy9WUqoU,7450
66
66
  uipath/_cli/_evals/_models/_sw_reporting.py,sha256=tSBLQFAdOIun8eP0vsqt56K6bmCZz_uMaWI3hskg_24,536
67
67
  uipath/_cli/_evals/mocks/__init__.py,sha256=2WXwAy_oZw5bKp6L0HB13QygCJeftOB_Bget0AI6Gik,32
68
- uipath/_cli/_evals/mocks/input_mocker.py,sha256=DtI5mqLKlg_QAvoPXUUbsLX5ptvPaA8MM8v7CPOWd_M,4450
69
- uipath/_cli/_evals/mocks/llm_mocker.py,sha256=p9TSl2awjgVorlJcghynFhhHNl-KsLaPPvsKSwFZVt8,7523
68
+ uipath/_cli/_evals/mocks/input_mocker.py,sha256=HLRslDhDpRdOsU9qn0mUqh25z0yRMW_SeOjnSXNJPmU,4467
69
+ uipath/_cli/_evals/mocks/llm_mocker.py,sha256=zI23M808apdDk_qFz4UJO3Owjwxaz9Z6Wf014FISxtk,7540
70
70
  uipath/_cli/_evals/mocks/mocker.py,sha256=VXCxuRAPqUK40kRUXpPmXZRckd7GrOY5ZzIYDe-NNfo,910
71
71
  uipath/_cli/_evals/mocks/mocker_factory.py,sha256=A8XzDhJRKddUrGWmtp2FABd6d86VFdzAl0rG4_OD5ss,817
72
72
  uipath/_cli/_evals/mocks/mockito_mocker.py,sha256=opwfELnvuh3krnPAg0MupkHTEmhCpQFhDVHLH-BH3BY,2683
73
73
  uipath/_cli/_evals/mocks/mocks.py,sha256=IrvhtTtIuU5geopvCRglNhxKoOcChnnjQZMoYygx0PU,2225
74
74
  uipath/_cli/_push/models.py,sha256=K3k6QUMkiNIb3M4U0EgDlKz1UELxeMXLNVAj3qyhZ4U,470
75
75
  uipath/_cli/_push/sw_file_handler.py,sha256=ivHj0qzCvEP45M3x-Oi2edO5I-uhyHzgnidDF3JRoTk,36192
76
- uipath/_cli/_runtime/_contracts.py,sha256=d39hBwydFxMlF5VJSa4Fj_ZIWqr2iVUlHLTupBDrNZQ,36296
76
+ uipath/_cli/_runtime/_contracts.py,sha256=sVHUww13iFsB7tDkbmD4ki41xd6nbAoJkoc9BLiXEh8,36352
77
77
  uipath/_cli/_runtime/_escalation.py,sha256=x3vI98qsfRA-fL_tNkRVTFXioM5Gv2w0GFcXJJ5eQtg,7981
78
78
  uipath/_cli/_runtime/_hitl.py,sha256=JAwTUKvxO4HpnZMwE4E0AegAPw_uYOwgt0OYcu6EvTg,11474
79
79
  uipath/_cli/_runtime/_logging.py,sha256=srjAi3Cy6g7b8WNHiYNjaZT4t40F3XRqquuoGd2kh4Y,14019
@@ -116,7 +116,7 @@ uipath/_services/actions_service.py,sha256=2RPMR-hFMsOlqEyjIf3aF7-lrf57jdrSD0pBj
116
116
  uipath/_services/api_client.py,sha256=kGm04ijk9AOEQd2BMxvQg-2QoB8dmyoDwFFDPyutAGw,1966
117
117
  uipath/_services/assets_service.py,sha256=pG0Io--SeiRRQmfUWPQPl1vq3csZlQgx30LBNKRmmF8,12145
118
118
  uipath/_services/attachments_service.py,sha256=NPQYK7CGjfBaNT_1S5vEAfODmOChTbQZforllFM2ofU,26678
119
- uipath/_services/buckets_service.py,sha256=5s8tuivd7GUZYj774DDUYTa0axxlUuesc4EBY1V5sdk,18496
119
+ uipath/_services/buckets_service.py,sha256=FGWhJ3ewMEAahcSPY60wtFB0_qwAfaQAaAjqrC52VDk,44603
120
120
  uipath/_services/connections_service.py,sha256=tKJHHOKQYKR6LkgB-V_2d0vFpLEdFeMzwj_xmBVHUDw,18416
121
121
  uipath/_services/context_grounding_service.py,sha256=Pjx-QQQEiSKD-hY6ityj3QUSALN3fIcKLLHr_NZ0d_g,37117
122
122
  uipath/_services/documents_service.py,sha256=2mPZzmOl2r5i8RYvdeRSJtEFWSSsiXqIauTgNTW75s4,45341
@@ -195,13 +195,13 @@ uipath/eval/mocks/mockable.py,sha256=FJEE4iz6nchowGhoGR3FgF9VvymHnWJkUyakKOK4fIg
195
195
  uipath/eval/models/__init__.py,sha256=-V610Bw4daQQ2CwNUGwsEW5n56b_G2mMZY4vaChV2r4,716
196
196
  uipath/eval/models/llm_judge_types.py,sha256=_kPnyAoWyV_Idx-lAgAbHGq4akQRh-eDC2PCYG6T0Zc,9620
197
197
  uipath/eval/models/models.py,sha256=q-g-UDovrkNtA9jQxvAWvQRXG511ZQEVOm9mjTNBeVk,9746
198
- uipath/models/__init__.py,sha256=au-Bhk7w4Jl8Jn-_a1Ae30RX9N6eQJJ0-bd-QSbRiuU,1335
198
+ uipath/models/__init__.py,sha256=8ZIx9XTjDoPYrnuxxgEfFMaldfcoHfMAt7YZ_LP4_d4,1365
199
199
  uipath/models/action_schema.py,sha256=tBn1qQ3NQLU5nwWlBIzIKIx3XK5pO_D1S51IjFlZ1FA,610
200
200
  uipath/models/actions.py,sha256=1vRsJ3JSmMdPkbiYAiHzY8K44vmW3VlMsmQUBAkSgrQ,3141
201
201
  uipath/models/assets.py,sha256=7x3swJRnG_a4VgjdXKKwraJLT5TF0u4wHsl6coOjX0g,2762
202
202
  uipath/models/attachment.py,sha256=lI6BxBY6DY5U6qZbxhkNu-usseA1zovYSTRtLq50ubI,1029
203
203
  uipath/models/auth.py,sha256=-CEo5KZVtZZgbAMatN6B1vBmGp8lTTumR8sMthRmL8I,345
204
- uipath/models/buckets.py,sha256=N3Lj_dVCv709-ywhOOdyCSvsuLn41eGuAfSiik6Q6F8,1285
204
+ uipath/models/buckets.py,sha256=7uDonM5ddfhunP6Vn24kEa-iW_ZluJU4SaWEqB2dWu8,2754
205
205
  uipath/models/connections.py,sha256=jmzlfnddqlxjmiVhqsETRV6TQPH3fFqJGsygG0gUf7g,2745
206
206
  uipath/models/context_grounding.py,sha256=3MaF2Fv2QYle8UUWvKGkCN5XGpx2T4a34fdbBqJ2fCs,1137
207
207
  uipath/models/context_grounding_index.py,sha256=OhRyxZDHDSrEmBFK0-JLqMMMT64jir4XkHtQ54IKtc0,2683
@@ -220,13 +220,13 @@ uipath/telemetry/_constants.py,sha256=uRDuEZayBYtBA0tMx-2AS_D-oiVA7oKgp9zid9jNat
220
220
  uipath/telemetry/_track.py,sha256=3RZgJtY8y28Y5rfVmC432OyRu7N3pSxPouwa82KWFso,4787
221
221
  uipath/tracing/__init__.py,sha256=0oUuxJKOHE14iOL4SP93FOiEYRIFLTq-o0NwRcTB8Q4,317
222
222
  uipath/tracing/_otel_exporters.py,sha256=68wuAZyB_PScnSCW230PVs3qSqoJBNoArJJaE4UebNA,13956
223
- uipath/tracing/_traced.py,sha256=yBIY05PCCrYyx50EIHZnwJaKNdHPNx-YTR1sHQl0a98,19901
224
- uipath/tracing/_utils.py,sha256=59XSCaH4Te9Jo3cqY8Wb2cNu9gPfVm8AMMSAg2OTXWo,16018
223
+ uipath/tracing/_traced.py,sha256=VAwEIfDHLx-AZ792SeGxCtOttEJXrLgI0YCkUMbxHsQ,20344
224
+ uipath/tracing/_utils.py,sha256=emsQRgYu-P1gj1q7XUPJD94mOa12JvhheRkuZJpLd9Y,15051
225
225
  uipath/utils/__init__.py,sha256=VD-KXFpF_oWexFg6zyiWMkxl2HM4hYJMIUDZ1UEtGx0,105
226
226
  uipath/utils/_endpoints_manager.py,sha256=tnF_FiCx8qI2XaJDQgYkMN_gl9V0VqNR1uX7iawuLp8,8230
227
227
  uipath/utils/dynamic_schema.py,sha256=w0u_54MoeIAB-mf3GmwX1A_X8_HDrRy6p998PvX9evY,3839
228
- uipath-2.1.121.dist-info/METADATA,sha256=5MIPaAAsfFBU2ncAQrZJFW0QpfhYRAKV3JLNEHM0X6w,6626
229
- uipath-2.1.121.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
230
- uipath-2.1.121.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
231
- uipath-2.1.121.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
232
- uipath-2.1.121.dist-info/RECORD,,
228
+ uipath-2.1.123.dist-info/METADATA,sha256=jnVXMo218T9D5w0meGX_NYFtoA7R64pfTpIg6UKypHo,6626
229
+ uipath-2.1.123.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
230
+ uipath-2.1.123.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
231
+ uipath-2.1.123.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
232
+ uipath-2.1.123.dist-info/RECORD,,