craft-ai-sdk 0.61.1__py3-none-any.whl → 0.62.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.
- craft_ai_sdk/__init__.py +1 -1
- craft_ai_sdk/core/vector_database.py +41 -0
- craft_ai_sdk/sdk.py +6 -2
- {craft_ai_sdk-0.61.1.dist-info → craft_ai_sdk-0.62.0rc1.dist-info}/METADATA +2 -1
- {craft_ai_sdk-0.61.1.dist-info → craft_ai_sdk-0.62.0rc1.dist-info}/RECORD +9 -9
- documentation.pdf +0 -0
- {craft_ai_sdk-0.61.1.dist-info → craft_ai_sdk-0.62.0rc1.dist-info}/LICENSE +0 -0
- {craft_ai_sdk-0.61.1.dist-info → craft_ai_sdk-0.62.0rc1.dist-info}/WHEEL +0 -0
- {craft_ai_sdk-0.61.1.dist-info → craft_ai_sdk-0.62.0rc1.dist-info}/entry_points.txt +0 -0
craft_ai_sdk/__init__.py
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
from craft_ai_sdk.shared.environments import get_environment_id
|
|
2
2
|
|
|
3
3
|
from ..sdk import BaseCraftAiSdk
|
|
4
|
+
from ..shared.logger import log_action, log_func_result
|
|
5
|
+
|
|
6
|
+
import weaviate
|
|
4
7
|
|
|
5
8
|
|
|
6
9
|
def get_vector_database_credentials(sdk: BaseCraftAiSdk):
|
|
@@ -19,3 +22,41 @@ def get_vector_database_credentials(sdk: BaseCraftAiSdk):
|
|
|
19
22
|
)
|
|
20
23
|
|
|
21
24
|
return sdk._get(vector_database_url)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@log_func_result("Connecting to Weaviate")
|
|
28
|
+
def get_weaviate_client(sdk: BaseCraftAiSdk):
|
|
29
|
+
"""Get the Weaviate client.
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
:obj:`weaviate.WeaviateClient`: The Weaviate client.
|
|
33
|
+
"""
|
|
34
|
+
credentials = get_vector_database_credentials(sdk)
|
|
35
|
+
|
|
36
|
+
is_secure = credentials["vector_database_url"].startswith("https://")
|
|
37
|
+
|
|
38
|
+
vector_database_url = (
|
|
39
|
+
credentials["vector_database_url"]
|
|
40
|
+
.replace("http://", "")
|
|
41
|
+
.replace("https://", "")
|
|
42
|
+
).rstrip("/")
|
|
43
|
+
|
|
44
|
+
log_action(sdk, "Connecting to Weaviate")
|
|
45
|
+
|
|
46
|
+
weaviate_client = weaviate.connect_to_custom(
|
|
47
|
+
http_host=vector_database_url,
|
|
48
|
+
http_port=8080,
|
|
49
|
+
grpc_host=vector_database_url,
|
|
50
|
+
grpc_port=8082,
|
|
51
|
+
http_secure=is_secure,
|
|
52
|
+
grpc_secure=is_secure,
|
|
53
|
+
headers={
|
|
54
|
+
"craft-vector-database-token": credentials["vector_database_token"],
|
|
55
|
+
"craft-vector-database-url": credentials["vector_database_url"],
|
|
56
|
+
},
|
|
57
|
+
auth_credentials=None,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
log_action(sdk, "Connected to Weaviate, using version", weaviate.__version__)
|
|
61
|
+
|
|
62
|
+
return weaviate_client
|
craft_ai_sdk/sdk.py
CHANGED
|
@@ -116,7 +116,11 @@ class CraftAiSdk(BaseCraftAiSdk):
|
|
|
116
116
|
list_steps,
|
|
117
117
|
)
|
|
118
118
|
from .core.users import get_user
|
|
119
|
-
|
|
119
|
+
|
|
120
|
+
from .core.vector_database import (
|
|
121
|
+
get_vector_database_credentials,
|
|
122
|
+
get_weaviate_client,
|
|
123
|
+
)
|
|
120
124
|
|
|
121
125
|
# Size (in bytes) from which datastore upload will switch to multipart
|
|
122
126
|
# AWS: minimum part size is 5MiB
|
|
@@ -132,7 +136,7 @@ class CraftAiSdk(BaseCraftAiSdk):
|
|
|
132
136
|
os.environ.get("CRAFT_AI__MULTIPART_PART_SIZE__B", str(38 * 256 * 1024))
|
|
133
137
|
)
|
|
134
138
|
_access_token_margin = timedelta(seconds=30)
|
|
135
|
-
_version = "0.
|
|
139
|
+
_version = "0.62.0rc1" # Would be better to share it somewhere
|
|
136
140
|
|
|
137
141
|
def __init__(
|
|
138
142
|
self,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: craft-ai-sdk
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.62.0rc1
|
|
4
4
|
Summary: Craft AI MLOps platform SDK
|
|
5
5
|
Home-page: https://www.craft.ai/
|
|
6
6
|
License: Apache-2.0
|
|
@@ -13,6 +13,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Provides-Extra: full
|
|
16
17
|
Requires-Dist: PyJWT (>=2.3.0,<3.0.0)
|
|
17
18
|
Requires-Dist: StrEnum (>=0.4.9,<0.5.0)
|
|
18
19
|
Requires-Dist: requests (>=2.27.1,<3.0.0)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
craft_ai_sdk/__init__.py,sha256=
|
|
1
|
+
craft_ai_sdk/__init__.py,sha256=MVFZ2jBU_33IVZbAgCNdllJe31oKKPVbwxxH9dpvBTs,366
|
|
2
2
|
craft_ai_sdk/constants.py,sha256=rH4JrGlTpbjjjNRrKhk5oScbj5G5INrcVza6Bb6kIzY,980
|
|
3
3
|
craft_ai_sdk/core/data_store.py,sha256=Q8eNYaiSmS6tWmEUTIYwS5hkMCfye0JNW0cU9QtfsoM,8560
|
|
4
4
|
craft_ai_sdk/core/deployments.py,sha256=k3Eb3axVlZKJigOMy6PAozWxOzd0pZDy2d5nkGwSz34,34803
|
|
@@ -10,10 +10,10 @@ craft_ai_sdk/core/pipelines.py,sha256=-lGP6ynV_rGJf4fi9dzKNNl5JfMgsylOjBeE2Y0iuY
|
|
|
10
10
|
craft_ai_sdk/core/resource_metrics.py,sha256=DsvlHNFabXobYnt52w7FS_V95KRGqZu9HWFpkpYsb6Y,2333
|
|
11
11
|
craft_ai_sdk/core/steps.py,sha256=qOyULKzYfiyLwOxRU0Z6Zz--PYLJxK4RkTLC3RrP8ZU,20953
|
|
12
12
|
craft_ai_sdk/core/users.py,sha256=Qi3xg7Vzk_0MepccNIZbFzjI0bBqouqkFStTuejUY6s,509
|
|
13
|
-
craft_ai_sdk/core/vector_database.py,sha256=
|
|
13
|
+
craft_ai_sdk/core/vector_database.py,sha256=kUND4rpLSzCvn9O_7Xs6Ld-xhnB9nmDKAJntXP2HrYQ,1894
|
|
14
14
|
craft_ai_sdk/exceptions.py,sha256=IC-JfZmmmaTsbMCgirOEByRmWnatQLjKe8BErRkuwM0,1075
|
|
15
15
|
craft_ai_sdk/io.py,sha256=dbXAa6T1dR3V93PA_ctLY-UWzxfeI6pz2nDooLO58b0,12656
|
|
16
|
-
craft_ai_sdk/sdk.py,sha256=
|
|
16
|
+
craft_ai_sdk/sdk.py,sha256=m_6xnCrTnHjtNpsYMnFqwEiC8Ba34Bh7fPy9M0TvMiY,10615
|
|
17
17
|
craft_ai_sdk/shared/authentication.py,sha256=z0wVkl1P-P8Hod06T4vYLq0P2o0ZCxStpX2dEaHANWs,774
|
|
18
18
|
craft_ai_sdk/shared/environments.py,sha256=IjLZYcL3eyOn_H0j3c05KZBCWcZJVlHf4-N3BupOOTc,494
|
|
19
19
|
craft_ai_sdk/shared/execution_context.py,sha256=B2Ghq-wiUvq81q5mhsm79Oc59c8c00uQxMIpApFD03o,585
|
|
@@ -25,9 +25,9 @@ craft_ai_sdk/utils/__init__.py,sha256=A0sLCXSPD1Z3q2GP1uLDjvif4ivOr__Hzg9RQysEuq
|
|
|
25
25
|
craft_ai_sdk/utils/datetime_utils.py,sha256=QpI2YgHDKbp7yHqvImDuZeSbtQWZDlGDGKR1AehA6x0,650
|
|
26
26
|
craft_ai_sdk/utils/dict_utils.py,sha256=geLcoBg5CPNqrPRm4jSf7MFym5r882QFyNz-4xKzYz8,742
|
|
27
27
|
craft_ai_sdk/utils/file_utils.py,sha256=rspzONrXhiaKYvkY54m0_yKDAYnaun09jvglzsZt0ro,2117
|
|
28
|
-
documentation.pdf,sha256=
|
|
29
|
-
craft_ai_sdk-0.
|
|
30
|
-
craft_ai_sdk-0.
|
|
31
|
-
craft_ai_sdk-0.
|
|
32
|
-
craft_ai_sdk-0.
|
|
33
|
-
craft_ai_sdk-0.
|
|
28
|
+
documentation.pdf,sha256=0sxjjEhfuJTsgMRFTyDVUR831r9HT3D26jwx07UUKLA,338835
|
|
29
|
+
craft_ai_sdk-0.62.0rc1.dist-info/LICENSE,sha256=_2oYRJic9lZK05LceuJ9aZZw5mPHYc1WQhJiVS-oGFU,10754
|
|
30
|
+
craft_ai_sdk-0.62.0rc1.dist-info/METADATA,sha256=cGteO29GQAvrkNV6EfBkbcfi6miXG78LEYXeObutLkg,1588
|
|
31
|
+
craft_ai_sdk-0.62.0rc1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
32
|
+
craft_ai_sdk-0.62.0rc1.dist-info/entry_points.txt,sha256=eV9YD0zCAb88_wNMDV99sRxVKVC-WOQF3b1Pepaytcg,385
|
|
33
|
+
craft_ai_sdk-0.62.0rc1.dist-info/RECORD,,
|
documentation.pdf
CHANGED
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|