diff --git a/autogen/coding/jupyter/docker_jupyter_server.py b/autogen/coding/jupyter/docker_jupyter_server.py index 83455e272380..e5896014a613 100644 --- a/autogen/coding/jupyter/docker_jupyter_server.py +++ b/autogen/coding/jupyter/docker_jupyter_server.py @@ -8,7 +8,7 @@ import uuid from pathlib import Path from types import TracebackType -from typing import Dict, Optional, Type, Union +from typing import Any, Dict, Optional, Type, Union import docker @@ -59,6 +59,7 @@ def __init__( stop_container: bool = True, docker_env: Dict[str, str] = {}, token: Union[str, GenerateToken] = GenerateToken(), + **docker_kwargs: Any, ): """Start a Jupyter kernel gateway server in a Docker container. @@ -77,6 +78,7 @@ def __init__( token (Union[str, GenerateToken], optional): Token to use for authentication. If GenerateToken is used, a random token will be generated. Empty string will be unauthenticated. + docker_kwargs (Any): Additional keyword arguments to pass to the docker container. """ if container_name is None: container_name = f"autogen-jupyterkernelgateway-{uuid.uuid4()}" @@ -118,6 +120,7 @@ def __init__( environment=env, publish_all_ports=True, name=container_name, + **docker_kwargs, ) _wait_for_ready(container) container_ports = container.ports