uipath 2.0.38__py3-none-any.whl → 2.0.40__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_invoke.py CHANGED
@@ -43,8 +43,23 @@ def _read_project_name() -> str:
43
43
  @click.command()
44
44
  @click.argument("entrypoint", required=False)
45
45
  @click.argument("input", required=False, default="{}")
46
- def invoke(entrypoint: Optional[str], input: Optional[str]) -> None:
46
+ @click.option(
47
+ "-f",
48
+ "--file",
49
+ required=False,
50
+ type=click.Path(exists=True),
51
+ help="File path for the .json input",
52
+ )
53
+ def invoke(
54
+ entrypoint: Optional[str], input: Optional[str], file: Optional[str]
55
+ ) -> None:
47
56
  """Invoke an agent published in my workspace."""
57
+ if file:
58
+ _, file_extension = os.path.splitext(file)
59
+ if file_extension != ".json":
60
+ console.error("Input file extension must be '.json'.")
61
+ with open(file) as f:
62
+ input = f.read()
48
63
  with console.spinner("Loading configuration ..."):
49
64
  current_path = os.getcwd()
50
65
  load_dotenv(os.path.join(current_path, ".env"), override=True)
@@ -1,5 +1,5 @@
1
1
  import json
2
- from typing import Any, Dict, List, Optional
2
+ from typing import Any, List, Optional
3
3
 
4
4
  from pydantic import TypeAdapter
5
5
 
@@ -8,8 +8,6 @@ from .._execution_context import ExecutionContext
8
8
  from .._folder_context import FolderContext
9
9
  from .._utils import Endpoint, RequestSpec, header_folder
10
10
  from .._utils.constants import (
11
- HEADER_FOLDER_KEY,
12
- HEADER_FOLDER_PATH,
13
11
  ORCHESTRATOR_STORAGE_BUCKET_DATA_SOURCE,
14
12
  )
15
13
  from ..models import IngestionInProgressException
@@ -440,36 +438,19 @@ class ContextGroundingService(FolderContext, BaseService):
440
438
  headers=spec.headers,
441
439
  )
442
440
 
443
- @property
444
- def custom_headers(self) -> Dict[str, str]:
445
- self._folder_key = self._folder_key or (
446
- self._folders_service.retrieve_key_by_folder_path(self._folder_path)
447
- if self._folder_path
448
- else None
449
- )
450
-
451
- if self._folder_key is None:
452
- raise ValueError(
453
- f"Neither the folder key nor the folder path is set ({HEADER_FOLDER_KEY}, {HEADER_FOLDER_PATH})"
454
- )
455
-
456
- return self.folder_headers
457
-
458
441
  def _ingest_spec(
459
442
  self,
460
443
  key: str,
461
444
  folder_key: Optional[str] = None,
462
445
  folder_path: Optional[str] = None,
463
446
  ) -> RequestSpec:
464
- if folder_key is None and folder_path is not None:
465
- folder_key = self._folders_service.retrieve_key_by_folder_path(folder_path)
466
- folder_path = None
447
+ folder_key = self._resolve_folder_key(folder_key, folder_path)
467
448
 
468
449
  return RequestSpec(
469
450
  method="POST",
470
451
  endpoint=Endpoint(f"/ecs_/v2/indexes/{key}/ingest"),
471
452
  headers={
472
- **header_folder(folder_key, folder_path),
453
+ **header_folder(folder_key, None),
473
454
  },
474
455
  )
475
456
 
@@ -479,17 +460,14 @@ class ContextGroundingService(FolderContext, BaseService):
479
460
  folder_key: Optional[str] = None,
480
461
  folder_path: Optional[str] = None,
481
462
  ) -> RequestSpec:
482
- print(folder_key, folder_path)
483
- if folder_key is None and folder_path is not None:
484
- folder_key = self._folders_service.retrieve_key_by_folder_path(folder_path)
485
- folder_path = None
486
- print("~~~", name, folder_key, folder_path)
463
+ folder_key = self._resolve_folder_key(folder_key, folder_path)
464
+
487
465
  return RequestSpec(
488
466
  method="GET",
489
467
  endpoint=Endpoint("/ecs_/v2/indexes"),
490
468
  params={"$filter": f"Name eq '{name}'"},
491
469
  headers={
492
- **header_folder(folder_key, folder_path),
470
+ **header_folder(folder_key, None),
493
471
  },
494
472
  )
495
473
 
@@ -503,9 +481,7 @@ class ContextGroundingService(FolderContext, BaseService):
503
481
  folder_key: Optional[str] = None,
504
482
  folder_path: Optional[str] = None,
505
483
  ) -> RequestSpec:
506
- if folder_key is None and folder_path is not None:
507
- folder_key = self._folders_service.retrieve_key_by_folder_path(folder_path)
508
- folder_path = None
484
+ folder_key = self._resolve_folder_key(folder_key, folder_path)
509
485
 
510
486
  storage_bucket_folder_path = (
511
487
  storage_bucket_folder_path
@@ -531,7 +507,7 @@ class ContextGroundingService(FolderContext, BaseService):
531
507
  }
532
508
  ),
533
509
  headers={
534
- **header_folder(folder_key, folder_path),
510
+ **header_folder(folder_key, None),
535
511
  },
536
512
  )
537
513
 
@@ -541,15 +517,13 @@ class ContextGroundingService(FolderContext, BaseService):
541
517
  folder_key: Optional[str] = None,
542
518
  folder_path: Optional[str] = None,
543
519
  ) -> RequestSpec:
544
- if folder_key is None and folder_path is not None:
545
- folder_key = self._folders_service.retrieve_key_by_folder_path(folder_path)
546
- folder_path = None
520
+ folder_key = self._resolve_folder_key(folder_key, folder_path)
547
521
 
548
522
  return RequestSpec(
549
523
  method="GET",
550
524
  endpoint=Endpoint(f"/ecs_/v2/indexes/{id}"),
551
525
  headers={
552
- **header_folder(folder_key, folder_path),
526
+ **header_folder(folder_key, None),
553
527
  },
554
528
  )
555
529
 
@@ -559,15 +533,13 @@ class ContextGroundingService(FolderContext, BaseService):
559
533
  folder_key: Optional[str] = None,
560
534
  folder_path: Optional[str] = None,
561
535
  ) -> RequestSpec:
562
- if folder_key is None and folder_path is not None:
563
- folder_key = self._folders_service.retrieve_key_by_folder_path(folder_path)
564
- folder_path = None
536
+ folder_key = self._resolve_folder_key(folder_key, folder_path)
565
537
 
566
538
  return RequestSpec(
567
539
  method="DELETE",
568
540
  endpoint=Endpoint(f"/ecs_/v2/indexes/{id}"),
569
541
  headers={
570
- **header_folder(folder_key, folder_path),
542
+ **header_folder(folder_key, None),
571
543
  },
572
544
  )
573
545
 
@@ -579,9 +551,7 @@ class ContextGroundingService(FolderContext, BaseService):
579
551
  folder_key: Optional[str] = None,
580
552
  folder_path: Optional[str] = None,
581
553
  ) -> RequestSpec:
582
- if folder_key is None and folder_path is not None:
583
- folder_key = self._folders_service.retrieve_key_by_folder_path(folder_path)
584
- folder_path = None
554
+ folder_key = self._resolve_folder_key(folder_key, folder_path)
585
555
 
586
556
  return RequestSpec(
587
557
  method="POST",
@@ -593,6 +563,22 @@ class ContextGroundingService(FolderContext, BaseService):
593
563
  }
594
564
  ),
595
565
  headers={
596
- **header_folder(folder_key, folder_path),
566
+ **header_folder(folder_key, None),
597
567
  },
598
568
  )
569
+
570
+ def _resolve_folder_key(self, folder_key, folder_path):
571
+ if folder_key is None and folder_path is not None:
572
+ folder_key = self._folders_service.retrieve_key_by_folder_path(folder_path)
573
+
574
+ if folder_key is None and folder_path is None:
575
+ folder_key = self._folder_key or (
576
+ self._folders_service.retrieve_key_by_folder_path(self._folder_path)
577
+ if self._folder_path
578
+ else None
579
+ )
580
+
581
+ if folder_key is None:
582
+ raise ValueError("Folder key or folder path is required")
583
+
584
+ return folder_key
uipath/models/__init__.py CHANGED
@@ -3,6 +3,7 @@ from .actions import Action
3
3
  from .assets import UserAsset
4
4
  from .connections import Connection, ConnectionToken
5
5
  from .context_grounding import ContextGroundingQueryResponse
6
+ from .context_grounding_index import ContextGroundingIndex
6
7
  from .errors import BaseUrlMissingError, SecretMissingError
7
8
  from .exceptions import IngestionInProgressException
8
9
  from .interrupt_models import (
@@ -25,6 +26,7 @@ __all__ = [
25
26
  "Action",
26
27
  "UserAsset",
27
28
  "ContextGroundingQueryResponse",
29
+ "ContextGroundingIndex",
28
30
  "Process",
29
31
  "QueueItem",
30
32
  "CommitType",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath
3
- Version: 2.0.38
3
+ Version: 2.0.40
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
@@ -9,7 +9,7 @@ uipath/_cli/__init__.py,sha256=vGz3vJHkUvgK9_lKdzqiwwHkge1TCALRiOzGGwyr-8E,1885
9
9
  uipath/_cli/cli_auth.py,sha256=O-hbaYxLXBPXgnjW2gGa1lbvmVh1ui2-U9BzrLUU708,3707
10
10
  uipath/_cli/cli_deploy.py,sha256=lDqZQOsTPe8UyUApSQyFDMChj5HR6_hrEbn5tXtbHQE,608
11
11
  uipath/_cli/cli_init.py,sha256=qleaHOuXZyqQ001XXFX3m8W2y3pW-miwuvMBl6rHCa4,3699
12
- uipath/_cli/cli_invoke.py,sha256=OjsiwVq6g_Ah2E2Iv1OWmFR-Cpvf8-0YmsHXL8rfphg,3278
12
+ uipath/_cli/cli_invoke.py,sha256=YsVfN7COiE_huLPXqsMnUmno1-l2oAHgnMIWqHlR_oE,3670
13
13
  uipath/_cli/cli_new.py,sha256=6lLK_p7kRFQPgsc2i9t1v0Su4O1rC7zK55ic3y54QR8,2065
14
14
  uipath/_cli/cli_pack.py,sha256=FZr7P5WZvPkrP56fjn4dTONv76NuoEhVtQwzG3CxGQs,14667
15
15
  uipath/_cli/cli_publish.py,sha256=ozastFqfKZVZIKZLvRTXJq0ZXm4p-ZEVgwc5MeccisI,5716
@@ -47,7 +47,7 @@ uipath/_services/assets_service.py,sha256=4TsHd_b3VQZlN195ecrCHbQcaNew0GWEk90SFh
47
47
  uipath/_services/buckets_service.py,sha256=m0HMWBkooUhjTtna_ZXcw4QOzKmaibuepWlC8wPGtlA,9330
48
48
  uipath/_services/connections_service.py,sha256=bE-t-YS_C67bcyEA9xNwKqv5b0dN7qh0McZdGETcEAQ,7338
49
49
  uipath/_services/connections_service.pyi,sha256=6OOnh0aCfxhETL8n_JZ6Xoe2BE3ST_7Vz-FgLZc53lM,2465
50
- uipath/_services/context_grounding_service.py,sha256=nZDntNcpPNHcEfgw-Aq-9t2YpVx1uPTphBnVwnztM6E,19287
50
+ uipath/_services/context_grounding_service.py,sha256=eRBe5a3uubFCYVHwt6KWCYNW8MMjID5ri_uHefIt1KY,18573
51
51
  uipath/_services/folder_service.py,sha256=HtsBoBejvMuIZ-9gocAG9B8uKOFsAAD4WUozta-isXk,1673
52
52
  uipath/_services/jobs_service.py,sha256=MsJlu1egvHKZhHdammp4Xo9iJzceWquW4qIWT-nPBws,8214
53
53
  uipath/_services/llm_gateway_service.py,sha256=ySg3sflIoXmY9K7txlSm7bkuI2qzBT0kAKmGlFBk5KA,12032
@@ -61,7 +61,7 @@ uipath/_utils/_request_override.py,sha256=_vibG78vEDWS3JKg2cJ5l6tpoBMLChUOauiqL1
61
61
  uipath/_utils/_request_spec.py,sha256=iCtBLqtbWUpFG5g1wtIZBzSupKsfaRLiQFoFc_4B70Q,747
62
62
  uipath/_utils/_user_agent.py,sha256=pVJkFYacGwaQBomfwWVAvBQgdBUo62e4n3-fLIajWUU,563
63
63
  uipath/_utils/constants.py,sha256=xW-gbRasjdOwSj2rke4wfRCml69710oUaDNJcwFAZug,775
64
- uipath/models/__init__.py,sha256=U06ilfGlAR0Rflkuq608sR__hsyMN5KI_OsAFQf1qCs,1048
64
+ uipath/models/__init__.py,sha256=dh4UA1Cm9_-VDVwfRqa_SPRy3-FPnsVX7X_Uxh1tFts,1136
65
65
  uipath/models/action_schema.py,sha256=lKDhP7Eix23fFvfQrqqNmSOiPyyNF6tiRpUu0VZIn_M,714
66
66
  uipath/models/actions.py,sha256=ekSH4YUQR4KPOH-heBm9yOgOfirndx0In4_S4VYWeEU,2993
67
67
  uipath/models/assets.py,sha256=8ZPImmJ-1u5KqdR1UBgZnGjSBW-Nr81Ruq_5Uav417A,1841
@@ -79,8 +79,8 @@ uipath/tracing/__init__.py,sha256=GimSzv6qkCOlHOG1WtjYKJsZqcXpA28IgoXfR33JhiA,13
79
79
  uipath/tracing/_otel_exporters.py,sha256=x0PDPmDKJcxashsuehVsSsqBCzRr6WsNFaq_3_HS5F0,3014
80
80
  uipath/tracing/_traced.py,sha256=GFxOp73jk0vGTN_H7YZOOsEl9rVLaEhXGztMiYKIA-8,16634
81
81
  uipath/tracing/_utils.py,sha256=5SwsTGpHkIouXBndw-u8eCLnN4p7LM8DsTCCuf2jJgs,10165
82
- uipath-2.0.38.dist-info/METADATA,sha256=P92Y2LVaLqQYW8Ocik9dwhaVe21YOozxOkIYCJEphu4,6254
83
- uipath-2.0.38.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
84
- uipath-2.0.38.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
85
- uipath-2.0.38.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
86
- uipath-2.0.38.dist-info/RECORD,,
82
+ uipath-2.0.40.dist-info/METADATA,sha256=lzQ5m9oN0aWLZFLw5U_FLUTmKThpnDEySj6axOTky2A,6254
83
+ uipath-2.0.40.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
84
+ uipath-2.0.40.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
85
+ uipath-2.0.40.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
86
+ uipath-2.0.40.dist-info/RECORD,,