uipath 2.0.56__py3-none-any.whl → 2.0.57__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/_services/buckets_service.py +55 -145
- uipath/_services/context_grounding_service.py +4 -4
- uipath/telemetry/_constants.py +1 -1
- {uipath-2.0.56.dist-info → uipath-2.0.57.dist-info}/METADATA +1 -1
- {uipath-2.0.56.dist-info → uipath-2.0.57.dist-info}/RECORD +8 -8
- {uipath-2.0.56.dist-info → uipath-2.0.57.dist-info}/WHEEL +0 -0
- {uipath-2.0.56.dist-info → uipath-2.0.57.dist-info}/entry_points.txt +0 -0
- {uipath-2.0.56.dist-info → uipath-2.0.57.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from typing import Any, Dict, Optional, Union
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import httpx
|
|
4
4
|
|
|
5
5
|
from .._config import Config
|
|
6
6
|
from .._execution_context import ExecutionContext
|
|
@@ -25,6 +25,8 @@ class BucketsService(FolderContext, BaseService):
|
|
|
25
25
|
|
|
26
26
|
def __init__(self, config: Config, execution_context: ExecutionContext) -> None:
|
|
27
27
|
super().__init__(config=config, execution_context=execution_context)
|
|
28
|
+
self.custom_client = httpx.Client()
|
|
29
|
+
self.custom_client_async = httpx.AsyncClient()
|
|
28
30
|
|
|
29
31
|
@traced(name="buckets_download", run_type="uipath")
|
|
30
32
|
def download(
|
|
@@ -78,7 +80,7 @@ class BucketsService(FolderContext, BaseService):
|
|
|
78
80
|
if result["RequiresAuth"]:
|
|
79
81
|
file_content = self.request("GET", read_uri, headers=headers).content
|
|
80
82
|
else:
|
|
81
|
-
file_content =
|
|
83
|
+
file_content = self.custom_client.get(read_uri, headers=headers).content
|
|
82
84
|
file.write(file_content)
|
|
83
85
|
|
|
84
86
|
@traced(name="buckets_upload", run_type="uipath")
|
|
@@ -89,7 +91,8 @@ class BucketsService(FolderContext, BaseService):
|
|
|
89
91
|
name: Optional[str] = None,
|
|
90
92
|
blob_file_path: str,
|
|
91
93
|
content_type: str,
|
|
92
|
-
source_path: str,
|
|
94
|
+
source_path: Optional[str] = None,
|
|
95
|
+
content: Optional[Union[str, bytes]] = None,
|
|
93
96
|
folder_key: Optional[str] = None,
|
|
94
97
|
folder_path: Optional[str] = None,
|
|
95
98
|
) -> None:
|
|
@@ -100,7 +103,8 @@ class BucketsService(FolderContext, BaseService):
|
|
|
100
103
|
name (Optional[str]): The name of the bucket.
|
|
101
104
|
blob_file_path (str): The path where the file will be stored in the bucket.
|
|
102
105
|
content_type (str): The MIME type of the file.
|
|
103
|
-
source_path (str): The local path of the file to upload.
|
|
106
|
+
source_path (Optional[str]): The local path of the file to upload.
|
|
107
|
+
content (Optional[Union[str, bytes]]): The content to upload (string or bytes).
|
|
104
108
|
folder_key (Optional[str]): The key of the folder where the bucket resides.
|
|
105
109
|
folder_path (Optional[str]): The path of the folder where the bucket resides.
|
|
106
110
|
|
|
@@ -108,6 +112,11 @@ class BucketsService(FolderContext, BaseService):
|
|
|
108
112
|
ValueError: If neither key nor name is provided.
|
|
109
113
|
Exception: If the bucket with the specified key or name is not found.
|
|
110
114
|
"""
|
|
115
|
+
if content is not None and source_path is not None:
|
|
116
|
+
raise ValueError("Content and source_path are mutually exclusive")
|
|
117
|
+
if content is None and source_path is None:
|
|
118
|
+
raise ValueError("Either content or source_path must be provided")
|
|
119
|
+
|
|
111
120
|
bucket = self.retrieve(
|
|
112
121
|
name=name, key=key, folder_key=folder_key, folder_path=folder_path
|
|
113
122
|
)
|
|
@@ -136,11 +145,25 @@ class BucketsService(FolderContext, BaseService):
|
|
|
136
145
|
)
|
|
137
146
|
}
|
|
138
147
|
|
|
139
|
-
|
|
148
|
+
if content is not None:
|
|
149
|
+
if isinstance(content, str):
|
|
150
|
+
content = content.encode("utf-8")
|
|
151
|
+
|
|
140
152
|
if result["RequiresAuth"]:
|
|
141
|
-
self.request("PUT", write_uri, headers=headers,
|
|
153
|
+
self.request("PUT", write_uri, headers=headers, content=content)
|
|
142
154
|
else:
|
|
143
|
-
|
|
155
|
+
self.custom_client.put(write_uri, headers=headers, content=content)
|
|
156
|
+
|
|
157
|
+
if source_path is not None:
|
|
158
|
+
with open(source_path, "rb") as file:
|
|
159
|
+
if result["RequiresAuth"]:
|
|
160
|
+
self.request(
|
|
161
|
+
"PUT", write_uri, headers=headers, files={"file": file}
|
|
162
|
+
)
|
|
163
|
+
else:
|
|
164
|
+
self.custom_client.put(
|
|
165
|
+
write_uri, headers=headers, files={"file": file}
|
|
166
|
+
)
|
|
144
167
|
|
|
145
168
|
@traced(name="buckets_upload", run_type="uipath")
|
|
146
169
|
async def upload_async(
|
|
@@ -150,7 +173,8 @@ class BucketsService(FolderContext, BaseService):
|
|
|
150
173
|
name: Optional[str] = None,
|
|
151
174
|
blob_file_path: str,
|
|
152
175
|
content_type: str,
|
|
153
|
-
source_path: str,
|
|
176
|
+
source_path: Optional[str] = None,
|
|
177
|
+
content: Optional[Union[str, bytes]] = None,
|
|
154
178
|
folder_key: Optional[str] = None,
|
|
155
179
|
folder_path: Optional[str] = None,
|
|
156
180
|
) -> None:
|
|
@@ -169,6 +193,11 @@ class BucketsService(FolderContext, BaseService):
|
|
|
169
193
|
ValueError: If neither key nor name is provided.
|
|
170
194
|
Exception: If the bucket with the specified key or name is not found.
|
|
171
195
|
"""
|
|
196
|
+
if content is not None and source_path is not None:
|
|
197
|
+
raise ValueError("Content and source_path are mutually exclusive")
|
|
198
|
+
if content is None and source_path is None:
|
|
199
|
+
raise ValueError("Either content or source_path must be provided")
|
|
200
|
+
|
|
172
201
|
bucket = await self.retrieve_async(
|
|
173
202
|
name=name, key=key, folder_key=folder_key, folder_path=folder_path
|
|
174
203
|
)
|
|
@@ -199,148 +228,29 @@ class BucketsService(FolderContext, BaseService):
|
|
|
199
228
|
)
|
|
200
229
|
}
|
|
201
230
|
|
|
202
|
-
|
|
231
|
+
if content is not None:
|
|
232
|
+
if isinstance(content, str):
|
|
233
|
+
content = content.encode("utf-8")
|
|
234
|
+
|
|
203
235
|
if result["RequiresAuth"]:
|
|
204
236
|
await self.request_async(
|
|
205
|
-
"PUT", write_uri, headers=headers,
|
|
237
|
+
"PUT", write_uri, headers=headers, content=content
|
|
206
238
|
)
|
|
207
239
|
else:
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
name="buckets_upload_from_memory",
|
|
212
|
-
run_type="uipath",
|
|
213
|
-
input_processor=_upload_from_memory_input_processor,
|
|
214
|
-
)
|
|
215
|
-
def upload_from_memory(
|
|
216
|
-
self,
|
|
217
|
-
*,
|
|
218
|
-
key: Optional[str] = None,
|
|
219
|
-
name: Optional[str] = None,
|
|
220
|
-
blob_file_path: str,
|
|
221
|
-
content_type: str,
|
|
222
|
-
content: Union[str, bytes],
|
|
223
|
-
folder_key: Optional[str] = None,
|
|
224
|
-
folder_path: Optional[str] = None,
|
|
225
|
-
) -> None:
|
|
226
|
-
"""Upload content from memory to a bucket.
|
|
227
|
-
|
|
228
|
-
Args:
|
|
229
|
-
key (Optional[str]): The key of the bucket.
|
|
230
|
-
name (Optional[str]): The name of the bucket.
|
|
231
|
-
blob_file_path (str): The path where the content will be stored in the bucket.
|
|
232
|
-
content_type (str): The MIME type of the content.
|
|
233
|
-
content (Union[str, bytes]): The content to upload (string or bytes).
|
|
234
|
-
folder_key (Optional[str]): The key of the folder where the bucket resides.
|
|
235
|
-
folder_path (Optional[str]): The path of the folder where the bucket resides.
|
|
236
|
-
|
|
237
|
-
Raises:
|
|
238
|
-
ValueError: If neither key nor name is provided.
|
|
239
|
-
Exception: If the bucket with the specified key or name is not found.
|
|
240
|
-
"""
|
|
241
|
-
bucket = self.retrieve(
|
|
242
|
-
name=name, key=key, folder_key=folder_key, folder_path=folder_path
|
|
243
|
-
)
|
|
244
|
-
|
|
245
|
-
spec = self._retrieve_writeri_spec(
|
|
246
|
-
bucket.id,
|
|
247
|
-
content_type,
|
|
248
|
-
blob_file_path,
|
|
249
|
-
folder_key=folder_key,
|
|
250
|
-
folder_path=folder_path,
|
|
251
|
-
)
|
|
252
|
-
|
|
253
|
-
result = self.request(
|
|
254
|
-
spec.method,
|
|
255
|
-
url=spec.endpoint,
|
|
256
|
-
params=spec.params,
|
|
257
|
-
headers=spec.headers,
|
|
258
|
-
).json()
|
|
259
|
-
|
|
260
|
-
write_uri = result["Uri"]
|
|
261
|
-
|
|
262
|
-
headers = {
|
|
263
|
-
key: value
|
|
264
|
-
for key, value in zip(
|
|
265
|
-
result["Headers"]["Keys"], result["Headers"]["Values"], strict=False
|
|
266
|
-
)
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
# Convert string to bytes if needed
|
|
270
|
-
if isinstance(content, str):
|
|
271
|
-
content = content.encode("utf-8")
|
|
272
|
-
|
|
273
|
-
if result["RequiresAuth"]:
|
|
274
|
-
self.request("PUT", write_uri, headers=headers, content=content)
|
|
275
|
-
else:
|
|
276
|
-
request("PUT", write_uri, headers=headers, content=content)
|
|
277
|
-
|
|
278
|
-
async def upload_from_memory_async(
|
|
279
|
-
self,
|
|
280
|
-
*,
|
|
281
|
-
key: Optional[str] = None,
|
|
282
|
-
name: Optional[str] = None,
|
|
283
|
-
blob_file_path: str,
|
|
284
|
-
content_type: str,
|
|
285
|
-
content: Union[str, bytes],
|
|
286
|
-
folder_key: Optional[str] = None,
|
|
287
|
-
folder_path: Optional[str] = None,
|
|
288
|
-
) -> None:
|
|
289
|
-
"""Asynchronously upload content from memory to a bucket.
|
|
290
|
-
|
|
291
|
-
Args:
|
|
292
|
-
key (Optional[str]): The key of the bucket.
|
|
293
|
-
name (Optional[str]): The name of the bucket.
|
|
294
|
-
blob_file_path (str): The path where the content will be stored in the bucket.
|
|
295
|
-
content_type (str): The MIME type of the content.
|
|
296
|
-
content (Union[str, bytes]): The content to upload (string or bytes).
|
|
297
|
-
folder_key (Optional[str]): The key of the folder where the bucket resides.
|
|
298
|
-
folder_path (Optional[str]): The path of the folder where the bucket resides.
|
|
299
|
-
|
|
300
|
-
Raises:
|
|
301
|
-
ValueError: If neither key nor name is provided.
|
|
302
|
-
Exception: If the bucket with the specified key or name is not found.
|
|
303
|
-
"""
|
|
304
|
-
bucket = await self.retrieve_async(
|
|
305
|
-
name=name, key=key, folder_key=folder_key, folder_path=folder_path
|
|
306
|
-
)
|
|
307
|
-
|
|
308
|
-
bucket_id = bucket["Id"]
|
|
309
|
-
|
|
310
|
-
spec = self._retrieve_writeri_spec(
|
|
311
|
-
bucket_id,
|
|
312
|
-
content_type,
|
|
313
|
-
blob_file_path,
|
|
314
|
-
folder_key=folder_key,
|
|
315
|
-
folder_path=folder_path,
|
|
316
|
-
)
|
|
317
|
-
|
|
318
|
-
result = (
|
|
319
|
-
await self.request_async(
|
|
320
|
-
spec.method,
|
|
321
|
-
url=spec.endpoint,
|
|
322
|
-
params=spec.params,
|
|
323
|
-
headers=spec.headers,
|
|
324
|
-
)
|
|
325
|
-
).json()
|
|
326
|
-
|
|
327
|
-
write_uri = result["Uri"]
|
|
328
|
-
|
|
329
|
-
headers = {
|
|
330
|
-
key: value
|
|
331
|
-
for key, value in zip(
|
|
332
|
-
result["Headers"]["Keys"], result["Headers"]["Values"], strict=False
|
|
333
|
-
)
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
# Convert string to bytes if needed
|
|
337
|
-
if isinstance(content, str):
|
|
338
|
-
content = content.encode("utf-8")
|
|
240
|
+
await self.custom_client_async.put(
|
|
241
|
+
write_uri, headers=headers, content=content
|
|
242
|
+
)
|
|
339
243
|
|
|
340
|
-
if
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
244
|
+
if source_path is not None:
|
|
245
|
+
with open(source_path, "rb") as file:
|
|
246
|
+
if result["RequiresAuth"]:
|
|
247
|
+
await self.request_async(
|
|
248
|
+
"PUT", write_uri, headers=headers, files={"file": file}
|
|
249
|
+
)
|
|
250
|
+
else:
|
|
251
|
+
await self.custom_client_async.put(
|
|
252
|
+
write_uri, headers=headers, files={"file": file}
|
|
253
|
+
)
|
|
344
254
|
|
|
345
255
|
@infer_bindings()
|
|
346
256
|
@traced(name="buckets_retrieve", run_type="uipath")
|
|
@@ -15,8 +15,8 @@ from ..models import IngestionInProgressException
|
|
|
15
15
|
from ..models.context_grounding import ContextGroundingQueryResponse
|
|
16
16
|
from ..models.context_grounding_index import ContextGroundingIndex
|
|
17
17
|
from ..tracing._traced import traced
|
|
18
|
-
from . import BucketsService
|
|
19
18
|
from ._base_service import BaseService
|
|
19
|
+
from .buckets_service import BucketsService
|
|
20
20
|
from .folder_service import FolderService
|
|
21
21
|
|
|
22
22
|
|
|
@@ -85,7 +85,7 @@ class ContextGroundingService(FolderContext, BaseService):
|
|
|
85
85
|
content_type=content_type,
|
|
86
86
|
)
|
|
87
87
|
else:
|
|
88
|
-
self._buckets_service.
|
|
88
|
+
self._buckets_service.upload(
|
|
89
89
|
name=bucket_name,
|
|
90
90
|
content=content,
|
|
91
91
|
blob_file_path=blob_file_path,
|
|
@@ -137,9 +137,9 @@ class ContextGroundingService(FolderContext, BaseService):
|
|
|
137
137
|
content_type=content_type,
|
|
138
138
|
)
|
|
139
139
|
else:
|
|
140
|
-
await self._buckets_service.
|
|
140
|
+
await self._buckets_service.upload_async(
|
|
141
141
|
name=bucket_name,
|
|
142
|
-
content=content,
|
|
142
|
+
content=content,
|
|
143
143
|
blob_file_path=blob_file_path,
|
|
144
144
|
folder_path=bucket_folder_path,
|
|
145
145
|
content_type=content_type,
|
uipath/telemetry/_constants.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
_CONNECTION_STRING = ""
|
|
1
|
+
_CONNECTION_STRING = "InstrumentationKey=d3da6dfc-5231-4d72-9696-f680a64683b8;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=9b73b209-6c6a-4d4a-9549-b922cef418d5"
|
|
2
2
|
|
|
3
3
|
_APP_INSIGHTS_EVENT_MARKER_ATTRIBUTE = "APPLICATION_INSIGHTS_EVENT_MARKER_ATTRIBUTE"
|
|
4
4
|
_OTEL_RESOURCE_ATTRIBUTES = "OTEL_RESOURCE_ATTRIBUTES"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: uipath
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.57
|
|
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
|
|
@@ -45,9 +45,9 @@ uipath/_services/actions_service.py,sha256=LYKvG4VxNGQgZ46AzGK9kI1Txb-YmVvZj5ScP
|
|
|
45
45
|
uipath/_services/api_client.py,sha256=hcof0EMa4-phEHD1WlO7Tdfzq6aL18Sbi2aBE7lJm1w,1821
|
|
46
46
|
uipath/_services/assets_service.py,sha256=gfQLCchT6evsmhip1-coX6oFbshoKUWlxwGrS6DGcHU,13200
|
|
47
47
|
uipath/_services/attachments_service.py,sha256=8iRdauPFzhJv65Uus69BBmA3jPckqfwBE4iGbXvktCQ,19653
|
|
48
|
-
uipath/_services/buckets_service.py,sha256=
|
|
48
|
+
uipath/_services/buckets_service.py,sha256=736isvj01_-Srh0JiorS02pOwjF0_Loaf-xR6u0B7Ww,14932
|
|
49
49
|
uipath/_services/connections_service.py,sha256=qh-HNL_GJsyPUD0wSJZRF8ZdrTE9l4HrIilmXGK6dDk,4581
|
|
50
|
-
uipath/_services/context_grounding_service.py,sha256=
|
|
50
|
+
uipath/_services/context_grounding_service.py,sha256=nE-RZuean_DXK7a6pcA4S2fcWcfWmQ-rmOihi5_qErU,24072
|
|
51
51
|
uipath/_services/folder_service.py,sha256=HtsBoBejvMuIZ-9gocAG9B8uKOFsAAD4WUozta-isXk,1673
|
|
52
52
|
uipath/_services/jobs_service.py,sha256=Z1CmglIe6pFt0XovPLbuLCp13mWQw92MgjfRivqsodE,16745
|
|
53
53
|
uipath/_services/llm_gateway_service.py,sha256=ySg3sflIoXmY9K7txlSm7bkuI2qzBT0kAKmGlFBk5KA,12032
|
|
@@ -80,14 +80,14 @@ uipath/models/llm_gateway.py,sha256=0sl5Wtve94V14H3AHwmJSoXAhoc-Fai3wJxP8HrnBPg,
|
|
|
80
80
|
uipath/models/processes.py,sha256=Atvfrt6X4TYST3iA62jpS_Uxc3hg6uah11p-RaKZ6dk,2029
|
|
81
81
|
uipath/models/queues.py,sha256=N_s0GKucbyjh0RnO8SxPk6wlRgvq8KIIYsfaoIY46tM,6446
|
|
82
82
|
uipath/telemetry/__init__.py,sha256=Wna32UFzZR66D-RzTKlPWlvji9i2HJb82NhHjCCXRjY,61
|
|
83
|
-
uipath/telemetry/_constants.py,sha256=
|
|
83
|
+
uipath/telemetry/_constants.py,sha256=RVymOX07CRzcGMn1OWzh-TR6bZMvLG3vdCA6fvRrrCk,678
|
|
84
84
|
uipath/telemetry/_track.py,sha256=v0e3hgwtetMsUco4yosBzNU00Ek5SI9RxUTumrTTNyo,3872
|
|
85
85
|
uipath/tracing/__init__.py,sha256=GimSzv6qkCOlHOG1WtjYKJsZqcXpA28IgoXfR33JhiA,139
|
|
86
86
|
uipath/tracing/_otel_exporters.py,sha256=x0PDPmDKJcxashsuehVsSsqBCzRr6WsNFaq_3_HS5F0,3014
|
|
87
87
|
uipath/tracing/_traced.py,sha256=GFxOp73jk0vGTN_H7YZOOsEl9rVLaEhXGztMiYKIA-8,16634
|
|
88
88
|
uipath/tracing/_utils.py,sha256=5SwsTGpHkIouXBndw-u8eCLnN4p7LM8DsTCCuf2jJgs,10165
|
|
89
|
-
uipath-2.0.
|
|
90
|
-
uipath-2.0.
|
|
91
|
-
uipath-2.0.
|
|
92
|
-
uipath-2.0.
|
|
93
|
-
uipath-2.0.
|
|
89
|
+
uipath-2.0.57.dist-info/METADATA,sha256=OKwYNKZD-y2kOHlywNqDxh1b-lU0NpUCb1btkd6IwHY,6304
|
|
90
|
+
uipath-2.0.57.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
91
|
+
uipath-2.0.57.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
|
|
92
|
+
uipath-2.0.57.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
|
|
93
|
+
uipath-2.0.57.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|