blaxel 0.2.7rc80__py3-none-any.whl → 0.2.7rc82__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.
- blaxel/core/authentication/__init__.py +16 -15
- blaxel/telemetry/instrumentation/blaxel_core.py +6 -6
- {blaxel-0.2.7rc80.dist-info → blaxel-0.2.7rc82.dist-info}/METADATA +1 -1
- {blaxel-0.2.7rc80.dist-info → blaxel-0.2.7rc82.dist-info}/RECORD +6 -6
- {blaxel-0.2.7rc80.dist-info → blaxel-0.2.7rc82.dist-info}/WHEEL +0 -0
- {blaxel-0.2.7rc80.dist-info → blaxel-0.2.7rc82.dist-info}/licenses/LICENSE +0 -0
@@ -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 /
|
27
|
-
with open(config_path, encoding=
|
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 /
|
43
|
+
config_path = home_dir / ".blaxel" / "config.yaml"
|
46
44
|
|
47
|
-
with open(config_path, encoding=
|
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(
|
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("
|
59
|
-
client_credentials=credentials.get("
|
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
|
-
|
97
|
+
|
98
|
+
__all__ = ["BlaxelAuth", "CredentialsType"]
|
@@ -88,8 +88,8 @@ class BlaxelCoreInstrumentor(BaseInstrumentor):
|
|
88
88
|
# Patch convert_mcp_tool_to_blaxel_tool to wrap tool calls
|
89
89
|
orig_convert = blaxel.core.tools.convert_mcp_tool_to_blaxel_tool
|
90
90
|
|
91
|
-
def traced_convert_mcp_tool_to_blaxel_tool(websocket_client,
|
92
|
-
Tool = orig_convert(websocket_client,
|
91
|
+
def traced_convert_mcp_tool_to_blaxel_tool(websocket_client, tool):
|
92
|
+
Tool = orig_convert(websocket_client, tool)
|
93
93
|
orig_coroutine = Tool.coroutine
|
94
94
|
orig_sync_coroutine = Tool.sync_coroutine
|
95
95
|
|
@@ -97,8 +97,8 @@ class BlaxelCoreInstrumentor(BaseInstrumentor):
|
|
97
97
|
span_attributes = {
|
98
98
|
"tool.name": tool.name,
|
99
99
|
"tool.args": json.dumps(kwargs),
|
100
|
-
"tool.server":
|
101
|
-
"tool.server_name": name,
|
100
|
+
"tool.server": websocket_client._url,
|
101
|
+
"tool.server_name": websocket_client.name,
|
102
102
|
"span.type": "tool.call",
|
103
103
|
**SpanManager.get_default_attributes(),
|
104
104
|
}
|
@@ -110,8 +110,8 @@ class BlaxelCoreInstrumentor(BaseInstrumentor):
|
|
110
110
|
span_attributes = {
|
111
111
|
"tool.name": tool.name,
|
112
112
|
"tool.args": json.dumps(kwargs),
|
113
|
-
"tool.server":
|
114
|
-
"tool.server_name": name,
|
113
|
+
"tool.server": websocket_client._url,
|
114
|
+
"tool.server_name": websocket_client.name,
|
115
115
|
"span.type": "tool.call",
|
116
116
|
**SpanManager.get_default_attributes(),
|
117
117
|
}
|
@@ -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=
|
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
|
@@ -394,7 +394,7 @@ blaxel/telemetry/exporters.py,sha256=EoX3uaBVku1Rg49pSNXKFyHhgY5OV3Ih6UlqgjF5epw
|
|
394
394
|
blaxel/telemetry/manager.py,sha256=3yYBxxqQKl1rCKrn0GVz9jR5jouC1nsElbAaH8tTtgA,9075
|
395
395
|
blaxel/telemetry/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
396
396
|
blaxel/telemetry/span.py,sha256=b8lpWe5nqek4w9YrBLJCIYz4Z3n9Z_49H_AkqpAGOiM,3660
|
397
|
-
blaxel/telemetry/instrumentation/blaxel_core.py,sha256=
|
397
|
+
blaxel/telemetry/instrumentation/blaxel_core.py,sha256=aPFI9RdOBrmqOpxIlMJaSZfrWtVGD14Iv5FsZ37vLsc,4930
|
398
398
|
blaxel/telemetry/instrumentation/blaxel_langgraph.py,sha256=sBxt8kzRjsFepm86vaCBbGvpYI4mWPK_PB3wiLxSuOk,4235
|
399
399
|
blaxel/telemetry/instrumentation/blaxel_langgraph_gemini.py,sha256=hQbOaaMsHte_Igq_vhPgNXYd40IwuqPB0TUP-5VAtME,11953
|
400
400
|
blaxel/telemetry/instrumentation/blaxel_llamaindex.py,sha256=HA4YUXrRYvG5U1J8MAJnymmmj4ZCDydv-pXXhrftHOA,3101
|
@@ -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.
|
406
|
-
blaxel-0.2.
|
407
|
-
blaxel-0.2.
|
408
|
-
blaxel-0.2.
|
405
|
+
blaxel-0.2.7rc82.dist-info/METADATA,sha256=PZvVY1dTI91z_fmxB056Pn0fEAJd6yUYt5GE7EavU7k,9879
|
406
|
+
blaxel-0.2.7rc82.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
407
|
+
blaxel-0.2.7rc82.dist-info/licenses/LICENSE,sha256=p5PNQvpvyDT_0aYBDgmV1fFI_vAD2aSV0wWG7VTgRis,1069
|
408
|
+
blaxel-0.2.7rc82.dist-info/RECORD,,
|
File without changes
|
File without changes
|