jupyter
autogen.coding.jupyter.JupyterCodeExecutor
JupyterCodeExecutor
(Experimental) A code executor class that executes code blocks and returns the result.
(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.
Name | Description |
---|---|
jupyter_server | Type: JupyterConnectable | JupyterConnectionInfo |
kernel_name | Type: str Default: ‘python3’ |
timeout | Type: int Default: 60 |
output_dir | Type: pathlib.Path | str Default: PosixPath(’.’) |
Instance Attributes
code_extractor
(Experimental) Export a code extractor that can be used by an agent.
Instance Methods
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.
Name | Description |
---|---|
code_blocks | A list of code blocks to execute. Type: list[CodeBlock] |
Type | Description |
---|---|
autogen.coding.base.IPythonCodeResult | IPythonCodeResult: The result of the code execution. |
restart
(Experimental) Restart a new session.
stop
Stop the kernel.