MetaGPT icon indicating copy to clipboard operation
MetaGPT copied to clipboard

Integrate CodeIntepreter

Open garylin2099 opened this issue 1 year ago • 1 comments

Features

  • Planning ability for general Role through _plan_and_act function
  • A CodeInterpreter(Role) that could solve problems through coding. This role inherits the planning ability and can also use tools.
  • A MLEngineer(Role) that tailored for machine learning and data analysis
  • Both roles above can interact with human for plan confirmation or modification
  • A Planner and a data structure Plan were the support for role's planning capability.
  • Multiple Actions reusable across roles, incluing WriteCodeByGenerate, WriteCodeWithTools, ExecuteCode, etc. These enable a real-time code generation and display.

Feature Docs TODO

Result TODO

garylin2099 avatar Jan 12 '24 02:01 garylin2099

  1. This is a huge pr, provide the tests result and some example execution log to help a easier review.
  2. There are lots of if/else judgments, make sure that the unittests have cover them.
  3. To have a format update like type annotation, PROMPT_TEMPLATE position and its format, tool schema definition position and so on.
  4. Add more param description/example especially for the param has Union type.
  5. Make the usage clear like ml_enginner vs ml_enginner_simple, execute_code vs run_code and so on.
  6. Uniform usage like working_memory, make sure it can cover the further usage. And update Action with ActionNode later.

better629 avatar Jan 12 '24 07:01 better629

Codecov Report

Attention: 161 lines in your changes are missing coverage. Please review.

Comparison is base (a7cb21a) 80.11% compared to head (a35f536) 81.88%. Report is 5 commits behind head on dev.

Files Patch % Lines
metagpt/tools/libs/feature_engineering.py 87.71% 28 Missing :warning:
metagpt/tools/libs/gpt_v_generator.py 64.38% 26 Missing :warning:
metagpt/utils/recovery_util.py 0.00% 23 Missing :warning:
metagpt/actions/ci/execute_nb_code.py 90.19% 15 Missing :warning:
metagpt/strategy/planner.py 83.78% 12 Missing :warning:
metagpt/tools/libs/data_preprocess.py 90.74% 10 Missing :warning:
metagpt/tools/tool_registry.py 90.47% 8 Missing :warning:
metagpt/actions/ci/ml_action.py 75.86% 7 Missing :warning:
metagpt/provider/openai_api.py 76.66% 7 Missing :warning:
metagpt/roles/ci/ml_engineer.py 81.57% 7 Missing :warning:
... and 11 more

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #736      +/-   ##
==========================================
+ Coverage   80.11%   81.88%   +1.77%     
==========================================
  Files         200      225      +25     
  Lines       11046    12446    +1400     
==========================================
+ Hits         8849    10192    +1343     
- Misses       2197     2254      +57     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jan 30 '24 14:01 codecov-commenter

Screen Shot 2024-01-31 at 10 08 49 PM https://github.com/geekan/MetaGPT/actions/runs/7726960897/job/21064351903?pr=736 Reached test coverage 86%. No lower than target branch dev. In terms of 8 test failures, 6 of them depend on fix on dev, 2 will be solved soon.

garylin2099 avatar Jan 31 '24 14:01 garylin2099

Screen Shot 2024-02-01 at 12 57 37 PM https://github.com/geekan/MetaGPT/actions/runs/7735868125/job/21092824632 Test coverage at 87%, higher than target branch (dev), all tests passed (5 failures at dev not related to this PR)

garylin2099 avatar Feb 01 '24 04:02 garylin2099

  1. Don't write comments that don't make sense, if the subclass's methods are nothing special, it should probably use the parent's comments
  2. Notice that some logic has actually changed boundaries in the modification and need to provide a test result
  1. Done
  2. https://github.com/geekan/MetaGPT/actions/runs/7775123241/job/21200724452?pr=736 All tests passed with a coverage no lower than dev. (The 7 failures are the same with current dev and are not related to this PR)

garylin2099 avatar Feb 04 '24 16:02 garylin2099