blaxel 0.2.31__py3-none-any.whl → 0.2.31rc120__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/__init__.py +3 -3
- blaxel/core/agents/__init__.py +6 -13
- blaxel/core/authentication/__init__.py +1 -2
- blaxel/core/authentication/devicemode.py +1 -9
- blaxel/core/authentication/oauth.py +6 -13
- blaxel/core/authentication/types.py +0 -1
- blaxel/core/cache/cache.py +3 -10
- blaxel/core/client/api/agents/list_agent_revisions.py +1 -3
- blaxel/core/client/api/compute/delete_sandbox_preview_token.py +2 -6
- blaxel/core/client/api/compute/start_sandbox.py +1 -3
- blaxel/core/client/api/compute/stop_sandbox.py +1 -3
- blaxel/core/client/api/default/list_sandbox_hub_definitions.py +2 -6
- blaxel/core/client/api/functions/list_function_revisions.py +1 -3
- blaxel/core/client/api/images/cleanup_images.py +1 -3
- blaxel/core/client/api/integrations/list_integration_connections.py +2 -6
- blaxel/core/client/api/invitations/list_all_pending_invitations.py +1 -3
- blaxel/core/client/api/jobs/create_job_execution.py +1 -3
- blaxel/core/client/api/jobs/delete_job_execution.py +1 -3
- blaxel/core/client/api/jobs/get_job_execution.py +1 -3
- blaxel/core/client/api/jobs/list_job_executions.py +2 -6
- blaxel/core/client/api/jobs/list_job_revisions.py +1 -3
- blaxel/core/client/api/locations/list_locations.py +1 -3
- blaxel/core/client/api/models/list_model_revisions.py +1 -3
- blaxel/core/client/api/service_accounts/create_workspace_service_account.py +2 -6
- blaxel/core/client/api/service_accounts/delete_workspace_service_account.py +2 -6
- blaxel/core/client/api/service_accounts/get_workspace_service_accounts.py +1 -3
- blaxel/core/client/api/service_accounts/update_workspace_service_account.py +2 -6
- blaxel/core/client/api/volume_templates/list_volume_templates.py +1 -3
- blaxel/core/client/api/workspaces/accept_workspace_invitation.py +2 -6
- blaxel/core/client/api/workspaces/invite_workspace_user.py +2 -6
- blaxel/core/client/api/workspaces/update_workspace_user_role.py +2 -6
- blaxel/core/client/client.py +19 -5
- blaxel/core/client/models/agent.py +4 -11
- blaxel/core/client/models/agent_spec.py +5 -18
- blaxel/core/client/models/billable_time_metric.py +1 -0
- blaxel/core/client/models/configuration.py +1 -0
- blaxel/core/client/models/core_spec.py +3 -10
- blaxel/core/client/models/core_spec_configurations.py +1 -0
- blaxel/core/client/models/create_job_execution_request.py +1 -0
- blaxel/core/client/models/create_job_execution_response.py +1 -0
- blaxel/core/client/models/custom_domain.py +2 -5
- blaxel/core/client/models/custom_domain_metadata.py +1 -0
- blaxel/core/client/models/custom_domain_spec.py +2 -5
- blaxel/core/client/models/delete_volume_template_version_response_200.py +2 -5
- blaxel/core/client/models/entrypoint.py +1 -0
- blaxel/core/client/models/form.py +2 -5
- blaxel/core/client/models/function.py +4 -11
- blaxel/core/client/models/function_spec.py +4 -13
- blaxel/core/client/models/image.py +2 -5
- blaxel/core/client/models/image_spec.py +1 -0
- blaxel/core/client/models/integration.py +3 -10
- blaxel/core/client/models/integration_connection.py +2 -5
- blaxel/core/client/models/integration_connection_spec.py +1 -0
- blaxel/core/client/models/integration_endpoint.py +2 -5
- blaxel/core/client/models/integration_endpoints.py +2 -0
- blaxel/core/client/models/job.py +4 -11
- blaxel/core/client/models/job_execution.py +2 -5
- blaxel/core/client/models/job_execution_spec.py +1 -0
- blaxel/core/client/models/job_execution_task.py +2 -5
- blaxel/core/client/models/job_metrics.py +2 -5
- blaxel/core/client/models/job_spec.py +4 -13
- blaxel/core/client/models/jobs_network_chart.py +1 -0
- blaxel/core/client/models/jobs_success_failed_chart.py +3 -10
- blaxel/core/client/models/latency_metric.py +2 -5
- blaxel/core/client/models/location_response.py +1 -0
- blaxel/core/client/models/mcp_definition.py +2 -5
- blaxel/core/client/models/metadata.py +1 -0
- blaxel/core/client/models/metrics.py +4 -11
- blaxel/core/client/models/model.py +4 -11
- blaxel/core/client/models/model_spec.py +3 -10
- blaxel/core/client/models/pending_invitation_accept.py +2 -5
- blaxel/core/client/models/pending_invitation_render.py +3 -10
- blaxel/core/client/models/policy.py +2 -5
- blaxel/core/client/models/policy_spec.py +4 -11
- blaxel/core/client/models/preview.py +2 -5
- blaxel/core/client/models/preview_spec.py +1 -0
- blaxel/core/client/models/preview_token.py +2 -5
- blaxel/core/client/models/public_ips.py +1 -0
- blaxel/core/client/models/request_duration_over_time_metrics.py +1 -0
- blaxel/core/client/models/request_total_by_origin_metric.py +7 -16
- blaxel/core/client/models/request_total_metric.py +3 -8
- blaxel/core/client/models/resource_metrics.py +17 -58
- blaxel/core/client/models/runtime.py +1 -0
- blaxel/core/client/models/sandbox.py +4 -11
- blaxel/core/client/models/sandbox_definition.py +1 -0
- blaxel/core/client/models/sandbox_lifecycle.py +1 -0
- blaxel/core/client/models/sandbox_spec.py +6 -21
- blaxel/core/client/models/serverless_config.py +1 -0
- blaxel/core/client/models/start_sandbox.py +2 -5
- blaxel/core/client/models/stop_sandbox.py +2 -5
- blaxel/core/client/models/store_agent.py +1 -0
- blaxel/core/client/models/store_configuration.py +1 -0
- blaxel/core/client/models/template.py +1 -0
- blaxel/core/client/models/time_to_first_token_over_time_metrics.py +2 -3
- blaxel/core/client/models/token_rate_metrics.py +1 -0
- blaxel/core/client/models/trigger.py +1 -0
- blaxel/core/client/models/trigger_configuration.py +1 -0
- blaxel/core/client/models/volume.py +4 -11
- blaxel/core/client/models/volume_template.py +2 -5
- blaxel/core/client/models/workspace.py +2 -5
- blaxel/core/client/response_interceptor.py +1 -3
- blaxel/core/common/autoload.py +11 -9
- blaxel/core/common/env.py +8 -10
- blaxel/core/common/settings.py +2 -4
- blaxel/core/common/webhook.py +1 -0
- blaxel/core/jobs/__init__.py +3 -13
- blaxel/core/mcp/client.py +2 -8
- blaxel/core/mcp/server.py +2 -8
- blaxel/core/models/__init__.py +5 -6
- blaxel/core/sandbox/__init__.py +1 -1
- blaxel/core/sandbox/client/api/codegen/get_codegen_reranking_path.py +2 -6
- blaxel/core/sandbox/client/api/fastapply/put_codegen_fastapply_path.py +2 -6
- blaxel/core/sandbox/client/api/filesystem/delete_filesystem_multipart_upload_id_abort.py +2 -6
- blaxel/core/sandbox/client/api/filesystem/delete_filesystem_path.py +2 -6
- blaxel/core/sandbox/client/api/filesystem/delete_filesystem_tree_path.py +2 -6
- blaxel/core/sandbox/client/api/filesystem/get_filesystem_content_search_path.py +1 -3
- blaxel/core/sandbox/client/api/filesystem/get_filesystem_find_path.py +2 -6
- blaxel/core/sandbox/client/api/filesystem/get_filesystem_search_path.py +2 -6
- blaxel/core/sandbox/client/api/filesystem/get_watch_filesystem_path.py +2 -6
- blaxel/core/sandbox/client/api/filesystem/post_filesystem_multipart_upload_id_complete.py +2 -6
- blaxel/core/sandbox/client/api/filesystem/put_filesystem_path.py +2 -6
- blaxel/core/sandbox/client/api/process/delete_process_identifier.py +2 -6
- blaxel/core/sandbox/client/api/process/delete_process_identifier_kill.py +2 -6
- blaxel/core/sandbox/client/api/process/get_process.py +1 -3
- blaxel/core/sandbox/client/api/process/get_process_identifier.py +2 -6
- blaxel/core/sandbox/client/api/process/get_process_identifier_logs.py +2 -6
- blaxel/core/sandbox/client/api/process/get_process_identifier_logs_stream.py +2 -6
- blaxel/core/sandbox/client/api/process/post_process.py +2 -6
- blaxel/core/sandbox/client/client.py +1 -3
- blaxel/core/sandbox/client/models/filesystem_multipart_upload_parts.py +1 -3
- blaxel/core/sandbox/default/__init__.py +1 -0
- blaxel/core/sandbox/default/action.py +3 -3
- blaxel/core/sandbox/default/codegen.py +4 -2
- blaxel/core/sandbox/default/filesystem.py +82 -38
- blaxel/core/sandbox/default/interpreter.py +10 -17
- blaxel/core/sandbox/default/preview.py +2 -6
- blaxel/core/sandbox/default/process.py +7 -25
- blaxel/core/sandbox/default/sandbox.py +2 -7
- blaxel/core/sandbox/sync/__init__.py +2 -0
- blaxel/core/sandbox/sync/action.py +3 -2
- blaxel/core/sandbox/sync/codegen.py +5 -1
- blaxel/core/sandbox/sync/filesystem.py +6 -17
- blaxel/core/sandbox/sync/interpreter.py +6 -10
- blaxel/core/sandbox/sync/network.py +2 -0
- blaxel/core/sandbox/sync/preview.py +9 -21
- blaxel/core/sandbox/sync/process.py +8 -32
- blaxel/core/sandbox/sync/sandbox.py +6 -13
- blaxel/core/sandbox/sync/session.py +4 -6
- blaxel/core/sandbox/types.py +1 -2
- blaxel/core/tools/__init__.py +6 -30
- blaxel/core/tools/common.py +1 -1
- blaxel/core/tools/types.py +1 -2
- blaxel/crewai/model.py +5 -20
- blaxel/googleadk/__init__.py +1 -1
- blaxel/googleadk/tools.py +5 -3
- blaxel/langgraph/custom/gemini.py +133 -126
- blaxel/langgraph/model.py +50 -54
- blaxel/langgraph/tools.py +3 -9
- blaxel/llamaindex/custom/cohere.py +16 -25
- blaxel/llamaindex/model.py +57 -44
- blaxel/llamaindex/tools.py +3 -2
- blaxel/pydantic/custom/gemini.py +3 -3
- blaxel/pydantic/tools.py +4 -2
- blaxel/telemetry/exporters.py +3 -10
- blaxel/telemetry/instrumentation/blaxel_langgraph.py +2 -4
- blaxel/telemetry/instrumentation/blaxel_langgraph_gemini.py +5 -22
- blaxel/telemetry/instrumentation/utils.py +3 -3
- blaxel/telemetry/log/log.py +3 -2
- blaxel/telemetry/log/logger.py +15 -21
- blaxel/telemetry/span.py +6 -10
- {blaxel-0.2.31.dist-info → blaxel-0.2.31rc120.dist-info}/METADATA +2 -2
- {blaxel-0.2.31.dist-info → blaxel-0.2.31rc120.dist-info}/RECORD +174 -174
- {blaxel-0.2.31.dist-info → blaxel-0.2.31rc120.dist-info}/WHEEL +0 -0
- {blaxel-0.2.31.dist-info → blaxel-0.2.31rc120.dist-info}/licenses/LICENSE +0 -0
blaxel/core/tools/__init__.py
CHANGED
|
@@ -8,12 +8,7 @@ from typing import Any, cast
|
|
|
8
8
|
import httpx
|
|
9
9
|
from mcp import ClientSession
|
|
10
10
|
from mcp.client.streamable_http import streamablehttp_client
|
|
11
|
-
from mcp.types import
|
|
12
|
-
CallToolRequest,
|
|
13
|
-
CallToolRequestParams,
|
|
14
|
-
CallToolResult,
|
|
15
|
-
ClientRequest,
|
|
16
|
-
)
|
|
11
|
+
from mcp.types import CallToolRequest, CallToolRequestParams, CallToolResult, ClientRequest
|
|
17
12
|
from mcp.types import Tool as MCPTool
|
|
18
13
|
|
|
19
14
|
from ..common.internal import get_forced_url, get_global_unique_hash
|
|
@@ -29,13 +24,7 @@ if os.getenv("BL_SERVER_PORT"):
|
|
|
29
24
|
|
|
30
25
|
|
|
31
26
|
class PersistentMcpClient:
|
|
32
|
-
def __init__(
|
|
33
|
-
self,
|
|
34
|
-
name: str,
|
|
35
|
-
timeout: int = DEFAULT_TIMEOUT,
|
|
36
|
-
timeout_enabled: bool = True,
|
|
37
|
-
transport: str = None,
|
|
38
|
-
):
|
|
27
|
+
def __init__(self, name: str, timeout: int = DEFAULT_TIMEOUT, timeout_enabled: bool = True, transport: str = None):
|
|
39
28
|
self.name = name
|
|
40
29
|
self.timeout = timeout
|
|
41
30
|
self.type = "function"
|
|
@@ -108,9 +97,7 @@ class PersistentMcpClient:
|
|
|
108
97
|
await self.initialize()
|
|
109
98
|
if self.timeout_enabled:
|
|
110
99
|
self._remove_timer()
|
|
111
|
-
logger.debug(
|
|
112
|
-
f"Calling tool {tool_name} with arguments {arguments} and meta {self.metas}"
|
|
113
|
-
)
|
|
100
|
+
logger.debug(f"Calling tool {tool_name} with arguments {arguments} and meta {self.metas}")
|
|
114
101
|
|
|
115
102
|
# Pass meta as a separate field instead of merging into arguments
|
|
116
103
|
# This matches the TypeScript SDK pattern and MCP protocol specification
|
|
@@ -183,9 +170,7 @@ class PersistentMcpClient:
|
|
|
183
170
|
|
|
184
171
|
except Exception as e:
|
|
185
172
|
# Default to websocket if we can't determine the transport type
|
|
186
|
-
logger.warning(
|
|
187
|
-
f"Failed to detect transport type for {self.name}: {e}. Defaulting to websocket."
|
|
188
|
-
)
|
|
173
|
+
logger.warning(f"Failed to detect transport type for {self.name}: {e}. Defaulting to websocket.")
|
|
189
174
|
self.transport_name = "websocket"
|
|
190
175
|
|
|
191
176
|
return self.transport_name
|
|
@@ -341,10 +326,7 @@ class BlTools:
|
|
|
341
326
|
if not toolPersistances.get(name):
|
|
342
327
|
logger.debug(f"Creating new persistent connection for {name}")
|
|
343
328
|
toolPersistances[name] = PersistentMcpClient(
|
|
344
|
-
name,
|
|
345
|
-
timeout=self.timeout,
|
|
346
|
-
timeout_enabled=self.timeout_enabled,
|
|
347
|
-
transport=self.transport,
|
|
329
|
+
name, timeout=self.timeout, timeout_enabled=self.timeout_enabled, transport=self.transport
|
|
348
330
|
)
|
|
349
331
|
await toolPersistances[name].list_tools()
|
|
350
332
|
logger.debug(f"Loaded {len(toolPersistances[name].get_tools())} tools")
|
|
@@ -364,10 +346,4 @@ def bl_tools(
|
|
|
364
346
|
timeout_enabled: bool = True,
|
|
365
347
|
transport: str = None,
|
|
366
348
|
) -> BlTools:
|
|
367
|
-
return BlTools(
|
|
368
|
-
functions,
|
|
369
|
-
metas=metas,
|
|
370
|
-
timeout=timeout,
|
|
371
|
-
timeout_enabled=timeout_enabled,
|
|
372
|
-
transport=transport,
|
|
373
|
-
)
|
|
349
|
+
return BlTools(functions, metas=metas, timeout=timeout, timeout_enabled=timeout_enabled, transport=transport)
|
blaxel/core/tools/common.py
CHANGED
blaxel/core/tools/types.py
CHANGED
|
@@ -12,10 +12,9 @@ class ToolException(Exception): # noqa: N818
|
|
|
12
12
|
to the agent as observation, and printed in red on the console.
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
|
-
|
|
16
15
|
class Tool(BaseModel):
|
|
17
16
|
name: str
|
|
18
17
|
description: str
|
|
19
18
|
input_schema: Dict[str, Any]
|
|
20
19
|
coroutine: Callable[..., Awaitable[Any]] | None = None
|
|
21
|
-
sync_coroutine: Callable[..., Any] | None = None
|
|
20
|
+
sync_coroutine: Callable[..., Any] | None = None
|
blaxel/crewai/model.py
CHANGED
|
@@ -18,24 +18,15 @@ async def bl_model(name: str, **kwargs):
|
|
|
18
18
|
url, type, model = await bl_model_core(name).get_parameters()
|
|
19
19
|
if type == "mistral":
|
|
20
20
|
return AuthenticatedLLM(
|
|
21
|
-
model=f"mistral/{model}",
|
|
22
|
-
api_key="replaced",
|
|
23
|
-
base_url=f"{url}/v1",
|
|
24
|
-
**kwargs,
|
|
21
|
+
model=f"mistral/{model}", api_key="replaced", base_url=f"{url}/v1", **kwargs
|
|
25
22
|
)
|
|
26
23
|
elif type == "xai":
|
|
27
24
|
return AuthenticatedLLM(
|
|
28
|
-
model=f"groq/{model}",
|
|
29
|
-
api_key="replaced",
|
|
30
|
-
base_url=f"{url}/v1",
|
|
31
|
-
**kwargs,
|
|
25
|
+
model=f"groq/{model}", api_key="replaced", base_url=f"{url}/v1", **kwargs
|
|
32
26
|
)
|
|
33
27
|
elif type == "deepseek":
|
|
34
28
|
return AuthenticatedLLM(
|
|
35
|
-
model=f"openai/{model}",
|
|
36
|
-
api_key="replaced",
|
|
37
|
-
base_url=f"{url}/v1",
|
|
38
|
-
**kwargs,
|
|
29
|
+
model=f"openai/{model}", api_key="replaced", base_url=f"{url}/v1", **kwargs
|
|
39
30
|
)
|
|
40
31
|
elif type == "anthropic":
|
|
41
32
|
return AuthenticatedLLM(
|
|
@@ -53,17 +44,11 @@ async def bl_model(name: str, **kwargs):
|
|
|
53
44
|
)
|
|
54
45
|
elif type == "cerebras":
|
|
55
46
|
return AuthenticatedLLM(
|
|
56
|
-
model=f"cerebras/{model}",
|
|
57
|
-
api_key="replaced",
|
|
58
|
-
base_url=f"{url}/v1",
|
|
59
|
-
**kwargs,
|
|
47
|
+
model=f"cerebras/{model}", api_key="replaced", base_url=f"{url}/v1", **kwargs
|
|
60
48
|
)
|
|
61
49
|
else:
|
|
62
50
|
if type != "openai":
|
|
63
51
|
logger.warning(f"Model {model} is not supported by CrewAI, defaulting to OpenAI")
|
|
64
52
|
return AuthenticatedLLM(
|
|
65
|
-
model=f"openai/{model}",
|
|
66
|
-
api_key="replaced",
|
|
67
|
-
base_url=f"{url}/v1",
|
|
68
|
-
**kwargs,
|
|
53
|
+
model=f"openai/{model}", api_key="replaced", base_url=f"{url}/v1", **kwargs
|
|
69
54
|
)
|
blaxel/googleadk/__init__.py
CHANGED
blaxel/googleadk/tools.py
CHANGED
|
@@ -55,11 +55,13 @@ class GoogleADKTool(BaseTool):
|
|
|
55
55
|
return function_decl
|
|
56
56
|
|
|
57
57
|
@override
|
|
58
|
-
async def run_async(
|
|
58
|
+
async def run_async(
|
|
59
|
+
self, *, args: dict[str, Any], tool_context: ToolContext
|
|
60
|
+
) -> Any:
|
|
59
61
|
args_to_call = args.copy()
|
|
60
62
|
signature = inspect.signature(self._tool.coroutine)
|
|
61
|
-
if
|
|
62
|
-
args_to_call[
|
|
63
|
+
if 'tool_context' in signature.parameters:
|
|
64
|
+
args_to_call['tool_context'] = tool_context
|
|
63
65
|
return await self._tool.coroutine(**args_to_call) or {}
|
|
64
66
|
|
|
65
67
|
|