JupyterCodeExecutor
autogen.coding.jupyter.JupyterCodeExecutor #
JupyterCodeExecutor(jupyter_server, kernel_name='python3', timeout=60, output_dir=Path())
Bases: CodeExecutor
(Experimental) A code executor class that executes code statefully using a Jupyter server supplied to this class.
Each execution is stateful and can access variables created from previous executions in the same session.
PARAMETER | DESCRIPTION |
---|---|
jupyter_server | The Jupyter server to use. |
timeout | The timeout for code execution, by default 60. TYPE: |
kernel_name | The kernel name to use. Make sure it is installed. By default, it is "python3". TYPE: |
output_dir | The directory to save output files, by default ".". |
Source code in autogen/coding/jupyter/jupyter_code_executor.py
code_extractor property
#
(Experimental) Export a code extractor that can be used by an agent.
execute_code_blocks #
(Experimental) Execute a list of code blocks and return the result.
This method executes a list of code blocks as cells in the Jupyter kernel. See: https://jupyter-client.readthedocs.io/en/stable/messaging.html for the message protocol.
PARAMETER | DESCRIPTION |
---|---|
code_blocks | A list of code blocks to execute. TYPE: |
RETURNS | DESCRIPTION |
---|---|
IPythonCodeResult | The result of the code execution. TYPE: |
Source code in autogen/coding/jupyter/jupyter_code_executor.py
restart #
(Experimental) Restart a new session.