File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change 4848
4949
5050class CodeBox :
51- def __new__ (
52- cls ,
53- session_id : t .Optional [str ] = None ,
54- api_key : t .Optional [t .Union [str , t .Literal ["local" , "docker" ]]] = None ,
55- factory_id : t .Optional [t .Union [str , t .Literal ["default" ]]] = None ,
56- ) -> "CodeBox" :
51+ def __new__ (cls , * args , ** kwargs ) -> "CodeBox" :
5752 """
5853 Creates a CodeBox session
5954 """
60- api_key = api_key or os .getenv ("CODEBOX_API_KEY" , "local" )
61- factory_id = factory_id or os .getenv ("CODEBOX_FACTORY_ID" , "default" )
55+ api_key = kwargs .get ("api_key" ) or os .getenv ("CODEBOX_API_KEY" , "local" )
6256 if api_key == "local" :
63- return import_module ("codeboxapi.local" ).LocalBox ()
57+ return import_module ("codeboxapi.local" ).LocalBox (* args , ** kwargs )
6458
6559 if api_key == "docker" :
66- return import_module ("codeboxapi.docker" ).DockerBox ()
67- return import_module ("codeboxapi.remote" ).RemoteBox ()
60+ return import_module ("codeboxapi.docker" ).DockerBox (* args , ** kwargs )
61+ return import_module ("codeboxapi.remote" ).RemoteBox (* args , ** kwargs )
6862
6963 def __init__ (
7064 self ,
You can’t perform that action at this time.
0 commit comments