hiddenlayer-sdk 0.1.0__py3-none-any.whl → 0.1.1__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 CHANGED
@@ -1,3 +1,4 @@
1
+ import os
1
2
  from typing import Optional
2
3
 
3
4
  import requests
@@ -34,6 +35,7 @@ class HiddenlayerServiceClient:
34
35
  api_key: Optional[str] = None,
35
36
  host: str = "https://api.us.hiddenlayer.ai",
36
37
  ):
38
+ self.host = host.strip()
37
39
  self.is_saas = is_saas(host)
38
40
 
39
41
  if self.is_saas:
@@ -48,10 +50,10 @@ class HiddenlayerServiceClient:
48
50
  )
49
51
 
50
52
  jwt_token = self._get_jwt(api_id=api_id, api_key=api_key)
51
- self._config = Configuration(host=host, access_token=jwt_token)
53
+ self._config = Configuration(host=self.host, access_token=jwt_token)
52
54
 
53
55
  else:
54
- self._config = Configuration(host=host)
56
+ self._config = Configuration(host=self.host)
55
57
 
56
58
  self._api_client = ApiClient(configuration=self._config)
57
59
  self._aidr_predictive = AIDRPredictive(self._api_client)
@@ -61,9 +63,9 @@ class HiddenlayerServiceClient:
61
63
  def _get_jwt(self, *, api_id: str, api_key: str) -> str:
62
64
  "Get the JWT token to auth to the Hiddenlayer API."
63
65
 
64
- token_url = (
65
- "https://auth.hiddenlayer.ai/oauth2/token?grant_type=client_credentials"
66
- )
66
+ auth_url = os.getenv("HL_AUTH_URL", "https://auth.hiddenlayer.ai")
67
+
68
+ token_url = f"{auth_url}/oauth2/token?grant_type=client_credentials"
67
69
 
68
70
  resp = requests.post(token_url, auth=HTTPBasicAuth(api_id, api_key))
69
71
 
@@ -1 +1 @@
1
- VERSION = "0.1.0"
1
+ VERSION = "0.1.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hiddenlayer-sdk
3
- Version: 0.1.0
3
+ Version: 0.1.1
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=mAKpkWz_-o4zqEOI7VAZjLDbWVo49uyGomWM5YPPdjQ,3493
1
+ hiddenlayer/__init__.py,sha256=Uik1ha6cV_6MkpB0zpKn6f7Zsw7q6W_sh3MgGq2M3vU,3582
2
2
  hiddenlayer/sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  hiddenlayer/sdk/constants.py,sha256=517WH-MCaedeOK2yXDfJvjmuqWSpRFvuQzV6e22-3jg,283
4
4
  hiddenlayer/sdk/exceptions.py,sha256=LNkD6AvSwNwQjnTDrvY152DmvPKzSejrBsIu-qI44Ec,225
5
5
  hiddenlayer/sdk/models.py,sha256=67PeGjNkJjyscKax4_pq7fggqVlOIrEXB6JXRKu0X3M,677
6
6
  hiddenlayer/sdk/utils.py,sha256=Ntao8hfsYuB7obZOanayIlrgJ98IWcPhs3sRi39IDkg,2997
7
- hiddenlayer/sdk/version.py,sha256=CpXi3jGlx23RvRyU7iytOMZrnspdWw4yofS8lpP1AJU,18
7
+ hiddenlayer/sdk/version.py,sha256=K4bqp4JdOs9KHYMltFboNleHcCgvR1V7uAJwB8wlYQw,18
8
8
  hiddenlayer/sdk/enterprise/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  hiddenlayer/sdk/enterprise/enterprise_model_scan_api.py,sha256=x3UBliOGK-YDuBP_td8XvrN6AhUgXgE4QbrJMvoqcmc,1827
10
10
  hiddenlayer/sdk/rest/__init__.py,sha256=Wp_tVOqz9n2PjXxFaotPNW7B_zQhXZxA7smnJa5uCes,2218
@@ -36,8 +36,8 @@ hiddenlayer/sdk/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
36
36
  hiddenlayer/sdk/services/aidr_predictive.py,sha256=aD2anFzWQzfLsR13NwwdQjt_X_iAlOkmss_yHy-154U,2958
37
37
  hiddenlayer/sdk/services/model.py,sha256=RTjZjMyhxVf61fIuHIsopL3OTwO7-PPuMfSFXYOv4R4,3045
38
38
  hiddenlayer/sdk/services/model_scan.py,sha256=VhTORL4-4kM4hs-s_Kdf_NvAKIOMS92HVW6Ymrqradg,15288
39
- hiddenlayer_sdk-0.1.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
40
- hiddenlayer_sdk-0.1.0.dist-info/METADATA,sha256=Y1gh2xzI0h9zxIaEAgngnETHA1-IwYEait7RjTkvEIo,16889
41
- hiddenlayer_sdk-0.1.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
42
- hiddenlayer_sdk-0.1.0.dist-info/top_level.txt,sha256=8BxcmGvEN1RqsMvTWg9Q0vDmtBGcTmatnme6nzyPj2U,12
43
- hiddenlayer_sdk-0.1.0.dist-info/RECORD,,
39
+ hiddenlayer_sdk-0.1.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
40
+ hiddenlayer_sdk-0.1.1.dist-info/METADATA,sha256=6Tbd4GQ53YfTamXPCQT9_TdgQoRZPeJtD68LXYDvv4w,16889
41
+ hiddenlayer_sdk-0.1.1.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
42
+ hiddenlayer_sdk-0.1.1.dist-info/top_level.txt,sha256=8BxcmGvEN1RqsMvTWg9Q0vDmtBGcTmatnme6nzyPj2U,12
43
+ hiddenlayer_sdk-0.1.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.2.0)
2
+ Generator: setuptools (72.2.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5