mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-05 14:55:18 +02:00
Fixed the workspace directory does not exist
This commit is contained in:
parent
ccc4c9e04d
commit
9ccf1e8b82
1 changed files with 2 additions and 0 deletions
|
|
@ -49,6 +49,8 @@ class CreateAgent(Action):
|
|||
pattern = r'```python(.*)```'
|
||||
match = re.search(pattern, rsp, re.DOTALL)
|
||||
code_text = match.group(1) if match else ""
|
||||
if not WORKSPACE_ROOT.exists():
|
||||
WORKSPACE_ROOT.mkdir(parents=True)
|
||||
with open(WORKSPACE_ROOT / "agent_created_agent.py", "w") as f:
|
||||
f.write(code_text)
|
||||
return code_text
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue