Skip to content

Commit

Permalink
Merge pull request geekan#57 from Hallimede/main
Browse files Browse the repository at this point in the history
Save requirements.txt and api_spec_and_tasks.md
  • Loading branch information
geekan authored Jul 19, 2023
2 parents bcfec4b + bfc3ea8 commit 4812a50
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions metagpt/actions/project_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@
---
## Required Python third-party packages
```python
"""
flask==1.1.2
"""
```
## Required Other language third-party packages
Expand Down Expand Up @@ -111,11 +109,16 @@ def __init__(self, name="CreateTasks", context=None, llm=None):
def _save(self, context, rsp):
ws_name = CodeParser.parse_str(block="Python package name", text=context[-1].content)
file_path = WORKSPACE_ROOT / ws_name / 'docs/api_spec_and_tasks.md'
file_path.write_text(rsp)
file_path.write_text(rsp.content)

# Write requirements.txt
requirements_path = WORKSPACE_ROOT / ws_name / 'requirements.txt'
requirements_path.write_text(rsp.instruct_content.dict().get("Required Python third-party packages"))

async def run(self, context):
prompt = PROMPT_TEMPLATE.format(context=context, format_example=FORMAT_EXAMPLE)
rsp = await self._aask_v1(prompt, "task", OUTPUT_MAPPING)
self._save(context, rsp)
return rsp


Expand Down

0 comments on commit 4812a50

Please sign in to comment.