uipath 2.0.5__tar.gz → 2.0.7__tar.gz

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.

Files changed (117) hide show
  1. {uipath-2.0.5 → uipath-2.0.7}/.github/workflows/build.yml +2 -0
  2. {uipath-2.0.5 → uipath-2.0.7}/PKG-INFO +2 -2
  3. {uipath-2.0.5 → uipath-2.0.7}/README.md +1 -1
  4. uipath-2.0.7/docs/getting_started_agent.md +29 -0
  5. uipath-2.0.5/docs/getting_started.md → uipath-2.0.7/docs/getting_started_cli.md +0 -81
  6. uipath-2.0.7/docs/getting_started_cloud.md +3 -0
  7. uipath-2.0.7/docs/getting_started_sdk.md +83 -0
  8. uipath-2.0.7/docs/index.md +4 -0
  9. {uipath-2.0.5 → uipath-2.0.7}/mkdocs.yml +9 -4
  10. {uipath-2.0.5 → uipath-2.0.7}/pyproject.toml +1 -1
  11. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_folder_context.py +3 -8
  12. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_services/actions_service.py +97 -28
  13. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_services/context_grounding_service.py +4 -1
  14. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/models/interrupt_models.py +5 -3
  15. {uipath-2.0.5 → uipath-2.0.7}/uv.lock +1 -1
  16. {uipath-2.0.5 → uipath-2.0.7}/.cursorrules +0 -0
  17. {uipath-2.0.5 → uipath-2.0.7}/.editorconfig +0 -0
  18. {uipath-2.0.5 → uipath-2.0.7}/.gitattributes +0 -0
  19. {uipath-2.0.5 → uipath-2.0.7}/.github/workflows/cd.yml +0 -0
  20. {uipath-2.0.5 → uipath-2.0.7}/.github/workflows/ci.yml +0 -0
  21. {uipath-2.0.5 → uipath-2.0.7}/.github/workflows/commitlint.yml +0 -0
  22. {uipath-2.0.5 → uipath-2.0.7}/.github/workflows/lint.yml +0 -0
  23. {uipath-2.0.5 → uipath-2.0.7}/.github/workflows/test.yml +0 -0
  24. {uipath-2.0.5 → uipath-2.0.7}/.gitignore +0 -0
  25. {uipath-2.0.5 → uipath-2.0.7}/.pre-commit-config.yaml +0 -0
  26. {uipath-2.0.5 → uipath-2.0.7}/.python-version +0 -0
  27. {uipath-2.0.5 → uipath-2.0.7}/.vscode/extensions.json +0 -0
  28. {uipath-2.0.5 → uipath-2.0.7}/.vscode/settings.json +0 -0
  29. {uipath-2.0.5 → uipath-2.0.7}/CONTRIBUTING.md +0 -0
  30. {uipath-2.0.5 → uipath-2.0.7}/LICENSE +0 -0
  31. /uipath-2.0.5/docs/how_to_contribute.md → /uipath-2.0.7/docs/CONTRIBUTING.md +0 -0
  32. {uipath-2.0.5 → uipath-2.0.7}/docs/actions.md +0 -0
  33. {uipath-2.0.5 → uipath-2.0.7}/docs/assets/uipath-logo.svg +0 -0
  34. {uipath-2.0.5 → uipath-2.0.7}/docs/assets.md +0 -0
  35. {uipath-2.0.5 → uipath-2.0.7}/docs/buckets.md +0 -0
  36. {uipath-2.0.5 → uipath-2.0.7}/docs/connections.md +0 -0
  37. {uipath-2.0.5 → uipath-2.0.7}/docs/context_grounding.md +0 -0
  38. {uipath-2.0.5 → uipath-2.0.7}/docs/jobs.md +0 -0
  39. {uipath-2.0.5 → uipath-2.0.7}/docs/processes.md +0 -0
  40. {uipath-2.0.5 → uipath-2.0.7}/docs/queues.md +0 -0
  41. /uipath-2.0.5/docs/index.md → /uipath-2.0.7/docs/sdk.md +0 -0
  42. {uipath-2.0.5 → uipath-2.0.7}/justfile +0 -0
  43. {uipath-2.0.5 → uipath-2.0.7}/py.typed +0 -0
  44. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/__init__.py +0 -0
  45. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/README.md +0 -0
  46. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/__init__.py +0 -0
  47. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/_auth/_auth_server.py +0 -0
  48. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/_auth/_models.py +0 -0
  49. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/_auth/_oidc_utils.py +0 -0
  50. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/_auth/_portal_service.py +0 -0
  51. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/_auth/_utils.py +0 -0
  52. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/_auth/auth_config.json +0 -0
  53. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/_auth/index.html +0 -0
  54. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/_auth/localhost.crt +0 -0
  55. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/_auth/localhost.key +0 -0
  56. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/_runtime/_contracts.py +0 -0
  57. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/_runtime/_logging.py +0 -0
  58. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/_runtime/_runtime.py +0 -0
  59. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/_templates/.psmdcp.template +0 -0
  60. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/_templates/.rels.template +0 -0
  61. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/_templates/[Content_Types].xml.template +0 -0
  62. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/_templates/main.py.template +0 -0
  63. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/_templates/package.nuspec.template +0 -0
  64. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/_utils/_common.py +0 -0
  65. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/_utils/_input_args.py +0 -0
  66. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/_utils/_parse_ast.py +0 -0
  67. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/cli_auth.py +0 -0
  68. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/cli_deploy.py +0 -0
  69. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/cli_init.py +0 -0
  70. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/cli_new.py +0 -0
  71. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/cli_pack.py +0 -0
  72. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/cli_publish.py +0 -0
  73. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/cli_run.py +0 -0
  74. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_cli/middlewares.py +0 -0
  75. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_config.py +0 -0
  76. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_execution_context.py +0 -0
  77. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_services/__init__.py +0 -0
  78. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_services/_base_service.py +0 -0
  79. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_services/api_client.py +0 -0
  80. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_services/assets_service.py +0 -0
  81. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_services/buckets_service.py +0 -0
  82. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_services/connections_service.py +0 -0
  83. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_services/connections_service.pyi +0 -0
  84. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_services/folder_service.py +0 -0
  85. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_services/jobs_service.py +0 -0
  86. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_services/llm_gateway_service.py +0 -0
  87. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_services/processes_service.py +0 -0
  88. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_services/queues_service.py +0 -0
  89. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_uipath.py +0 -0
  90. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_utils/__init__.py +0 -0
  91. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_utils/_endpoint.py +0 -0
  92. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_utils/_infer_bindings.py +0 -0
  93. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_utils/_logs.py +0 -0
  94. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_utils/_request_override.py +0 -0
  95. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_utils/_request_spec.py +0 -0
  96. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_utils/_user_agent.py +0 -0
  97. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/_utils/constants.py +0 -0
  98. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/models/__init__.py +0 -0
  99. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/models/action_schema.py +0 -0
  100. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/models/actions.py +0 -0
  101. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/models/assets.py +0 -0
  102. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/models/connections.py +0 -0
  103. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/models/context_grounding.py +0 -0
  104. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/models/context_grounding_index.py +0 -0
  105. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/models/exceptions.py +0 -0
  106. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/models/job.py +0 -0
  107. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/models/llm_gateway.py +0 -0
  108. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/models/processes.py +0 -0
  109. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/models/queues.py +0 -0
  110. {uipath-2.0.5 → uipath-2.0.7}/src/uipath/py.typed +0 -0
  111. {uipath-2.0.5 → uipath-2.0.7}/tests/__init__.py +0 -0
  112. {uipath-2.0.5 → uipath-2.0.7}/tests/cli/test_init.py +0 -0
  113. {uipath-2.0.5 → uipath-2.0.7}/tests/conftest.py +0 -0
  114. {uipath-2.0.5 → uipath-2.0.7}/tests/sdk/services/test_llm_integration.py +0 -0
  115. {uipath-2.0.5 → uipath-2.0.7}/tests/sdk/services/test_llm_service.py +0 -0
  116. {uipath-2.0.5 → uipath-2.0.7}/tests/sdk/services/test_uipath_llm_integration.py +0 -0
  117. {uipath-2.0.5 → uipath-2.0.7}/tests/sdk/test_config.py +0 -0
@@ -56,7 +56,9 @@ jobs:
56
56
  if: ${{ steps.check_version.outputs.modified }} == 'true'
57
57
  run: |
58
58
  mkdir -p docs/plugins
59
+ mkdir -p docs/docs
59
60
  ln -s ../../plugins/uipath-langchain-python docs/plugins/uipath-langchain-python
61
+ ln -s ../plugins/uipath-langchain-python/docs docs/docs
60
62
 
61
63
  - name: Publish Docs
62
64
  if: ${{ steps.check_version.outputs.modified }} == 'true'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath
3
- Version: 2.0.5
3
+ Version: 2.0.7
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
@@ -208,4 +208,4 @@ To properly use the CLI for packaging and publishing, your project should includ
208
208
 
209
209
  ### Setting Up a Development Environment
210
210
 
211
- Please read [CONTRIBUTING.md](https://uipath.github.io/uipath-python/how_to_contribute/) before submitting a pull request.
211
+ Please read [CONTRIBUTING.md](./CONTRIBUTING.md) before submitting a pull request.
@@ -180,4 +180,4 @@ To properly use the CLI for packaging and publishing, your project should includ
180
180
 
181
181
  ### Setting Up a Development Environment
182
182
 
183
- Please read [CONTRIBUTING.md](https://uipath.github.io/uipath-python/how_to_contribute/) before submitting a pull request.
183
+ Please read [CONTRIBUTING.md](./CONTRIBUTING.md) before submitting a pull request.
@@ -0,0 +1,29 @@
1
+ # Getting Started
2
+
3
+ ## Using an Agent Based on LangGraph
4
+
5
+ To use the UiPath SDK with a LangGraph-based project:
6
+
7
+ 1. Add the `uipath-langchain` package to your project:
8
+
9
+ ```shell
10
+ uv add uipath-langchain
11
+ ```
12
+
13
+ 2. Initialize the project by running the following command in your activated virtual environment:
14
+
15
+ ```shell
16
+ uipath init
17
+ ```
18
+
19
+ > **Note:**: The `uipath init` command will execute your code to analyze its structure and collect information about inputs and outputs.
20
+
21
+ 3. Package and publish your project:
22
+ ```shell
23
+ uipath pack
24
+ uipath publish
25
+ ```
26
+
27
+ This will create and publish your package to the UiPath platform, making it available for use in your automation workflows.
28
+
29
+ For more examples and implementation patterns, check out the [sample projects](https://github.com/UiPath/uipath-langchain-python/tree/main/samples) in our GitHub repository.
@@ -122,84 +122,3 @@ Finally, publish your package. After selecting your publishing destination (tena
122
122
  Publishing most recent package: test.0.1.0.nupkg
123
123
  Package published successfully!
124
124
  ```
125
-
126
- ## Using the SDK
127
-
128
- ### Creating a Process Client
129
-
130
- Now, let's create a new project to invoke the process we just created. We'll skip the installation and authentication steps since they're covered above.
131
-
132
- Create a new project:
133
-
134
- ```shell
135
- mkdir test2
136
- cd test2
137
- uv init . --python 3.10
138
- uv add uipath
139
- ```
140
-
141
- ### Configuring the Project
142
-
143
- First, open `.env` in your code editor and specify the folder where you want to run the code. For example, to use the "Shared" folder:
144
-
145
- ```shell
146
- UIPATH_FOLDER_PATH=Shared
147
- ```
148
-
149
- ### Writing the Client Code
150
-
151
- Open `main.py` in your code editor and add the following code:
152
-
153
- ```python
154
- from uipath import UiPath
155
-
156
-
157
- def main():
158
- sdk = UiPath()
159
- sdk.processes.invoke(
160
- "test-pack",
161
- input_arguments={
162
- "message": "Hello, World!",
163
- "repeat": 3,
164
- "prefix": "[Echo]"
165
- }
166
- )
167
- ```
168
-
169
- > **Note:**: `test-pack` is the name of the process we created from the previous package.
170
-
171
- ### Verifying the Execution
172
-
173
- Open your browser and navigate to UiPath. Go to the specified folder, and you'll see a new job for `test-pack` has been executed. The output will be:
174
-
175
- ```
176
- [Echo]: Hello, World! Echo: Hello, World! Echo: Hello, World!
177
- ```
178
-
179
- ## Using an Agent Based on LangGraph
180
-
181
- To use the UiPath SDK with a LangGraph-based project:
182
-
183
- 1. Add the `uipath-langchain` package to your project:
184
-
185
- ```shell
186
- uv add uipath-langchain
187
- ```
188
-
189
- 2. Initialize the project by running the following command in your activated virtual environment:
190
-
191
- ```shell
192
- uipath init
193
- ```
194
-
195
- > **Note:**: The `uipath init` command will execute your code to analyze its structure and collect information about inputs and outputs.
196
-
197
- 3. Package and publish your project:
198
- ```shell
199
- uipath pack
200
- uipath publish
201
- ```
202
-
203
- This will create and publish your package to the UiPath platform, making it available for use in your automation workflows.
204
-
205
- For more examples and implementation patterns, check out the [sample projects](https://github.com/UiPath/uipath-langchain-python/tree/main/samples) in our GitHub repository.
@@ -0,0 +1,3 @@
1
+ --8<--
2
+ docs/plugins/uipath-langchain-python/samples/multi-agent-planner-researcher-coder-distributed/README.md:149:234
3
+ --8<--
@@ -0,0 +1,83 @@
1
+ # Getting Started
2
+
3
+ ## Prerequisites
4
+
5
+ - Python 3.10 or higher
6
+ - `pip` or `uv` package manager
7
+ - A UiPath Platform account with appropriate permissions
8
+
9
+ ## Creating a New Project
10
+
11
+ We recommend using `uv` for package management. To create a new project:
12
+
13
+ ```shell
14
+ mkdir example
15
+ cd example
16
+ uv init . --python 3.10
17
+ ```
18
+
19
+ This command creates a basic project structure.
20
+
21
+ ### Installing the UiPath SDK
22
+
23
+ Add the UiPath SDK to your project:
24
+
25
+ ```shell
26
+ uv add uipath
27
+ ```
28
+
29
+ To verify the installation, run:
30
+
31
+ ```shell
32
+ uv run uipath --version
33
+ ```
34
+
35
+ ### Authentication
36
+
37
+ To debug your script locally and publish your project, you need to authenticate with UiPath:
38
+
39
+ ```shell
40
+ uv run uipath auth
41
+ ```
42
+
43
+ This command opens a new browser window. If you encounter any issues, copy the URL from the terminal and paste it into your browser. After authentication, select your tenant by typing its corresponding number in the terminal.
44
+
45
+ After completing this step, your project will contain a `.env` file with your access token, UiPath URL, and other configuration details.
46
+
47
+ ### Configuring the Project
48
+
49
+ First, open `.env` in your code editor and specify the folder where you want to run the code. For example, to use the "Shared" folder:
50
+
51
+ ```shell
52
+ UIPATH_FOLDER_PATH=Shared
53
+ ```
54
+
55
+ ### Writing the Client Code
56
+
57
+ Open `main.py` in your code editor and add the following code:
58
+
59
+ ```python
60
+ from uipath import UiPath
61
+
62
+
63
+ def main():
64
+ sdk = UiPath()
65
+ sdk.processes.invoke(
66
+ "test-pack",
67
+ input_arguments={
68
+ "message": "Hello, World!",
69
+ "repeat": 3,
70
+ "prefix": "[Echo]"
71
+ }
72
+ )
73
+ ```
74
+
75
+ > **Note:**: `test-pack` is the name of the process we created from the [previous package.](./getting_started_cli.md)
76
+
77
+ ### Verifying the Execution
78
+
79
+ Open your browser and navigate to UiPath. Go to the specified folder, and you'll see a new job for `test-pack` has been executed. The output will be:
80
+
81
+ ```
82
+ [Echo]: Hello, World! Echo: Hello, World! Echo: Hello, World!
83
+ ```
@@ -0,0 +1,4 @@
1
+ # Getting Started
2
+ - [CLI Guide](./getting_started_cli.md) - Learn how to use the UiPath Python CLI
3
+ - [SDK Guide](./getting_started_sdk.md) - Get started with the UiPath Python SDK
4
+ - [Agent Guide](./getting_started_agent.md) - Learn about working with LangGraph and UiPath
@@ -34,9 +34,14 @@ theme:
34
34
  logo: assets/uipath-logo.svg
35
35
 
36
36
  nav:
37
- - Getting Started: getting_started.md
38
- - Home:
37
+ - Getting Started:
39
38
  - index.md
39
+ - CLI: getting_started_cli.md
40
+ - SDK: getting_started_sdk.md
41
+ - Agent: getting_started_agent.md
42
+ - Cloud: getting_started_cloud.md
43
+ - UiPath SDK:
44
+ - sdk.md
40
45
  - Actions: actions.md
41
46
  - Assets: assets.md
42
47
  - Buckets: buckets.md
@@ -45,13 +50,13 @@ nav:
45
50
  - Jobs: jobs.md
46
51
  - Queues: queues.md
47
52
  - Processes: processes.md
48
- - Langchain:
53
+ - UiPathLangchain:
49
54
  - plugins/uipath-langchain-python/README.md
50
55
  - Chat models: plugins/uipath-langchain-python/docs/chat_models.md
51
56
  - Context Grounding Chain: plugins/uipath-langchain-python/docs/context_grounding_chain.md
52
57
  - Context Grounding Retriever: plugins/uipath-langchain-python/docs/context_grounding_retriever.md
53
58
  - Interrupt models: plugins/uipath-langchain-python/docs/interrupt_models.md
54
- - How To Contribute: how_to_contribute.md
59
+ - How To Contribute: CONTRIBUTING.md
55
60
 
56
61
  plugins:
57
62
  - search
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "uipath"
3
- version = "2.0.5"
3
+ version = "2.0.7"
4
4
  description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
5
5
  readme = { file = "README.md", content-type = "text/markdown" }
6
6
  requires-python = ">=3.10"
@@ -46,17 +46,12 @@ class FolderContext:
46
46
 
47
47
  Returns:
48
48
  dict[str, str]: A dictionary containing the appropriate folder
49
- header (either folder key or folder path).
50
-
51
- Raises:
52
- ValueError: If neither folder key nor folder path is set in
53
- the environment.
49
+ header (either folder key or folder path). If no folder header is
50
+ set as environment variable, the function returns an empty dictionary.
54
51
  """
55
52
  if self._folder_key is not None:
56
53
  return {HEADER_FOLDER_KEY: self._folder_key}
57
54
  elif self._folder_path is not None:
58
55
  return {HEADER_FOLDER_PATH: self._folder_path}
59
56
  else:
60
- raise ValueError(
61
- f"Folder key or path is not set ({ENV_FOLDER_KEY} or {ENV_FOLDER_PATH})"
62
- )
57
+ return {}
@@ -7,17 +7,24 @@ from .._config import Config
7
7
  from .._execution_context import ExecutionContext
8
8
  from .._folder_context import FolderContext
9
9
  from .._utils import Endpoint, RequestSpec
10
- from .._utils.constants import ENV_TENANT_ID, HEADER_TENANT_ID
10
+ from .._utils.constants import (
11
+ ENV_TENANT_ID,
12
+ HEADER_FOLDER_KEY,
13
+ HEADER_FOLDER_PATH,
14
+ HEADER_TENANT_ID,
15
+ )
11
16
  from ..models import Action, ActionSchema
12
17
  from ._base_service import BaseService
13
18
 
14
19
 
15
20
  def _create_spec(
16
- title: str,
17
21
  data: Optional[Dict[str, Any]],
18
22
  action_schema: Optional[ActionSchema],
23
+ title: str,
19
24
  app_key: str = "",
20
25
  app_version: int = -1,
26
+ app_folder_key: str = "",
27
+ app_folder_path: str = "",
21
28
  ) -> RequestSpec:
22
29
  field_list = []
23
30
  outcome_list = []
@@ -97,14 +104,18 @@ def _create_spec(
97
104
  else {},
98
105
  }
99
106
  ),
107
+ headers=folder_headers(app_folder_key, app_folder_path),
100
108
  )
101
109
 
102
110
 
103
- def _retrieve_action_spec(action_key: str) -> RequestSpec:
111
+ def _retrieve_action_spec(
112
+ action_key: str, app_folder_key: str, app_folder_path: str
113
+ ) -> RequestSpec:
104
114
  return RequestSpec(
105
115
  method="GET",
106
116
  endpoint=Endpoint("/orchestrator_/tasks/GenericTasks/GetTaskDataByKey"),
107
117
  params={"taskKey": action_key},
118
+ headers=folder_headers(app_folder_key, app_folder_path),
108
119
  )
109
120
 
110
121
 
@@ -132,6 +143,15 @@ def _retrieve_app_key_spec(app_name: str) -> RequestSpec:
132
143
  )
133
144
 
134
145
 
146
+ def folder_headers(app_folder_key: str, app_folder_path: str) -> Dict[str, str]:
147
+ headers = {}
148
+ if app_folder_key:
149
+ headers[HEADER_FOLDER_KEY] = app_folder_key
150
+ elif app_folder_path:
151
+ headers[HEADER_FOLDER_PATH] = app_folder_path
152
+ return headers
153
+
154
+
135
155
  class ActionsService(FolderContext, BaseService):
136
156
  """Service for managing UiPath Actions.
137
157
 
@@ -162,6 +182,8 @@ class ActionsService(FolderContext, BaseService):
162
182
  *,
163
183
  app_name: str = "",
164
184
  app_key: str = "",
185
+ app_folder_path: str = "",
186
+ app_folder_key: str = "",
165
187
  app_version: int = -1,
166
188
  assignee: str = "",
167
189
  ) -> Action:
@@ -175,6 +197,8 @@ class ActionsService(FolderContext, BaseService):
175
197
  data: Optional dictionary containing input data for the action
176
198
  app_name: The name of the application (if creating an app-specific action)
177
199
  app_key: The key of the application (if creating an app-specific action)
200
+ app_folder_path: Optional folder path for the action
201
+ app_folder_key: Optional folder key for the action
178
202
  app_version: The version of the application
179
203
  assignee: Optional username or email to assign the task to
180
204
 
@@ -195,10 +219,12 @@ class ActionsService(FolderContext, BaseService):
195
219
  app_key=key,
196
220
  app_version=app_version,
197
221
  action_schema=action_schema,
222
+ app_folder_key=app_folder_key,
223
+ app_folder_path=app_folder_path,
198
224
  )
199
225
 
200
226
  response = await self.request_async(
201
- spec.method, spec.endpoint, content=spec.content
227
+ spec.method, spec.endpoint, content=spec.content, headers=spec.headers
202
228
  )
203
229
  json_response = response.json()
204
230
  if assignee:
@@ -213,6 +239,8 @@ class ActionsService(FolderContext, BaseService):
213
239
  *,
214
240
  app_name: str = "",
215
241
  app_key: str = "",
242
+ app_folder_path: str = "",
243
+ app_folder_key: str = "",
216
244
  app_version: int = -1,
217
245
  assignee: str = "",
218
246
  ) -> Action:
@@ -226,6 +254,8 @@ class ActionsService(FolderContext, BaseService):
226
254
  data: Optional dictionary containing input data for the action
227
255
  app_name: The name of the application (if creating an app-specific action)
228
256
  app_key: The key of the application (if creating an app-specific action)
257
+ app_folder_path: Optional folder path for the action
258
+ app_folder_key: Optional folder key for the action
229
259
  app_version: The version of the application
230
260
  assignee: Optional username or email to assign the task to
231
261
 
@@ -244,48 +274,63 @@ class ActionsService(FolderContext, BaseService):
244
274
  app_key=key,
245
275
  app_version=app_version,
246
276
  action_schema=action_schema,
277
+ app_folder_key=app_folder_key,
278
+ app_folder_path=app_folder_path,
247
279
  )
248
280
 
249
- response = self.request(spec.method, spec.endpoint, content=spec.content)
281
+ response = self.request(
282
+ spec.method, spec.endpoint, content=spec.content, headers=spec.headers
283
+ )
250
284
  json_response = response.json()
251
285
  if assignee:
252
286
  spec = _assign_task_spec(json_response["id"], assignee)
253
- print(spec)
254
287
  self.request(spec.method, spec.endpoint, content=spec.content)
255
288
  return Action.model_validate(json_response)
256
289
 
257
290
  def retrieve(
258
- self,
259
- action_key: str,
291
+ self, action_key: str, app_folder_path: str = "", app_folder_key: str = ""
260
292
  ) -> Action:
261
293
  """Retrieves an action by its key synchronously.
262
294
 
263
295
  Args:
264
296
  action_key: The unique identifier of the action to retrieve
297
+ app_folder_path: Optional folder path for the action
298
+ app_folder_key: Optional folder key for the action
265
299
 
266
300
  Returns:
267
301
  Action: The retrieved action object
268
302
  """
269
- spec = _retrieve_action_spec(action_key=action_key)
270
- response = self.request(spec.method, spec.endpoint, params=spec.params)
303
+ spec = _retrieve_action_spec(
304
+ action_key=action_key,
305
+ app_folder_key=app_folder_key,
306
+ app_folder_path=app_folder_path,
307
+ )
308
+ response = self.request(
309
+ spec.method, spec.endpoint, params=spec.params, headers=spec.headers
310
+ )
271
311
 
272
312
  return Action.model_validate(response.json())
273
313
 
274
314
  async def retrieve_async(
275
- self,
276
- action_key: str,
315
+ self, action_key: str, app_folder_path: str = "", app_folder_key: str = ""
277
316
  ) -> Action:
278
317
  """Retrieves an action by its key asynchronously.
279
318
 
280
319
  Args:
281
320
  action_key: The unique identifier of the action to retrieve
321
+ app_folder_path: Optional folder path for the action
322
+ app_folder_key: Optional folder key for the action
282
323
 
283
324
  Returns:
284
325
  Action: The retrieved action object
285
326
  """
286
- spec = _retrieve_action_spec(action_key=action_key)
327
+ spec = _retrieve_action_spec(
328
+ action_key=action_key,
329
+ app_folder_key=app_folder_key,
330
+ app_folder_path=app_folder_path,
331
+ )
287
332
  response = await self.request_async(
288
- spec.method, spec.endpoint, params=spec.params
333
+ spec.method, spec.endpoint, params=spec.params, headers=spec.headers
289
334
  )
290
335
 
291
336
  return Action.model_validate(response.json())
@@ -311,8 +356,25 @@ class ActionsService(FolderContext, BaseService):
311
356
  response = await self.request_org_scope_async(
312
357
  spec.method, spec.endpoint, params=spec.params, headers=spec.headers
313
358
  )
314
- deployed_app = response.json()["deployed"][0]
315
- return (deployed_app["systemName"], deployed_app["actionSchema"])
359
+ try:
360
+ deployed_app = response.json()["deployed"][0]
361
+ action_schema = deployed_app["actionSchema"]
362
+ deployed_app_key = deployed_app["systemName"]
363
+ except (KeyError, IndexError):
364
+ raise Exception("Action app not found") from None
365
+ try:
366
+ return (
367
+ deployed_app_key,
368
+ ActionSchema(
369
+ key=action_schema["key"],
370
+ in_outs=action_schema["inOuts"],
371
+ inputs=action_schema["inputs"],
372
+ outputs=action_schema["outputs"],
373
+ outcomes=action_schema["outcomes"],
374
+ ),
375
+ )
376
+ except KeyError:
377
+ raise Exception("Failed to deserialize action schema") from KeyError
316
378
 
317
379
  def __get_app_key_and_schema(
318
380
  self, app_name: str
@@ -326,18 +388,25 @@ class ActionsService(FolderContext, BaseService):
326
388
  spec.method, spec.endpoint, params=spec.params, headers=spec.headers
327
389
  )
328
390
 
329
- deployed_app = response.json()["deployed"][0]
330
- action_schema = deployed_app["actionSchema"]
331
- return (
332
- deployed_app["systemName"],
333
- ActionSchema(
334
- key=action_schema["key"],
335
- in_outs=action_schema["inOuts"],
336
- inputs=action_schema["inputs"],
337
- outputs=action_schema["outputs"],
338
- outcomes=action_schema["outcomes"],
339
- ),
340
- )
391
+ try:
392
+ deployed_app = response.json()["deployed"][0]
393
+ action_schema = deployed_app["actionSchema"]
394
+ deployed_app_key = deployed_app["systemName"]
395
+ except (KeyError, IndexError):
396
+ raise Exception("Action app not found") from None
397
+ try:
398
+ return (
399
+ deployed_app_key,
400
+ ActionSchema(
401
+ key=action_schema["key"],
402
+ in_outs=action_schema["inOuts"],
403
+ inputs=action_schema["inputs"],
404
+ outputs=action_schema["outputs"],
405
+ outcomes=action_schema["outcomes"],
406
+ ),
407
+ )
408
+ except KeyError:
409
+ raise Exception("Failed to deserialize action schema") from KeyError
341
410
 
342
411
  @property
343
412
  def custom_headers(self) -> Dict[str, str]:
@@ -9,6 +9,7 @@ from .._folder_context import FolderContext
9
9
  from .._utils import Endpoint, RequestSpec
10
10
  from .._utils.constants import (
11
11
  HEADER_FOLDER_KEY,
12
+ HEADER_FOLDER_PATH,
12
13
  ORCHESTRATOR_STORAGE_BUCKET_DATA_SOURCE,
13
14
  )
14
15
  from ..models import IngestionInProgressException
@@ -326,7 +327,9 @@ class ContextGroundingService(FolderContext, BaseService):
326
327
  )
327
328
 
328
329
  if self._folder_key is None:
329
- raise ValueError(f"Folder key is not set ({HEADER_FOLDER_KEY})")
330
+ raise ValueError(
331
+ f"Neither the folder key nor the folder path is set ({HEADER_FOLDER_KEY}, {HEADER_FOLDER_PATH})"
332
+ )
330
333
 
331
334
  return self.folder_headers
332
335
 
@@ -16,12 +16,14 @@ class WaitJob(BaseModel):
16
16
 
17
17
 
18
18
  class CreateAction(BaseModel):
19
- name: Optional[str] = None
20
- key: Optional[str] = None
21
19
  title: str
22
20
  data: Optional[Dict[str, Any]] = None
23
- app_version: Optional[int] = 1
24
21
  assignee: Optional[str] = ""
22
+ app_name: Optional[str] = None
23
+ app_folder_path: Optional[str] = None
24
+ app_folder_key: Optional[str] = None
25
+ app_key: Optional[str] = None
26
+ app_version: Optional[int] = 1
25
27
 
26
28
 
27
29
  class WaitAction(BaseModel):
@@ -2320,7 +2320,7 @@ wheels = [
2320
2320
 
2321
2321
  [[package]]
2322
2322
  name = "uipath"
2323
- version = "2.0.5"
2323
+ version = "2.0.7"
2324
2324
  source = { editable = "." }
2325
2325
  dependencies = [
2326
2326
  { name = "click" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes