coding.base
CodeBlock
(Experimental) A class that represents a code block.
CodeResult
(Experimental) A class that represents the result of a code execution.
CodeExtractor
(Experimental) A code extractor class that extracts code blocks from a message.
extract_code_blocks
(Experimental) Extract code blocks from a message.
Arguments:
message
str - The message to extract code blocks from.
Returns:
List[CodeBlock]
- The extracted code blocks.
CodeExecutor
(Experimental) A code executor class that executes code blocks and returns the result.
code_extractor
(Experimental) The code extractor used by this code executor.
execute_code_blocks
(Experimental) Execute code blocks and return the result.
This method should be implemented by the code executor.
Arguments:
code_blocks
List[CodeBlock] - The code blocks to execute.
Returns:
CodeResult
- The result of the code execution.
restart
(Experimental) Restart the code executor.
This method should be implemented by the code executor.
This method is called when the agent is reset.
IPythonCodeResult
(Experimental) A code result class for IPython code executor.
CommandLineCodeResult
(Experimental) A code result class for command line code executor.