Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user to pass a template ID for E2B sandbox #170

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions athina/steps/code_execution_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class CodeExecutionV2(Step):
DEFAULT_TIMEOUT: ClassVar[int] = 60 # 1 minute default timeout for sandbox
MAX_TIMEOUT: ClassVar[int] = 300 # 5 minute limit for e2b sandbox execution
sandbox_timeout: Optional[int] = None
template: Optional[str] = None

def __init__(
self,
Expand Down Expand Up @@ -132,6 +133,7 @@ def _create_or_initialize_sandbox(self):

if self._sandbox is None:
self._sandbox = Sandbox(
template=self.template,
timeout=min(
self.sandbox_timeout or self.DEFAULT_TIMEOUT, self.MAX_TIMEOUT
),
Expand Down
Loading