craft-ai-sdk 0.67.1rc1__py3-none-any.whl → 0.68.0rc1__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 craft-ai-sdk might be problematic. Click here for more details.
- craft_ai_sdk/__init__.py +1 -1
- craft_ai_sdk/core/data_store.py +1 -1
- craft_ai_sdk/core/endpoints.py +11 -8
- craft_ai_sdk/core/pipelines.py +6 -6
- craft_ai_sdk/sdk.py +1 -1
- {craft_ai_sdk-0.67.1rc1.dist-info → craft_ai_sdk-0.68.0rc1.dist-info}/METADATA +1 -1
- {craft_ai_sdk-0.67.1rc1.dist-info → craft_ai_sdk-0.68.0rc1.dist-info}/RECORD +10 -10
- {craft_ai_sdk-0.67.1rc1.dist-info → craft_ai_sdk-0.68.0rc1.dist-info}/LICENSE +0 -0
- {craft_ai_sdk-0.67.1rc1.dist-info → craft_ai_sdk-0.68.0rc1.dist-info}/WHEEL +0 -0
- {craft_ai_sdk-0.67.1rc1.dist-info → craft_ai_sdk-0.68.0rc1.dist-info}/entry_points.txt +0 -0
craft_ai_sdk/__init__.py
CHANGED
craft_ai_sdk/core/data_store.py
CHANGED
craft_ai_sdk/core/endpoints.py
CHANGED
|
@@ -199,15 +199,18 @@ def retrieve_endpoint_results(
|
|
|
199
199
|
if isinstance(value, dict) and "value" in value:
|
|
200
200
|
outputs[key] = value["value"]
|
|
201
201
|
if isinstance(value, dict) and "url" in value:
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
file_response = requests.get(url)
|
|
205
|
-
if file_response.status_code == 200:
|
|
206
|
-
outputs[key] = file_response.content
|
|
202
|
+
if not isinstance(value["url"], str):
|
|
203
|
+
outputs[key] = None
|
|
207
204
|
else:
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
)
|
|
205
|
+
# If the output is a file, we need to download it
|
|
206
|
+
url = f"{value['url']}?token={endpoint_token}"
|
|
207
|
+
file_response = requests.get(url)
|
|
208
|
+
if file_response.status_code == 200:
|
|
209
|
+
outputs[key] = file_response.content
|
|
210
|
+
else:
|
|
211
|
+
raise ValueError(
|
|
212
|
+
f"Failed to download file output {key}: {file_response.text}"
|
|
213
|
+
)
|
|
211
214
|
|
|
212
215
|
return {
|
|
213
216
|
"outputs": response_data.get("outputs", []),
|
craft_ai_sdk/core/pipelines.py
CHANGED
|
@@ -84,16 +84,14 @@ def _create_pipeline_from_template(
|
|
|
84
84
|
|
|
85
85
|
def _create_pipeline_with_step(
|
|
86
86
|
sdk: BaseCraftAiSdk, pipeline_name: str, step_name: str
|
|
87
|
-
) ->
|
|
87
|
+
) -> None:
|
|
88
88
|
url = f"{sdk.base_environment_api_url}/pipelines"
|
|
89
89
|
body = {
|
|
90
90
|
"pipeline_name": pipeline_name,
|
|
91
91
|
"step_names": [step_name],
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
sdk._post(url, json=body), {"is_archived", "pipeline_id"}
|
|
96
|
-
)
|
|
94
|
+
sdk._post(url, json=body)
|
|
97
95
|
|
|
98
96
|
|
|
99
97
|
@overload
|
|
@@ -337,7 +335,8 @@ def create_pipeline(
|
|
|
337
335
|
FutureWarning,
|
|
338
336
|
stacklevel=2,
|
|
339
337
|
)
|
|
340
|
-
|
|
338
|
+
_create_pipeline_with_step(sdk, pipeline_name, function_path)
|
|
339
|
+
return get_pipeline(sdk, pipeline_name, wait_for_completion, timeout_s)
|
|
341
340
|
|
|
342
341
|
# or with create_pipeline(:pipeline_name:, step_name=:step_name:).
|
|
343
342
|
if "step_name" in kwargs:
|
|
@@ -348,7 +347,8 @@ def create_pipeline(
|
|
|
348
347
|
"should be provided."
|
|
349
348
|
)
|
|
350
349
|
|
|
351
|
-
|
|
350
|
+
_create_pipeline_with_step(sdk, pipeline_name, kwargs["step_name"])
|
|
351
|
+
return get_pipeline(sdk, pipeline_name, wait_for_completion, timeout_s)
|
|
352
352
|
|
|
353
353
|
if len(kwargs) != 0:
|
|
354
354
|
raise ValueError(
|
craft_ai_sdk/sdk.py
CHANGED
|
@@ -141,7 +141,7 @@ class CraftAiSdk(BaseCraftAiSdk):
|
|
|
141
141
|
os.environ.get("CRAFT_AI__MULTIPART_PART_SIZE__B", str(38 * 256 * 1024))
|
|
142
142
|
)
|
|
143
143
|
_access_token_margin = timedelta(seconds=30)
|
|
144
|
-
_version = "0.
|
|
144
|
+
_version = "0.68.0rc1" # Would be better to share it somewhere
|
|
145
145
|
|
|
146
146
|
def __init__(
|
|
147
147
|
self,
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
craft_ai_sdk/__init__.py,sha256=
|
|
1
|
+
craft_ai_sdk/__init__.py,sha256=PmZ7jK4ktFe0Vc6ojwajH4aHLHFmR-CBReXEajvn2v4,366
|
|
2
2
|
craft_ai_sdk/constants.py,sha256=rH4JrGlTpbjjjNRrKhk5oScbj5G5INrcVza6Bb6kIzY,980
|
|
3
|
-
craft_ai_sdk/core/data_store.py,sha256=
|
|
3
|
+
craft_ai_sdk/core/data_store.py,sha256=BPQalGcm6bujgkgu-MtNWWhKiJEg4MiVuCtByNbTbK8,9956
|
|
4
4
|
craft_ai_sdk/core/deployments.py,sha256=Hig0Z6tZXbaLxms9ENtKI4OG3ki7G4Iz3wGk2V2Gmfg,37731
|
|
5
|
-
craft_ai_sdk/core/endpoints.py,sha256=
|
|
5
|
+
craft_ai_sdk/core/endpoints.py,sha256=cFf8scftD7XlMvpglLNRew-fesLUC_TcZ2UPyCbmUaA,8158
|
|
6
6
|
craft_ai_sdk/core/environment_variables.py,sha256=CpkyneLf8UF-1QXe36Ay_RZJ8grSfbZZWBvGSQzKlLs,2221
|
|
7
7
|
craft_ai_sdk/core/pipeline_executions.py,sha256=EfhNDzWiKro9-gDUPHJFMFcdPXtznlJo2leFKLloDmA,18709
|
|
8
8
|
craft_ai_sdk/core/pipeline_metrics.py,sha256=AYxF5HpLCfTYK-TydEHswaAHat3N9NiOTHpPd_R9-rY,7190
|
|
9
9
|
craft_ai_sdk/core/pipeline_templates.py,sha256=3WjM4vsURpTNF3dt42h_xk68ysxFkz4kiOxqAb4VyRE,5623
|
|
10
|
-
craft_ai_sdk/core/pipelines.py,sha256=
|
|
10
|
+
craft_ai_sdk/core/pipelines.py,sha256=FD6ai2_YhE1tz6QO57bj_lA-i93TXZzm0Y9PA0mpocg,26587
|
|
11
11
|
craft_ai_sdk/core/resource_metrics.py,sha256=ubCe6QOhud3f-EQr_TXKBsrFFaxZubqTS3fZqfV7kgg,3457
|
|
12
12
|
craft_ai_sdk/core/steps.py,sha256=TwOWXAAVpLPuSZ_gvf-3E5uKEvfGIzR52Y58bqKn_Ds,23487
|
|
13
13
|
craft_ai_sdk/core/users.py,sha256=q5et87q0SOMpRTBOiLX026oaEOTaY1aGqKdbUC51zbA,618
|
|
14
14
|
craft_ai_sdk/core/vector_database.py,sha256=S3h68Ej1FnHYJdc5LdLlNjobYYdmaCloSq2UaylPWko,2334
|
|
15
15
|
craft_ai_sdk/exceptions.py,sha256=IC-JfZmmmaTsbMCgirOEByRmWnatQLjKe8BErRkuwM0,1075
|
|
16
16
|
craft_ai_sdk/io.py,sha256=x1G7ga10W_SeTDLHe-FrhU26_WNwWW32-yprMmCZ5Ck,11836
|
|
17
|
-
craft_ai_sdk/sdk.py,sha256=
|
|
17
|
+
craft_ai_sdk/sdk.py,sha256=Ruica7u91TsK4D8_db149u8-dYAuLaPq2Q4QFao_kQI,11031
|
|
18
18
|
craft_ai_sdk/shared/authentication.py,sha256=5lJS_aNphkgI0-wvHFK4aW316ZRfOq9oywNpv-Oyn2M,1062
|
|
19
19
|
craft_ai_sdk/shared/environments.py,sha256=JOV3s0KIFVl_zskJb--bybzIXEGQJjrf_T4dL-szSlQ,500
|
|
20
20
|
craft_ai_sdk/shared/execution_context.py,sha256=B2Ghq-wiUvq81q5mhsm79Oc59c8c00uQxMIpApFD03o,585
|
|
@@ -27,8 +27,8 @@ craft_ai_sdk/utils/__init__.py,sha256=A0sLCXSPD1Z3q2GP1uLDjvif4ivOr__Hzg9RQysEuq
|
|
|
27
27
|
craft_ai_sdk/utils/datetime_utils.py,sha256=yYP5HVdI879WXxQCajPTnas1pWrwInOxMux-mxqQNQM,734
|
|
28
28
|
craft_ai_sdk/utils/dict_utils.py,sha256=1HQ3A14SN48XPFDmQleujGAgksmkjIs3hyPLpwhwh24,748
|
|
29
29
|
craft_ai_sdk/utils/file_utils.py,sha256=o10-CDt4qzgCJNPykvlNrL6WTouhVLY8C8BVpHJYt18,2795
|
|
30
|
-
craft_ai_sdk-0.
|
|
31
|
-
craft_ai_sdk-0.
|
|
32
|
-
craft_ai_sdk-0.
|
|
33
|
-
craft_ai_sdk-0.
|
|
34
|
-
craft_ai_sdk-0.
|
|
30
|
+
craft_ai_sdk-0.68.0rc1.dist-info/LICENSE,sha256=_2oYRJic9lZK05LceuJ9aZZw5mPHYc1WQhJiVS-oGFU,10754
|
|
31
|
+
craft_ai_sdk-0.68.0rc1.dist-info/METADATA,sha256=8ycWBge6n-ZB-gWXnPbERXuPQtMngyJh_QKOkKY5tAc,1679
|
|
32
|
+
craft_ai_sdk-0.68.0rc1.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
33
|
+
craft_ai_sdk-0.68.0rc1.dist-info/entry_points.txt,sha256=QC96WcXvvUfLMRgFD-l_y7_TgC9SqZybLs9EQ8dsGiQ,417
|
|
34
|
+
craft_ai_sdk-0.68.0rc1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|