superb-ai-onprem 0.3.6__py3-none-any.whl → 0.3.8__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 superb-ai-onprem might be problematic. Click here for more details.
- spb_onprem/_version.py +2 -2
- spb_onprem/contents/service.py +30 -2
- spb_onprem/data/service.py +17 -0
- {superb_ai_onprem-0.3.6.dist-info → superb_ai_onprem-0.3.8.dist-info}/METADATA +1 -1
- {superb_ai_onprem-0.3.6.dist-info → superb_ai_onprem-0.3.8.dist-info}/RECORD +8 -8
- {superb_ai_onprem-0.3.6.dist-info → superb_ai_onprem-0.3.8.dist-info}/WHEEL +0 -0
- {superb_ai_onprem-0.3.6.dist-info → superb_ai_onprem-0.3.8.dist-info}/licenses/LICENSE +0 -0
- {superb_ai_onprem-0.3.6.dist-info → superb_ai_onprem-0.3.8.dist-info}/top_level.txt +0 -0
spb_onprem/_version.py
CHANGED
spb_onprem/contents/service.py
CHANGED
|
@@ -3,14 +3,14 @@ import requests
|
|
|
3
3
|
import json
|
|
4
4
|
|
|
5
5
|
from io import BytesIO
|
|
6
|
-
from typing import Optional, Union
|
|
6
|
+
from typing import Optional, Tuple, Union
|
|
7
7
|
|
|
8
8
|
from spb_onprem.base_service import BaseService
|
|
9
9
|
from spb_onprem.base_types import (
|
|
10
10
|
Undefined,
|
|
11
11
|
UndefinedType,
|
|
12
12
|
)
|
|
13
|
-
from .entities import
|
|
13
|
+
from .entities import BaseContent, Content
|
|
14
14
|
from .queries import Queries
|
|
15
15
|
|
|
16
16
|
|
|
@@ -20,6 +20,34 @@ class ContentService(BaseService):
|
|
|
20
20
|
Content service is the service that handles the content operations.
|
|
21
21
|
"""
|
|
22
22
|
|
|
23
|
+
def create_content(
|
|
24
|
+
self,
|
|
25
|
+
key: Union[
|
|
26
|
+
str,
|
|
27
|
+
UndefinedType
|
|
28
|
+
] = Undefined,
|
|
29
|
+
content_type: Union[
|
|
30
|
+
str,
|
|
31
|
+
UndefinedType
|
|
32
|
+
] = Undefined,
|
|
33
|
+
) -> Tuple[Content, str]:
|
|
34
|
+
'''
|
|
35
|
+
Creates a new content.
|
|
36
|
+
Args:
|
|
37
|
+
key (Optional[str]):
|
|
38
|
+
An optional key to associate with the uploaded content.
|
|
39
|
+
content_type (Optional[str]):
|
|
40
|
+
An optional content type to associate with the uploaded content.
|
|
41
|
+
Returns:
|
|
42
|
+
str: The upload URL for the content.
|
|
43
|
+
'''
|
|
44
|
+
response = self.request_gql(
|
|
45
|
+
query=Queries.CREATE,
|
|
46
|
+
variables=Queries.CREATE["variables"](key, content_type)
|
|
47
|
+
)
|
|
48
|
+
content = Content.model_validate(response['content'])
|
|
49
|
+
return content, response['uploadURL']
|
|
50
|
+
|
|
23
51
|
def upload_content(
|
|
24
52
|
self,
|
|
25
53
|
file_path: str,
|
spb_onprem/data/service.py
CHANGED
|
@@ -442,6 +442,23 @@ class DataService(BaseService):
|
|
|
442
442
|
data = Data.model_validate(response)
|
|
443
443
|
return data
|
|
444
444
|
|
|
445
|
+
def create_data(
|
|
446
|
+
self,
|
|
447
|
+
data: Data,
|
|
448
|
+
)-> Data:
|
|
449
|
+
"""Create a data.
|
|
450
|
+
Args:
|
|
451
|
+
data (Data): The data to create.
|
|
452
|
+
|
|
453
|
+
Returns:
|
|
454
|
+
Data: The created data object.
|
|
455
|
+
"""
|
|
456
|
+
response = self.request_gql(
|
|
457
|
+
Queries.CREATE,
|
|
458
|
+
Queries.CREATE["variables"](data)
|
|
459
|
+
)
|
|
460
|
+
return Data.model_validate(response)
|
|
461
|
+
|
|
445
462
|
def create_image_data(
|
|
446
463
|
self,
|
|
447
464
|
dataset_id: str,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
spb_onprem/__init__.py,sha256=luroRpOs-soHW_qKNeRzkpRR64KXxKPfcpC-wQO4h60,1861
|
|
2
|
-
spb_onprem/_version.py,sha256=
|
|
2
|
+
spb_onprem/_version.py,sha256=gHWHfHNAKBB_bBMbV4M8RamJgUj-nflRcHf1dqqQ_W8,511
|
|
3
3
|
spb_onprem/base_model.py,sha256=XLtyoxRBs68LrvbFH8V4EvQGPc2W17koC310MnS37jc,442
|
|
4
4
|
spb_onprem/base_service.py,sha256=dPfr3mGXYlqadOXycu6RBFX1HcZ1qzEsskLoOxERLOU,5737
|
|
5
5
|
spb_onprem/base_types.py,sha256=5HO6uy6qf08b4KSElwIaGy7UkoQG2KqVO6gcHbsqqSo,269
|
|
@@ -23,13 +23,13 @@ spb_onprem/activities/params/update_activity.py,sha256=QU3h2YkPFkqHEHXv6078V2PWE
|
|
|
23
23
|
spb_onprem/activities/params/update_activity_history.py,sha256=ScWxOG7pZ-7WcTzvJleZIm-TsZVTRkwNrTCyNDyyVSc,1620
|
|
24
24
|
spb_onprem/contents/__init__.py,sha256=9EfIMQxbJuUZVUqsTa3Ji-yDidFPQQB5gnJI4R01YWI,74
|
|
25
25
|
spb_onprem/contents/queries.py,sha256=NwQYf0wNlNT5s5MTEMaAEHFPsXFE7_qsws2UPT8vOXs,1502
|
|
26
|
-
spb_onprem/contents/service.py,sha256=
|
|
26
|
+
spb_onprem/contents/service.py,sha256=a_Y_l18sULozh14obwAsEJG9x2BLSAgerqCNCf5TH2Q,5024
|
|
27
27
|
spb_onprem/contents/entities/__init__.py,sha256=HsQ9J8UDxCx4xYTdMKQto7HCVUQilNozQCkIsceWezk,117
|
|
28
28
|
spb_onprem/contents/entities/base_content.py,sha256=nM7NALpeRjtUKPv7eU0-hlqT1rPtD2mwB6Bvv_2Zc1E,346
|
|
29
29
|
spb_onprem/contents/entities/content.py,sha256=YhTGHE9ykiOgFjvxbnLzSLg2665jPYrDATteB9PbGPE,534
|
|
30
30
|
spb_onprem/data/__init__.py,sha256=5XKxNm2BlKufrX5uRQreUEzJ-nerTrozKpG1RJL5wt8,68
|
|
31
31
|
spb_onprem/data/queries.py,sha256=iAs-RpVP1sLAwOCQdQQh2FAOJ_PJES7ZIhIWq2mU55M,8886
|
|
32
|
-
spb_onprem/data/service.py,sha256=
|
|
32
|
+
spb_onprem/data/service.py,sha256=D9li4HT83f-pDLJpOfPouBbhQizPiWrju0OITxhiqjc,15843
|
|
33
33
|
spb_onprem/data/entities/__init__.py,sha256=xqhb0FqYC-n6JF0v10YoaENpz10c2DReG5S2SIY681M,287
|
|
34
34
|
spb_onprem/data/entities/annotation.py,sha256=WbKRkNao60xTwRKchmcWfw4zRDwu-VBuo-Zgu2ArtN4,676
|
|
35
35
|
spb_onprem/data/entities/data.py,sha256=bi8EsfPirMR0d5SV_KrYGh0BmoMdbt38x6DArxDz2gU,1148
|
|
@@ -93,7 +93,7 @@ spb_onprem/slices/params/update_slice.py,sha256=kryOmCnRTQ_OU0qDKgugppLrpeUpuLwm
|
|
|
93
93
|
spb_onprem/users/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
94
94
|
spb_onprem/users/entities/__init__.py,sha256=X8HZsCTlQnuPszok3AwI-i7bsQi0Ehul5L_2jZaol5E,57
|
|
95
95
|
spb_onprem/users/entities/auth.py,sha256=_KP-7yUErBxhJMm-dE3ObprPEG6e0JI2qNg6g8aK1qM,3371
|
|
96
|
-
superb_ai_onprem-0.3.
|
|
96
|
+
superb_ai_onprem-0.3.8.dist-info/licenses/LICENSE,sha256=CdinbFiHKGkGl6cPde6WgXhMuzyUXEG6tzy2-7udZ8o,1066
|
|
97
97
|
tests/__init__.py,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
|
|
98
98
|
tests/activities/__init__.py,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
|
|
99
99
|
tests/activities/real_test.py,sha256=0gQHg7rIEuZndGZyNHMWSD5nUZPMsUGigfCjWFxMthQ,1786
|
|
@@ -106,7 +106,7 @@ tests/exports/test_entities.py,sha256=hG7G4kVkyHKT3mv4lvrzUqOW8ILeHiYj87QZjQcmg9
|
|
|
106
106
|
tests/exports/test_integration.py,sha256=cCcEgwIIHyQRlc04EAXSKz7RcblQvhI2GBR3uVaOOq8,6201
|
|
107
107
|
tests/exports/test_params.py,sha256=oRRa6nEru_FImlB3TrmFiBidz6ZstCx4rVaCK-EMGfQ,11070
|
|
108
108
|
tests/exports/test_service.py,sha256=IDcKxrmByh00jk9142P2ThuGureMoijTHNdU0rERGG8,14628
|
|
109
|
-
superb_ai_onprem-0.3.
|
|
110
|
-
superb_ai_onprem-0.3.
|
|
111
|
-
superb_ai_onprem-0.3.
|
|
112
|
-
superb_ai_onprem-0.3.
|
|
109
|
+
superb_ai_onprem-0.3.8.dist-info/METADATA,sha256=TJoVEJelrE_lY6JNkcQMlHtE0okNiclZ0Vcnkj17nSQ,5817
|
|
110
|
+
superb_ai_onprem-0.3.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
111
|
+
superb_ai_onprem-0.3.8.dist-info/top_level.txt,sha256=LbqU6FjWKaxO7FPS5-71e3OIS8VgBi5VrtQMWFOW25Q,17
|
|
112
|
+
superb_ai_onprem-0.3.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|