blaxel 0.2.7rc81__py3-none-any.whl → 0.2.7rc83__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.
@@ -12,6 +12,7 @@ from .types import BlaxelAuth, CredentialsType
12
12
 
13
13
  logger = getLogger(__name__)
14
14
 
15
+
15
16
  def get_credentials() -> Optional[CredentialsType]:
16
17
  """
17
18
  Get credentials from environment variables or config file.
@@ -19,35 +20,34 @@ def get_credentials() -> Optional[CredentialsType]:
19
20
  Returns:
20
21
  Optional[CredentialsType]: The credentials or None if not found
21
22
  """
23
+
22
24
  def get_workspace():
23
25
  if os.environ.get("BL_WORKSPACE"):
24
26
  return os.environ.get("BL_WORKSPACE")
25
27
  home_dir = Path.home()
26
- config_path = home_dir / '.blaxel' / 'config.yaml'
27
- with open(config_path, encoding='utf-8') as f:
28
+ config_path = home_dir / ".blaxel" / "config.yaml"
29
+ with open(config_path, encoding="utf-8") as f:
28
30
  config_json = yaml.safe_load(f)
29
31
  return config_json.get("context", {}).get("workspace")
30
32
 
31
33
  if os.environ.get("BL_API_KEY"):
32
- return CredentialsType(
33
- api_key=os.environ.get("BL_API_KEY"),
34
- workspace=get_workspace()
35
- )
34
+ return CredentialsType(api_key=os.environ.get("BL_API_KEY"), workspace=get_workspace())
36
35
 
37
36
  if os.environ.get("BL_CLIENT_CREDENTIALS"):
38
37
  return CredentialsType(
39
- client_credentials=os.environ.get("BL_CLIENT_CREDENTIALS"),
40
- workspace=get_workspace()
38
+ client_credentials=os.environ.get("BL_CLIENT_CREDENTIALS"), workspace=get_workspace()
41
39
  )
42
40
 
43
41
  try:
44
42
  home_dir = Path.home()
45
- config_path = home_dir / '.blaxel' / 'config.yaml'
43
+ config_path = home_dir / ".blaxel" / "config.yaml"
46
44
 
47
- with open(config_path, encoding='utf-8') as f:
45
+ with open(config_path, encoding="utf-8") as f:
48
46
  config_json = yaml.safe_load(f)
49
47
 
50
- workspace_name = os.environ.get("BL_WORKSPACE") or config_json.get("context", {}).get("workspace")
48
+ workspace_name = os.environ.get("BL_WORKSPACE") or config_json.get("context", {}).get(
49
+ "workspace"
50
+ )
51
51
 
52
52
  for workspace in config_json.get("workspaces", []):
53
53
  if workspace.get("name") == workspace_name:
@@ -55,12 +55,12 @@ def get_credentials() -> Optional[CredentialsType]:
55
55
  credentials["workspace"] = workspace_name
56
56
  return CredentialsType(
57
57
  workspace=credentials["workspace"],
58
- api_key=credentials.get("api_key"),
59
- client_credentials=credentials.get("client_credentials"),
58
+ api_key=credentials.get("apiKey"),
59
+ client_credentials=credentials.get("clientCredentials"),
60
60
  refresh_token=credentials.get("refresh_token"),
61
61
  access_token=credentials.get("access_token"),
62
62
  device_code=credentials.get("device_code"),
63
- expires_in=credentials.get("expires_in")
63
+ expires_in=credentials.get("expires_in"),
64
64
  )
65
65
 
66
66
  return None
@@ -94,4 +94,5 @@ def auth(env: str, base_url: str) -> BlaxelAuth:
94
94
 
95
95
  return BlaxelAuth(credentials, credentials.workspace, base_url)
96
96
 
97
- __all__ = ["BlaxelAuth", "CredentialsType"]
97
+
98
+ __all__ = ["BlaxelAuth", "CredentialsType"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: blaxel
3
- Version: 0.2.7rc81
3
+ Version: 0.2.7rc83
4
4
  Summary: Blaxel - AI development platform SDK
5
5
  Project-URL: Homepage, https://blaxel.ai
6
6
  Project-URL: Documentation, https://docs.blaxel.ai
@@ -2,7 +2,7 @@ blaxel/__init__.py,sha256=dK8RSbcDKSdr3Fr45aLDs6qPkLkxrsERQo24HCATbf4,241
2
2
  blaxel/core/__init__.py,sha256=OeRTi6S78PQiyrDMM8RjgLYbjXb3inTxW8Z6rrbg39w,1026
3
3
  blaxel/core/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  blaxel/core/agents/__init__.py,sha256=_mtes7ZRf2AXtGF4AWE13T0iHd0SMc0b03ypuX5k3TM,4088
5
- blaxel/core/authentication/__init__.py,sha256=tL9XKNCek5ixszTqjlKRBvidXMg4Nj6ODlBKlxxA9uk,3283
5
+ blaxel/core/authentication/__init__.py,sha256=7gK_yLclpI0oiK4ZiGRyA6l5yXkcKrYMnVLYCulV598,3262
6
6
  blaxel/core/authentication/apikey.py,sha256=n_5IA2y3wS_218R8N1Ic82Okhq6C69g_Tg4Pt5YSDnA,1250
7
7
  blaxel/core/authentication/clientcredentials.py,sha256=esxSfGUacO8D_hn9nAx7wQ0oG8D0VsjfUzrPAeui8oM,3928
8
8
  blaxel/core/authentication/devicemode.py,sha256=nCo9-y194L2XDt5_9FOSK36Nc7l6Oxz1NKJQk6g2ses,6019
@@ -402,7 +402,7 @@ blaxel/telemetry/instrumentation/map.py,sha256=PCzZJj39yiYVYJrxLBNP-NW-tjjYyTijw
402
402
  blaxel/telemetry/instrumentation/utils.py,sha256=KInMYZH-mu9_wvetmf0EmgrfN3Sw8IWk2Y95v2u90_U,1901
403
403
  blaxel/telemetry/log/log.py,sha256=RvQByRjZMoP_dRaAZu8oK6DTegsHs-xV4W-UIqis6CA,2461
404
404
  blaxel/telemetry/log/logger.py,sha256=NPAS3g82ryROjvc_DEZaTIfrcehoLEZoP-JkLxADxc0,4113
405
- blaxel-0.2.7rc81.dist-info/METADATA,sha256=TKd-AQuF-mNRdKj2eGVgJUXK-5riyZWpHExD8cEgpH0,9879
406
- blaxel-0.2.7rc81.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
407
- blaxel-0.2.7rc81.dist-info/licenses/LICENSE,sha256=p5PNQvpvyDT_0aYBDgmV1fFI_vAD2aSV0wWG7VTgRis,1069
408
- blaxel-0.2.7rc81.dist-info/RECORD,,
405
+ blaxel-0.2.7rc83.dist-info/METADATA,sha256=fEMcUn8v6hYQrtQ6DrnBxAD5YqByrxdrcvf8Ujpkepo,9879
406
+ blaxel-0.2.7rc83.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
407
+ blaxel-0.2.7rc83.dist-info/licenses/LICENSE,sha256=p5PNQvpvyDT_0aYBDgmV1fFI_vAD2aSV0wWG7VTgRis,1069
408
+ blaxel-0.2.7rc83.dist-info/RECORD,,