diff --git a/vision_agent/utils/execute.py b/vision_agent/utils/execute.py index c2e0e652..d0a713cc 100644 --- a/vision_agent/utils/execute.py +++ b/vision_agent/utils/execute.py @@ -690,9 +690,11 @@ def new_instance( ) -> CodeInterpreter: if not code_sandbox_runtime: code_sandbox_runtime = os.getenv("CODE_SANDBOX_RUNTIME", "local") + openai_api_key = os.getenv("OPENAI_API_KEY", "") + envs = {"OPENAI_API_KEY": openai_api_key} if openai_api_key else None 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(