mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-15 11:02:36 +02:00
fix #560
This commit is contained in:
parent
4f52b47610
commit
bbdbe93809
1 changed files with 4 additions and 1 deletions
|
|
@ -5,6 +5,7 @@
|
|||
"""
|
||||
|
||||
import asyncio
|
||||
import re
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
|
@ -95,9 +96,11 @@ class Researcher(Role):
|
|||
return msg
|
||||
|
||||
def write_report(self, topic: str, content: str):
|
||||
filename = re.sub(r'[\\/:"*?<>|]+', " ", topic)
|
||||
filename = filename.replace("\n", "")
|
||||
if not RESEARCH_PATH.exists():
|
||||
RESEARCH_PATH.mkdir(parents=True)
|
||||
filepath = RESEARCH_PATH / f"{topic}.md"
|
||||
filepath = RESEARCH_PATH / f"{filename}.md"
|
||||
filepath.write_text(content)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue