Skip to content

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

fixbug: empty string causes aiofiles.open exepctition

莘权 马35470dcee4d4
diff --git a/examples/write_teaching_plan.py b/examples/write_teaching_plan.py
index da97a5463..86125f090 100644
--- a/examples/write_teaching_plan.py
+++ b/examples/write_teaching_plan.py
@@ -62,7 +62,7 @@ async def startup(lesson_file: str, investment: float = 3.0, n_round: int = 1, *
"""
lesson = ""
- if lesson_file is not None and Path(lesson_file).exists():
+ if lesson_file and Path(lesson_file).exists():
async with aiofiles.open(lesson_file, mode="r", encoding="utf-8") as reader:
lesson = await reader.read()
logger.info(f"Course content: {lesson}")