dtlpy 1.109.20__py3-none-any.whl → 1.110.3__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.
- dtlpy/__version__.py +1 -1
- dtlpy/entities/prompt_item.py +43 -1
- dtlpy/repositories/models.py +1 -1
- {dtlpy-1.109.20.dist-info → dtlpy-1.110.3.dist-info}/METADATA +1 -1
- {dtlpy-1.109.20.dist-info → dtlpy-1.110.3.dist-info}/RECORD +12 -12
- {dtlpy-1.109.20.data → dtlpy-1.110.3.data}/scripts/dlp +0 -0
- {dtlpy-1.109.20.data → dtlpy-1.110.3.data}/scripts/dlp.bat +0 -0
- {dtlpy-1.109.20.data → dtlpy-1.110.3.data}/scripts/dlp.py +0 -0
- {dtlpy-1.109.20.dist-info → dtlpy-1.110.3.dist-info}/LICENSE +0 -0
- {dtlpy-1.109.20.dist-info → dtlpy-1.110.3.dist-info}/WHEEL +0 -0
- {dtlpy-1.109.20.dist-info → dtlpy-1.110.3.dist-info}/entry_points.txt +0 -0
- {dtlpy-1.109.20.dist-info → dtlpy-1.110.3.dist-info}/top_level.txt +0 -0
dtlpy/__version__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
version = '1.
|
|
1
|
+
version = '1.110.3'
|
dtlpy/entities/prompt_item.py
CHANGED
|
@@ -5,6 +5,7 @@ import enum
|
|
|
5
5
|
import json
|
|
6
6
|
import io
|
|
7
7
|
import os
|
|
8
|
+
from typing import List, Optional
|
|
8
9
|
|
|
9
10
|
from concurrent.futures import ThreadPoolExecutor
|
|
10
11
|
from .. import entities, repositories
|
|
@@ -152,14 +153,17 @@ class PromptItem:
|
|
|
152
153
|
self.assistant_prompts = list()
|
|
153
154
|
# list of assistant (annotations) prompts in the prompt item
|
|
154
155
|
# Dataloop Item
|
|
155
|
-
self._messages = []
|
|
156
156
|
self._item: entities.Item = item
|
|
157
|
+
self._messages = []
|
|
157
158
|
self._annotations: entities.AnnotationCollection = None
|
|
158
159
|
if item is not None:
|
|
160
|
+
if 'json' not in item.mimetype or item.system.get('shebang', dict()).get('dltype') != 'prompt':
|
|
161
|
+
raise ValueError('Expecting a json item with system.shebang.dltype = prompt')
|
|
159
162
|
self._items = item.items
|
|
160
163
|
self.fetch()
|
|
161
164
|
else:
|
|
162
165
|
self._items = repositories.Items(client_api=client_api)
|
|
166
|
+
|
|
163
167
|
# to avoid broken stream of json files - DAT-75653
|
|
164
168
|
self._items._client_api.default_headers['x-dl-sanitize'] = '0'
|
|
165
169
|
|
|
@@ -454,5 +458,43 @@ class PromptItem:
|
|
|
454
458
|
"""
|
|
455
459
|
if self._item is not None:
|
|
456
460
|
self._item._Item__update_item_binary(_json=self.to_json())
|
|
461
|
+
self._item = self._item.update()
|
|
457
462
|
else:
|
|
458
463
|
raise ValueError('Cannot update PromptItem without an item.')
|
|
464
|
+
|
|
465
|
+
# Properties
|
|
466
|
+
@property
|
|
467
|
+
def item(self) -> Optional['entities.Item']:
|
|
468
|
+
"""
|
|
469
|
+
Get the underlying Item object.
|
|
470
|
+
|
|
471
|
+
:return: The Item object associated with this PromptItem, or None.
|
|
472
|
+
:rtype: Optional[dtlpy.entities.Item]
|
|
473
|
+
"""
|
|
474
|
+
return self._item
|
|
475
|
+
|
|
476
|
+
@item.setter
|
|
477
|
+
def item(self, item: Optional['entities.Item']):
|
|
478
|
+
"""
|
|
479
|
+
Set the underlying Item object.
|
|
480
|
+
|
|
481
|
+
:param item: The Item object to associate with this PromptItem, or None.
|
|
482
|
+
:type item: Optional[dtlpy.entities.Item]
|
|
483
|
+
"""
|
|
484
|
+
if item is not None and not isinstance(item, entities.Item):
|
|
485
|
+
raise ValueError(f"Expected dtlpy.entities.Item or None, got {type(item)}")
|
|
486
|
+
self._item = item
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
@property
|
|
490
|
+
def metadata(self) -> dict:
|
|
491
|
+
"""
|
|
492
|
+
Get the metadata from the underlying Item object.
|
|
493
|
+
|
|
494
|
+
:return: Metadata dictionary from the item, or empty dict if no item exists.
|
|
495
|
+
:rtype: dict
|
|
496
|
+
"""
|
|
497
|
+
if self._item is not None:
|
|
498
|
+
return self._item.metadata
|
|
499
|
+
else:
|
|
500
|
+
raise ValueError('No item found, cannot get metadata, to set item use prompt_item.item = item')
|
dtlpy/repositories/models.py
CHANGED
|
@@ -762,7 +762,7 @@ class Models:
|
|
|
762
762
|
"""
|
|
763
763
|
payload = dict()
|
|
764
764
|
if service_config is not None:
|
|
765
|
-
payload['serviceConfig'] = service_config
|
|
765
|
+
payload['serviceConfig'] = service_config if not service_config.get("serviceConfig") else service_config.get("serviceConfig")
|
|
766
766
|
success, response = self._client_api.gen_request(req_type="post",
|
|
767
767
|
path=f"/ml/models/{model_id}/deploy",
|
|
768
768
|
json_req=payload)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
dtlpy/__init__.py,sha256=n86boFpXWXPLjSXZMmWCageGjBumPjWxRv3srysrplk,20338
|
|
2
|
-
dtlpy/__version__.py,sha256=
|
|
2
|
+
dtlpy/__version__.py,sha256=CTldC486s3qtTiQLoG-At-M1MH8bU2fAGxa87T99cJU,20
|
|
3
3
|
dtlpy/exceptions.py,sha256=EQCKs3pwhwZhgMByQN3D3LpWpdxwcKPEEt-bIaDwURM,2871
|
|
4
4
|
dtlpy/new_instance.py,sha256=tUCzBGaSpm9GTjRuwOkFgo3A8vopUQ-baltdJss3XlI,9964
|
|
5
5
|
dtlpy/assets/__init__.py,sha256=D_hAa6NM8Zoy32sF_9b7m0b7I-BQEyBFg8-9Tg2WOeo,976
|
|
@@ -84,7 +84,7 @@ dtlpy/entities/paged_entities.py,sha256=grNjt2FYg4gKBlVRDkztI1BPOI4JoGeyjvmOW3Bn
|
|
|
84
84
|
dtlpy/entities/pipeline.py,sha256=JtWGoCUhVszOVkBNK43fbTt446fkND4wH-Y-fN_llww,20851
|
|
85
85
|
dtlpy/entities/pipeline_execution.py,sha256=EQhW4W_G1bIPShYbJSAT--1WNQuvxVQbcQ_MCHIX0KI,9938
|
|
86
86
|
dtlpy/entities/project.py,sha256=ZUx8zA3mr6N145M62R3UDPCCzO1vxfyWO6vjES-bO-g,14653
|
|
87
|
-
dtlpy/entities/prompt_item.py,sha256=
|
|
87
|
+
dtlpy/entities/prompt_item.py,sha256=xROCKogJqEgxodXF-mQAJHbNuyoXA0ul55CKDX5a-2Q,21023
|
|
88
88
|
dtlpy/entities/recipe.py,sha256=SX0T7gw-_9Cs2FZyC_htIxQd7CwDwb2zA3SqB37vymM,11917
|
|
89
89
|
dtlpy/entities/reflect_dict.py,sha256=2NaSAL-CO0T0FYRYFQlaSpbsoLT2Q18AqdHgQSLX5Y4,3273
|
|
90
90
|
dtlpy/entities/resource_execution.py,sha256=1HuVV__U4jAUOtOkWlWImnM3Yts8qxMSAkMA9sBhArY,5033
|
|
@@ -176,7 +176,7 @@ dtlpy/repositories/features.py,sha256=A_RqTJxzjTh-Wbm0uXaoTNyHSfCLbeiH38iB11p2if
|
|
|
176
176
|
dtlpy/repositories/integrations.py,sha256=gSgaVp4MkcdrJMnXVr_fl4xrzhfJba8BFbBJTuJPwXc,18159
|
|
177
177
|
dtlpy/repositories/items.py,sha256=S1OWZ6s8AbVXMiLtCfBBiYPMG8OLqdUhKMHuZWE3bnU,40029
|
|
178
178
|
dtlpy/repositories/messages.py,sha256=QU0Psckg6CA_Tlw9AVxqa-Ay1fRM4n269sSIJkH9o7E,3066
|
|
179
|
-
dtlpy/repositories/models.py,sha256=
|
|
179
|
+
dtlpy/repositories/models.py,sha256=uYVw319dMgVoXReb9VKl0b3v0_kgetROQaf56cvgwqs,38297
|
|
180
180
|
dtlpy/repositories/nodes.py,sha256=xXJm_YA0vDUn0dVvaGeq6ORM0vI3YXvfjuylvGRtkxo,3061
|
|
181
181
|
dtlpy/repositories/ontologies.py,sha256=unnMhD2isR9DVE5S8Fg6fSDf1ZZ5Xemxxufx4LEUT3w,19577
|
|
182
182
|
dtlpy/repositories/organizations.py,sha256=6ijUDFbsogfRul1g_vUB5AZOb41MRmV5NhNU7WLHt3A,22825
|
|
@@ -226,9 +226,9 @@ dtlpy/utilities/reports/report.py,sha256=3nEsNnIWmdPEsd21nN8vMMgaZVcPKn9iawKTTeO
|
|
|
226
226
|
dtlpy/utilities/videos/__init__.py,sha256=SV3w51vfPuGBxaMeNemx6qEMHw_C4lLpWNGXMvdsKSY,734
|
|
227
227
|
dtlpy/utilities/videos/video_player.py,sha256=LCxg0EZ_DeuwcT7U_r7MRC6Q19s0xdFb7x5Gk39PRms,24072
|
|
228
228
|
dtlpy/utilities/videos/videos.py,sha256=Dj916B4TQRIhI7HZVevl3foFrCsPp0eeWwvGbgX3-_A,21875
|
|
229
|
-
dtlpy-1.
|
|
230
|
-
dtlpy-1.
|
|
231
|
-
dtlpy-1.
|
|
229
|
+
dtlpy-1.110.3.data/scripts/dlp,sha256=-F0vSCWuSOOtgERAtsPMPyMmzitjhB7Yeftg_PDlDjw,10
|
|
230
|
+
dtlpy-1.110.3.data/scripts/dlp.bat,sha256=QOvx8Dlx5dUbCTMpwbhOcAIXL1IWmgVRSboQqDhIn3A,37
|
|
231
|
+
dtlpy-1.110.3.data/scripts/dlp.py,sha256=tEokRaDINISXnq8yNx_CBw1qM5uwjYiZoJOYGqWB3RU,4267
|
|
232
232
|
tests/assets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
233
233
|
tests/assets/models_flow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
234
234
|
tests/assets/models_flow/failedmain.py,sha256=n8F4eu_u7JPrJ1zedbJPvv9e3lHb3ihoErqrBIcseEc,1847
|
|
@@ -236,9 +236,9 @@ tests/assets/models_flow/main.py,sha256=vnDKyVZaae2RFpvwS22Hzi6Dt2LJerH4yQrmKtaT
|
|
|
236
236
|
tests/assets/models_flow/main_model.py,sha256=Hl_tv7Q6KaRL3yLkpUoLMRqu5-ab1QsUYPL6RPEoamw,2042
|
|
237
237
|
tests/features/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
238
238
|
tests/features/environment.py,sha256=JcM956BxLBRvDqy6Kr1Nxd1FY_gxbE6XztZBVBMCGYM,18897
|
|
239
|
-
dtlpy-1.
|
|
240
|
-
dtlpy-1.
|
|
241
|
-
dtlpy-1.
|
|
242
|
-
dtlpy-1.
|
|
243
|
-
dtlpy-1.
|
|
244
|
-
dtlpy-1.
|
|
239
|
+
dtlpy-1.110.3.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
240
|
+
dtlpy-1.110.3.dist-info/METADATA,sha256=fDBFNra1w6f_hs3IdqJy7T-ZfvcfFXvG72-7cjMNdK8,5469
|
|
241
|
+
dtlpy-1.110.3.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
242
|
+
dtlpy-1.110.3.dist-info/entry_points.txt,sha256=C4PyKthCs_no88HU39eioO68oei64STYXC2ooGZTc4Y,43
|
|
243
|
+
dtlpy-1.110.3.dist-info/top_level.txt,sha256=ZWuLmQGUOtWAdgTf4Fbx884w1o0vBYq9dEc1zLv9Mig,12
|
|
244
|
+
dtlpy-1.110.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|