autogen icon indicating copy to clipboard operation
autogen copied to clipboard

Update _generate_code_execution_reply_using_executor return with code…

Open axecopfire opened this issue 6 months ago • 0 comments

Why are these changes needed?

code_file should be exposed cause it's polluting a project.

With this feature I'm then able to cleanup file

result = re.search(r"Code file: (.+)",
                   code_execution_result.chat_history[-2]['content'])
if result:
    code_file = Path(result.group(1))
    print(code_file)

    # Move the code_file to the execution_logs folder
    execution_logs_folder = Path("./logs/execution_logs")
    execution_logs_folder.mkdir(exist_ok=True)
    code_file.rename(execution_logs_folder / code_file.name)

Related issue number

#3253

Checks

  • [ ] I've included any doc changes needed for https://microsoft.github.io/autogen/. See https://microsoft.github.io/autogen/docs/Contribute#documentation to build and test documentation locally.
  • [ ] I've added tests (if relevant) corresponding to the changes introduced in this PR.
  • [ ] I've made sure all auto checks have passed.

axecopfire avatar Jul 30 '24 18:07 axecopfire