Skip to content

Commit

Permalink
add envs to the new_instance method
Browse files Browse the repository at this point in the history
  • Loading branch information
yzld2002 committed Sep 5, 2024
1 parent ab510a6 commit d3ba8ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vision_agent/utils/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,12 +682,13 @@ def get_default_instance() -> CodeInterpreter:
def new_instance(
code_sandbox_runtime: Optional[str] = None,
remote_path: Optional[Union[str, Path]] = None,
envs: Optional[Dict[str, str]] = None,
) -> CodeInterpreter:
if not code_sandbox_runtime:
code_sandbox_runtime = os.getenv("CODE_SANDBOX_RUNTIME", "local")
if code_sandbox_runtime == "e2b":
instance: CodeInterpreter = E2BCodeInterpreter(
timeout=_SESSION_TIMEOUT, remote_path=remote_path
timeout=_SESSION_TIMEOUT, remote_path=remote_path, envs=envs
)
elif code_sandbox_runtime == "local":
instance = LocalCodeInterpreter(
Expand Down

0 comments on commit d3ba8ee

Please sign in to comment.