CodeExecutor

CodeExecutor(*args, **kwargs)

(Experimental) A code executor class that executes code blocks and returns the result.

Parameters:
NameDescription
*args
**kwargs

Instance Attributes

code_extractor


(Experimental) The code extractor used by this code executor.

Instance Methods

execute_code_blocks

execute_code_blocks(self, code_blocks: list[CodeBlock]) -> autogen.coding.CodeResult

(Experimental) Execute code blocks and return the result.

This method should be implemented by the code executor.

Parameters:
NameDescription
code_blocksThe code blocks to execute.

Type: list[CodeBlock]
Returns:
TypeDescription
autogen.coding.CodeResultCodeResult: The result of the code execution.

restart

restart(self) -> None

(Experimental) Restart the code executor.

This method should be implemented by the code executor.

This method is called when the agent is reset.