hiddenlayer-sdk 2.0.9__py3-none-any.whl → 2.0.10__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.
- hiddenlayer/__init__.py +11 -2
- hiddenlayer/sdk/version.py +1 -1
- {hiddenlayer_sdk-2.0.9.dist-info → hiddenlayer_sdk-2.0.10.dist-info}/METADATA +1 -1
- {hiddenlayer_sdk-2.0.9.dist-info → hiddenlayer_sdk-2.0.10.dist-info}/RECORD +7 -7
- {hiddenlayer_sdk-2.0.9.dist-info → hiddenlayer_sdk-2.0.10.dist-info}/WHEEL +0 -0
- {hiddenlayer_sdk-2.0.9.dist-info → hiddenlayer_sdk-2.0.10.dist-info}/licenses/LICENSE +0 -0
- {hiddenlayer_sdk-2.0.9.dist-info → hiddenlayer_sdk-2.0.10.dist-info}/top_level.txt +0 -0
hiddenlayer/__init__.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import os
|
2
2
|
from typing import Callable, Optional
|
3
|
+
from urllib.parse import urljoin
|
3
4
|
|
4
5
|
import requests
|
5
6
|
from requests.auth import HTTPBasicAuth
|
@@ -33,8 +34,13 @@ class HiddenlayerServiceClient:
|
|
33
34
|
api_id: Optional[str] = None,
|
34
35
|
api_key: Optional[str] = None,
|
35
36
|
host: str = "https://api.us.hiddenlayer.ai",
|
37
|
+
auth_url: Optional[str] = None,
|
36
38
|
):
|
37
39
|
self.host = host.strip()
|
40
|
+
if auth_url:
|
41
|
+
self.auth_url = auth_url.strip()
|
42
|
+
else:
|
43
|
+
self.auth_url = None
|
38
44
|
self.is_saas = is_saas(host)
|
39
45
|
refresh_jwt_func: Optional[Callable[[], str]] = None
|
40
46
|
|
@@ -65,9 +71,12 @@ class HiddenlayerServiceClient:
|
|
65
71
|
def _get_jwt(self, *, api_id: str, api_key: str) -> str:
|
66
72
|
"Get the JWT token to auth to the Hiddenlayer API."
|
67
73
|
|
68
|
-
|
74
|
+
if self.auth_url:
|
75
|
+
auth_url = self.auth_url
|
76
|
+
else:
|
77
|
+
auth_url = os.getenv("HL_AUTH_URL", "https://auth.hiddenlayer.ai")
|
69
78
|
|
70
|
-
token_url =
|
79
|
+
token_url = urljoin(auth_url, "/oauth2/token?grant_type=client_credentials")
|
71
80
|
|
72
81
|
resp = requests.post(token_url, auth=HTTPBasicAuth(api_id, api_key))
|
73
82
|
|
hiddenlayer/sdk/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
VERSION = "2.0.
|
1
|
+
VERSION = "2.0.10"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: hiddenlayer-sdk
|
3
|
-
Version: 2.0.
|
3
|
+
Version: 2.0.10
|
4
4
|
Summary: Official HiddenLayer Python SDK
|
5
5
|
Author-email: HiddenLayer Integrations Team <integrations@hiddenlayer.com>
|
6
6
|
Maintainer-email: HiddenLayer Integrations Team <integrations@hiddenlayer.com>
|
@@ -1,10 +1,10 @@
|
|
1
|
-
hiddenlayer/__init__.py,sha256=
|
1
|
+
hiddenlayer/__init__.py,sha256=YGc00rA_UkheVMkpn5MsYuHvmUzE1Sl9OZoqLtQ1nBU,3696
|
2
2
|
hiddenlayer/sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
hiddenlayer/sdk/constants.py,sha256=BytOHlVWk6lhWB4bpT7kDj3ctozZA9ftaB2D6lSGtGI,628
|
4
4
|
hiddenlayer/sdk/exceptions.py,sha256=_Lelwk32LWxWuUPglfw8R8RuiX_Uxm_N7TP3BLhDLz0,226
|
5
5
|
hiddenlayer/sdk/models.py,sha256=t92fK7xxuPm1XzazNsRg5AOAD17qnvNZiGaN1gM6lHk,1776
|
6
6
|
hiddenlayer/sdk/utils.py,sha256=Ntao8hfsYuB7obZOanayIlrgJ98IWcPhs3sRi39IDkg,2997
|
7
|
-
hiddenlayer/sdk/version.py,sha256=
|
7
|
+
hiddenlayer/sdk/version.py,sha256=cvebPKJg8pP9aW2gMv6ZYLVFFp-UJVx7GaaCBql0ReY,19
|
8
8
|
hiddenlayer/sdk/rest/__init__.py,sha256=fL2dURfsADiHHxdxxbUyjrqQi5BPRVdd9p51XPrJhks,8499
|
9
9
|
hiddenlayer/sdk/rest/api_client.py,sha256=Yd71Up1SHj5pPp4jB_gIsm5Y77jHph7T4iU9NiIhUak,26291
|
10
10
|
hiddenlayer/sdk/rest/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
|
@@ -119,8 +119,8 @@ hiddenlayer/sdk/rest/models/web_response.py,sha256=gSKHygOE25yvLKMk__Aga90cHfpFx
|
|
119
119
|
hiddenlayer/sdk/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
120
120
|
hiddenlayer/sdk/services/aidr_predictive.py,sha256=S2MvN5qPyYhYXbYM3lvDmylhY71p4d07L36m-a1ZMyM,4773
|
121
121
|
hiddenlayer/sdk/services/model_scan.py,sha256=hJzvt8EjpJ4EKPnde_Mql-X8T32itIE2qUITSma6d3o,18988
|
122
|
-
hiddenlayer_sdk-2.0.
|
123
|
-
hiddenlayer_sdk-2.0.
|
124
|
-
hiddenlayer_sdk-2.0.
|
125
|
-
hiddenlayer_sdk-2.0.
|
126
|
-
hiddenlayer_sdk-2.0.
|
122
|
+
hiddenlayer_sdk-2.0.10.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
123
|
+
hiddenlayer_sdk-2.0.10.dist-info/METADATA,sha256=I-0WsMT3esstIudfXcC6KSd7KDpBOtteLCmb-KSxLyE,18154
|
124
|
+
hiddenlayer_sdk-2.0.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
125
|
+
hiddenlayer_sdk-2.0.10.dist-info/top_level.txt,sha256=8BxcmGvEN1RqsMvTWg9Q0vDmtBGcTmatnme6nzyPj2U,12
|
126
|
+
hiddenlayer_sdk-2.0.10.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|