Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
mannaandpoem committed Mar 10, 2025
1 parent d9418c1 commit 229d670
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 17 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand Down Expand Up @@ -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}},
}
```
```
4 changes: 0 additions & 4 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,6 @@ python run_flow.py

或通过 📧 邮件联系 @mannaandpoemmannaandpoem@gmail.com

## 发展路线

- [ ] 提高用户界面的视觉吸引力,以创建更直观和无缝的用户体验。

## 交流群

加入我们的飞书交流群,与其他开发者分享经验!
Expand Down
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
10 changes: 6 additions & 4 deletions app/flow/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,31 @@ def add_agent(self, key: str, agent: BaseAgent) -> None:
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"""
return {
cls.COMPLETED.value: "[✓]",
cls.IN_PROGRESS.value: "[→]",
cls.BLOCKED.value: "[!]",
cls.NOT_STARTED.value: "[ ]"
cls.NOT_STARTED.value: "[ ]",
}
8 changes: 5 additions & 3 deletions app/flow/planning.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,15 @@ def _generate_plan_text_from_storage(self) -> str:
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"
Expand Down

0 comments on commit 229d670

Please # to comment.