mirror of https://github.com/microsoft/autogen.git
![]() This pull request introduces a new feature to the `DockerCommandLineCodeExecutor` class, which allows temporary files generated by code execution to be deleted after code execution. The most important changes include adding a new configuration option, updating the class to handle this option, and adding tests to verify the new functionality. ### New Feature: Temporary File Deletion * [`python/packages/autogen-ext/src/autogen_ext/code_executors/docker/_docker_code_executor.py`](diffhunk://#diff-8ef47c21141ed8b0a757b0e6f9d1491561fc31684756d22ed0253edbfcfcdf91R81): Added `delete_tmp_files` attribute to the `DockerCommandLineCodeExecutorConfig` class and updated the `DockerCommandLineCodeExecutor` class to handle this attribute. This includes initializing the attribute, adding it to the configuration methods, and implementing the file deletion logic in the `_execute_code_dont_check_setup` method. [[1]](diffhunk://#diff-8ef47c21141ed8b0a757b0e6f9d1491561fc31684756d22ed0253edbfcfcdf91R81) [[2]](diffhunk://#diff-8ef47c21141ed8b0a757b0e6f9d1491561fc31684756d22ed0253edbfcfcdf91R128) [[3]](diffhunk://#diff-8ef47c21141ed8b0a757b0e6f9d1491561fc31684756d22ed0253edbfcfcdf91R177) [[4]](diffhunk://#diff-8ef47c21141ed8b0a757b0e6f9d1491561fc31684756d22ed0253edbfcfcdf91R231) [[5]](diffhunk://#diff-8ef47c21141ed8b0a757b0e6f9d1491561fc31684756d22ed0253edbfcfcdf91R318) [[6]](diffhunk://#diff-8ef47c21141ed8b0a757b0e6f9d1491561fc31684756d22ed0253edbfcfcdf91R346-R352) [[7]](diffhunk://#diff-8ef47c21141ed8b0a757b0e6f9d1491561fc31684756d22ed0253edbfcfcdf91R527) [[8]](diffhunk://#diff-8ef47c21141ed8b0a757b0e6f9d1491561fc31684756d22ed0253edbfcfcdf91R547) ### Testing * [`python/packages/autogen-ext/tests/code_executors/test_docker_commandline_code_executor.py`](diffhunk://#diff-635dbdcdeca161e620283399d5cd43ca756ec0f88d4429f059ee4f6b346874e4R318-R363): Added a new test `test_delete_tmp_files` to verify the behavior of the `delete_tmp_files` attribute. This test checks that temporary files are correctly deleted or retained based on the configuration.<!-- Thank you for your contribution! Please review https://microsoft.github.io/autogen/docs/Contribute before opening a pull request. --> |
||
---|---|---|
.. | ||
test_aca_dynamic_sessions.py | ||
test_aca_user_defined_functions.py | ||
test_commandline_code_executor.py | ||
test_docker_commandline_code_executor.py | ||
test_jupyter_code_executor.py | ||
test_user_defined_functions.py |