|
| 1 | +from pydantic import Field, model_validator |
| 2 | + |
| 3 | +from app.agent.planning import PlanningAgent |
| 4 | +from app.agent.toolcall_en import ToolCallAgent |
| 5 | +from app.tool import ToolCollection, Bash, Terminate |
| 6 | +from app.tool.planning import PlanningTool |
| 7 | +from app.tool.browser_use_tool import BrowserUseTool |
| 8 | +from app.tool.google_search import GoogleSearch |
| 9 | +from app.tool.python_execute import PythonExecute |
| 10 | +from app.tool.file_saver import FileSaver |
| 11 | + |
| 12 | +from app.prompt.manus import SYSTEM_PROMPT, NEXT_STEP_PROMPT |
| 13 | + |
| 14 | + |
| 15 | +class Manus(ToolCallAgent): |
| 16 | + """ |
| 17 | + A versatile general-purpose agent that uses planning to solve various tasks. |
| 18 | +
|
| 19 | + This agent extends PlanningAgent with a comprehensive set of tools and capabilities, |
| 20 | + including Python execution, web browsing, file operations, and information retrieval |
| 21 | + to handle a wide range of user requests. |
| 22 | + """ |
| 23 | + |
| 24 | + name: str = "Manus" |
| 25 | + description: str = "A versatile agent that can solve various tasks using multiple tools" |
| 26 | + |
| 27 | + system_prompt: str = SYSTEM_PROMPT |
| 28 | + next_step_prompt: str = NEXT_STEP_PROMPT |
| 29 | + |
| 30 | + # Add general-purpose tools to the tool collection |
| 31 | + available_tools: ToolCollection = Field( |
| 32 | + default_factory=lambda: ToolCollection( |
| 33 | + PythonExecute(), GoogleSearch(), BrowserUseTool(), FileSaver(), Terminate() |
| 34 | + ) |
| 35 | + ) |
| 36 | + |
0 commit comments