@@ -68,41 +68,7 @@ def _client(self) -> AsyncClient:
6868 async def run_code (
6969 self ,
7070 code : str ,
71- language : Union [Literal ["python" ], None ] = None ,
72- on_stdout : Optional [OutputHandlerWithAsync [OutputMessage ]] = None ,
73- on_stderr : Optional [OutputHandlerWithAsync [OutputMessage ]] = None ,
74- on_result : Optional [OutputHandlerWithAsync [Result ]] = None ,
75- on_error : Optional [OutputHandlerWithAsync [ExecutionError ]] = None ,
76- envs : Optional [Dict [str , str ]] = None ,
77- timeout : Optional [float ] = None ,
78- request_timeout : Optional [float ] = None ,
79- ) -> Execution :
80- """
81- Runs the code as Python.
82-
83- Specify the `language` or `context` option to run the code as a different language or in a different `Context`.
84-
85- You can reference previously defined variables, imports, and functions in the code.
86-
87- :param code: Code to execute
88- :param language: Language to use for code execution. If not defined, the default Python context is used.
89- :param on_stdout: Callback for stdout messages
90- :param on_stderr: Callback for stderr messages
91- :param on_result: Callback for the `Result` object
92- :param on_error: Callback for the `ExecutionError` object
93- :param envs: Custom environment variables
94- :param timeout: Timeout for the code execution in **seconds**
95- :param request_timeout: Timeout for the request in **seconds**
96-
97- :return: `Execution` result object
98- """
99- ...
100-
101- @overload
102- async def run_code (
103- self ,
104- code : str ,
105- language : Optional [str ] = None ,
71+ language : Union [Literal ["python" , "javascript" , "typescript" , "r" , "java" , "bash" ], str , None ] = None ,
10672 on_stdout : Optional [OutputHandlerWithAsync [OutputMessage ]] = None ,
10773 on_stderr : Optional [OutputHandlerWithAsync [OutputMessage ]] = None ,
10874 on_result : Optional [OutputHandlerWithAsync [Result ]] = None ,
@@ -236,7 +202,7 @@ async def run_code(
236202 async def create_code_context (
237203 self ,
238204 cwd : Optional [str ] = None ,
239- language : Optional [ str ] = None ,
205+ language : Union [ Literal [ "python" , "javascript" , "typescript" , "r" , "java" , "bash" ], str , None ] = None ,
240206 request_timeout : Optional [float ] = None ,
241207 ) -> Context :
242208 """
0 commit comments