format code

This commit is contained in:
liangxinbing 2025-03-11 07:31:18 +08:00
parent d9418c1668
commit 229d6706a4
5 changed files with 13 additions and 17 deletions

View File

@ -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 UIs 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}},
}
```
```

View File

@ -130,10 +130,6 @@ python run_flow.py
或通过 📧 邮件联系 @mannaandpoemmannaandpoem@gmail.com
## 发展路线
- [ ] 提高用户界面的视觉吸引力,以创建更直观和无缝的用户体验。
## 交流群
加入我们的飞书交流群,与其他开发者分享经验!

2
app.py
View File

@ -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)
uvicorn.run(app, host="localhost", port=5172)

View File

@ -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: "[ ]",
}

View File

@ -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"