Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CodeExecutor Serializable/Declarative #5527

Merged
merged 5 commits into from
Feb 13, 2025

Conversation

victordibia
Copy link
Collaborator

@victordibia victordibia commented Feb 13, 2025

Why are these changes needed?

Make PythonCodeExecutionTool declarative so it can be used in tools like AGS

Summary of changes

  • Make CodeExecutor declarative (convert from Protocol to ABC, inherit from ComponentBase)
  • Make LocalCommandLineCodeExecutor, JupyterCodeExecutor and DockerCommandLineCodeExecutor declarative , best effort. Not all fields are serialized, warnings are shown where appropriate.
  • Make PythonCodeExecutionTool declarative.

Related issue number

Closes #5526

Checks

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 8 changed files in this pull request and generated no comments.

Files not reviewed (3)
  • python/packages/autogen-core/src/autogen_core/code_executor/_base.py: Evaluated as low risk
  • python/packages/autogen-ext/src/autogen_ext/tools/code_execution/_code_execution.py: Evaluated as low risk
  • python/packages/autogen-ext/src/autogen_ext/code_executors/jupyter/_jupyter_code_executor.py: Evaluated as low risk
Copy link

codecov bot commented Feb 13, 2025

Codecov Report

Attention: Patch coverage is 96.34146% with 3 lines in your changes missing coverage. Please review.

Project coverage is 78.74%. Comparing base (4e3b887) to head (7a93796).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...t/src/autogen_ext/code_executors/local/__init__.py 89.47% 2 Missing ⚠️
...ext/code_executors/docker/_docker_code_executor.py 96.15% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5527      +/-   ##
==========================================
+ Coverage   78.36%   78.74%   +0.38%     
==========================================
  Files         167      167              
  Lines        9933    10004      +71     
==========================================
+ Hits         7784     7878      +94     
+ Misses       2149     2126      -23     
Flag Coverage Δ
unittests 78.74% <96.34%> (+0.38%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@victordibia victordibia enabled auto-merge (squash) February 13, 2025 17:24
@victordibia victordibia disabled auto-merge February 13, 2025 17:25
@victordibia victordibia merged commit e6423bb into main Feb 13, 2025
53 checks passed
@victordibia victordibia deleted the python_code_tool_declarative_vd branch February 13, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make CodeExcutor and PythonCodeExecutorTool Seralizable
2 participants