save code steps early

This commit is contained in:
yzlin 2023-12-13 13:48:18 +08:00
parent 7c1809af1e
commit 92d59ea31b
3 changed files with 8 additions and 12 deletions

View file

@ -23,9 +23,7 @@ from metagpt.utils.common import create_func_config
class BaseWriteAnalysisCode(Action):
async def run(
self, context: List[Message], plan: Plan = None, task_guide: str = ""
) -> str:
async def run(self, context: List[Message], plan: Plan = None) -> str:
"""Run of a code writing action, used in data analysis or modeling
Args:
@ -85,7 +83,6 @@ class WriteCodeByGenerate(BaseWriteAnalysisCode):
self,
context: [List[Message]],
plan: Plan = None,
code_steps: str = "",
system_msg: str = None,
**kwargs,
) -> str:
@ -155,11 +152,11 @@ class WriteCodeWithTools(BaseWriteAnalysisCode):
self,
context: List[Message],
plan: Plan = None,
code_steps: str = "",
data_desc: str = "",
) -> str:
task_type = plan.current_task.task_type
task = plan.current_task.instruction
code_steps = plan.current_task.code_steps
available_tools = registry.get_all_schema_by_module(task_type)
available_tools = [
{k: tool[k] for k in ["name", "description"] if k in tool}