From 229d6706a493c4ce0f23446c673d95a21a72f881 Mon Sep 17 00:00:00 2001 From: liangxinbing <1580466765@qq.com> Date: Tue, 11 Mar 2025 07:31:18 +0800 Subject: [PATCH] format code --- README.md | 6 +----- README_zh.md | 4 ---- app.py | 2 +- app/flow/base.py | 10 ++++++---- app/flow/planning.py | 8 +++++--- 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index e035313..5075ae2 100644 --- a/README.md +++ b/README.md @@ -130,10 +130,6 @@ We welcome any friendly suggestions and helpful contributions! Just create issue Or contact @mannaandpoem via 📧email: mannaandpoem@gmail.com -## Roadmap - -- [ ] Improve the UI’s visual appeal to create a more intuitive and seamless user experience. - ## Community Group Join our networking group on Feishu and share your experience with other developers! @@ -162,4 +158,4 @@ OpenManus is built by contributors from MetaGPT. Huge thanks to this agent commu journal = {GitHub repository}, howpublished = {\url{https://github.com/mannaandpoem/OpenManus}}, } -``` \ No newline at end of file +``` diff --git a/README_zh.md b/README_zh.md index fb50333..fef68c1 100644 --- a/README_zh.md +++ b/README_zh.md @@ -130,10 +130,6 @@ python run_flow.py 或通过 📧 邮件联系 @mannaandpoem:mannaandpoem@gmail.com -## 发展路线 - -- [ ] 提高用户界面的视觉吸引力,以创建更直观和无缝的用户体验。 - ## 交流群 加入我们的飞书交流群,与其他开发者分享经验! diff --git a/app.py b/app.py index 79bd0f6..b827484 100644 --- a/app.py +++ b/app.py @@ -244,4 +244,4 @@ async def generic_exception_handler(request: Request, exc: Exception): if __name__ == "__main__": import uvicorn - uvicorn.run(app, host="localhost", port=5172) \ No newline at end of file + uvicorn.run(app, host="localhost", port=5172) diff --git a/app/flow/base.py b/app/flow/base.py index 841c9cc..13066ce 100644 --- a/app/flow/base.py +++ b/app/flow/base.py @@ -61,23 +61,25 @@ class BaseFlow(BaseModel, ABC): async def execute(self, input_text: str) -> str: """Execute the flow with given input""" + class PlanStepStatus(str, Enum): """Enum class defining possible statuses of a plan step""" + NOT_STARTED = "not_started" IN_PROGRESS = "in_progress" COMPLETED = "completed" BLOCKED = "blocked" - + @classmethod def get_all_statuses(cls) -> list[str]: """Return a list of all possible step status values""" return [status.value for status in cls] - + @classmethod def get_active_statuses(cls) -> list[str]: """Return a list of values representing active statuses (not started or in progress)""" return [cls.NOT_STARTED.value, cls.IN_PROGRESS.value] - + @classmethod def get_status_marks(cls) -> Dict[str, str]: """Return a mapping of statuses to their marker symbols""" @@ -85,5 +87,5 @@ class PlanStepStatus(str, Enum): cls.COMPLETED.value: "[✓]", cls.IN_PROGRESS.value: "[→]", cls.BLOCKED.value: "[!]", - cls.NOT_STARTED.value: "[ ]" + cls.NOT_STARTED.value: "[ ]", } diff --git a/app/flow/planning.py b/app/flow/planning.py index aad172f..808949f 100644 --- a/app/flow/planning.py +++ b/app/flow/planning.py @@ -337,13 +337,15 @@ class PlanningFlow(BaseFlow): plan_text += "Steps:\n" status_marks = PlanStepStatus.get_status_marks() - + for i, (step, status, notes) in enumerate( zip(steps, step_statuses, step_notes) ): # Use status marks to indicate step status - status_mark = status_marks.get(status, status_marks[PlanStepStatus.NOT_STARTED.value]) - + status_mark = status_marks.get( + status, status_marks[PlanStepStatus.NOT_STARTED.value] + ) + plan_text += f"{i}. {status_mark} {step}\n" if notes: plan_text += f" Notes: {notes}\n"