fixbug: 统一了接口

This commit is contained in:
莘权 马 2023-07-31 17:48:06 +08:00
parent 444b609e38
commit 3b0f76a1cd
2 changed files with 4 additions and 2 deletions

View file

@ -135,7 +135,8 @@ class WriteDesign(Action):
self._save_prd(docs_path, resources_path, context[-1].content)
self._save_system_design(docs_path, resources_path, content)
async def run(self, context):
async def run(self, *args, **kwargs):
context = args[0]
prompt = PROMPT_TEMPLATE.format(context=context, format_example=FORMAT_EXAMPLE)
# system_design = await self._aask(prompt)
system_design = await self._aask_v1(prompt, "system_design", OUTPUT_MAPPING)

View file

@ -115,7 +115,8 @@ class WriteTasks(Action):
requirements_path = WORKSPACE_ROOT / ws_name / 'requirements.txt'
requirements_path.write_text(rsp.instruct_content.dict().get("Required Python third-party packages").strip('"\n'))
async def run(self, context):
async def run(self, *args, **kwargs):
context = args[0]
prompt = PROMPT_TEMPLATE.format(context=context, format_example=FORMAT_EXAMPLE)
rsp = await self._aask_v1(prompt, "task", OUTPUT_MAPPING)
self._save(context, rsp)