Skip to content

Commit 26495f9

Browse files
tholorclaude
andcommitted
refactor(e2b): align E2BToolset api_key default with E2BSandbox
Use the same `Secret = Secret.from_env_var("E2B_API_KEY", strict=True)` default as E2BSandbox.__init__ for consistency. Drops the now-unreachable `or` fallback in the E2BSandbox call. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b17c155 commit 26495f9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

integrations/e2b/src/haystack_integrations/tools/e2b/sandbox_toolset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class E2BToolset(Toolset):
4141

4242
def __init__(
4343
self,
44-
api_key: Secret | None = None,
44+
api_key: Secret = Secret.from_env_var("E2B_API_KEY", strict=True),
4545
sandbox_template: str = "base",
4646
timeout: int = 120,
4747
environment_vars: dict[str, str] | None = None,
@@ -55,7 +55,7 @@ def __init__(
5555
:param environment_vars: Optional environment variables to inject into the sandbox.
5656
"""
5757
self.sandbox = E2BSandbox(
58-
api_key=api_key or Secret.from_env_var("E2B_API_KEY"),
58+
api_key=api_key,
5959
sandbox_template=sandbox_template,
6060
timeout=timeout,
6161
environment_vars=environment_vars,

0 commit comments

Comments
 (0)