@@ -248,6 +248,7 @@ async def create(
248248 async def connect (
249249 self ,
250250 timeout : Optional [int ] = None ,
251+ envs : Optional [Dict [str , str ]] = None ,
251252 ** opts : Unpack [ApiParams ],
252253 ) -> Self :
253254 """
@@ -258,6 +259,8 @@ async def connect(
258259
259260 :param timeout: Timeout for the sandbox in **seconds**
260261 For running sandboxes, the timeout will update only if the new timeout is longer than the existing one.
262+ :param envs: Custom environment variables to set in the sandbox on reconnect.
263+ Merged into the sandbox environment and applied to processes started after resume.
261264 :return: A running sandbox instance
262265
263266 @example
@@ -276,6 +279,7 @@ async def connect(
276279 async def connect (
277280 sandbox_id : str ,
278281 timeout : Optional [int ] = None ,
282+ envs : Optional [Dict [str , str ]] = None ,
279283 ** opts : Unpack [ApiParams ],
280284 ) -> "AsyncSandbox" :
281285 """
@@ -287,6 +291,8 @@ async def connect(
287291 :param sandbox_id: Sandbox ID
288292 :param timeout: Timeout for the sandbox in **seconds**
289293 For running sandboxes, the timeout will update only if the new timeout is longer than the existing one.
294+ :param envs: Custom environment variables to set in the sandbox on reconnect.
295+ Merged into the sandbox environment and applied to processes started after resume.
290296 :return: A running sandbox instance
291297
292298 @example
@@ -304,6 +310,7 @@ async def connect(
304310 async def connect (
305311 self ,
306312 timeout : Optional [int ] = None ,
313+ envs : Optional [Dict [str , str ]] = None ,
307314 ** opts : Unpack [ApiParams ],
308315 ) -> Self :
309316 """
@@ -314,6 +321,8 @@ async def connect(
314321
315322 :param timeout: Timeout for the sandbox in **seconds**
316323 For running sandboxes, the timeout will update only if the new timeout is longer than the existing one.
324+ :param envs: Custom environment variables to set in the sandbox on reconnect.
325+ Merged into the sandbox environment and applied to processes started after resume.
317326 :return: A running sandbox instance
318327
319328 @example
@@ -328,6 +337,7 @@ async def connect(
328337 await SandboxApi ._cls_connect (
329338 sandbox_id = self .sandbox_id ,
330339 timeout = timeout ,
340+ envs = envs ,
331341 ** self .connection_config .get_api_params (** opts ),
332342 )
333343
0 commit comments