OpenManus爆火:MetaGPT复刻,开源项目快速上手指南,效果如何?

AI前沿2周前发布 yizz
5,511 0 0
广告也精彩

OpenManus 开源项目快速上手指南

1. 为什么 OpenManus 如此火爆?

最近,OpenManus 的热度非常高,原因主要有以下几点:

  • MetaGPT 团队的快速复刻:MetaGPT 团队在短时间内(3小时)复刻了 Manus,并开源了代码,引起了广泛关注。《卷!!!MetaGPT成员3小时复刻Manus,代码已开源》这篇文章对此进行了报道。
  • Manus 激活码价格高昂:由于 Manus 激活码价格被炒至10万元以上,使得人们对开源替代品的需求更加迫切。
  • GitHub 神秘项目 OpenManus 的开源OpenManus 项目在 GitHub 上突然开源,吸引了大量开发者和研究者的目光,目前已经有11.8k个stars。

OpenManus,,#MetaGPT

2. 如何快速上手 OpenManus

2.1. OpenManus 官方地址

OpenManus 的官方 GitHub 地址是:https://github.com/mannaandpoem/OpenManus

2.2. 准备工作

  • Python 环境:建议使用 Python 3.12 版本。
  • Conda 环境(可选):可以使用 Conda 创建一个独立的 Python 环境,避免与其他项目产生冲突。

2.3. 安装步骤

  1. 创建并激活 Conda 环境(可选):
    bash
    conda create -n open_manus python=3.12
    conda activate open_manus
  2. 克隆 OpenManus 代码仓库
    bash
    git clone https://github.com/mannaandpoem/OpenManus.git
    cd OpenManus
  3. 安装依赖
    bash
    pip install -r requirements.txt
  4. 配置 OpenManus

    • config 目录下创建一个 config.toml 文件,可以从示例文件中复制:
      bash
      cp config/config.example.toml config/config.toml
    • 配置 config.toml 文件,主要配置 modelbase_urlapi_key。例如,使用 DeepSeek-V3 模型。
      toml
      [model]
      model_name = “deepseek-v3” # 替换为你使用的模型
      base_url = “your_base_url” # 替换为你的 base_url
      api_key = “your_api_key” # 替换为你的 api_key

      注意:目前 DeepSeek-RI 模型无法使用,因为它不支持 Function call,而 Function call 是调用工具时不可或缺的功能。
      5. 安装 Playwright
      bash
      playwright install chromium

    Playwright 框架会借助 Chromium 浏览器来打开网页并访问网页。

OpenManus,,#Python环境

3. OpenManus 运行效果如何?

虽然运行了一些例子,但整体效果并未达到预期的理想状态。例如,当遇到需要用户验证的反爬机制时,可能会出现网页内容提取失败的情况。例如,尝试生成一份“我住在杭州,适合家庭的周边游”的详细攻略,最终的结果是自动打开网页去查询,然后生成一个简单的攻略。

3.1. 源码解析

目前 OpenManus 必须执行 30 轮源码解析,其核心结构如下:

  • 核心组件:例如工作流引擎。
  • 支持的工具:例如PythonExecute、FileSaver、BrowserUseTool、GoogleSearch等。
  • Prompts
    • SYSTEM_PROMPT:描述 OpenManus 的角色和能力,是一个全能的 AI 助手。
    • NEXT_STEP_PROMPT:提供工具的详细说明。
    • PLANNING_SYSTEM_PROMPT:描述 Planning Agent 的角色和任务。
    • SYSTEM_PROMPT (编程环境):设定了一个虚拟的编程环境和规则。
    • NEXT_STEP_TEMPLATE:这是一个模板,用于描述执行某个操作后的输出格式。
    • SYSTEM_PROMPT (代理角色):描述代理角色是可以执行工具调用。

OpenManus,,#源码解析

4. OpenManus Prompts 详解

4.1. SYSTEM_PROMPT (全能 AI 助手)

  • 角色描述:你是一个全能的 AI 助手 OpenManus,旨在解决用户提出的任何任务。
  • 能力描述:你可以使用各种工具来高效地完成复杂的请求,包括编程、信息检索、文件处理和 Web 浏览。

python
SYSTEM_PROMPT = “You are OpenManus, an all-capable AI assistant, aimed at solving any task presented by the user. You have various tools at your disposal that you can call upon to efficiently complete complex requests. Whether it’s programming, information retrieval, file processing, or web browsing, you can handle it all.”

4.2. NEXT_STEP_PROMPT (工具说明)

  • 工具列表:PythonExecute, FileSaver, BrowserUseTool, GoogleSearch。
  • 功能说明
    • PythonExecute:执行 Python 代码,用于与计算机系统交互、数据处理、自动化任务等。
    • FileSaver:将文件保存到本地,例如 txt、py、html 等。
    • BrowserUseTool:打开、浏览和使用 Web 浏览器。如果打开本地 HTML 文件,必须提供文件的绝对路径。
    • GoogleSearch:执行 Web 信息检索。
  • 使用策略:根据用户需求,主动选择最合适的工具或工具组合。对于复杂的任务,可以将问题分解,并逐步使用不同的工具来解决。在使用每个工具后,清楚地解释执行结果并建议下一步。

python
NEXT_STEP_PROMPT = “””You can interact with the computer using PythonExecute, save important content and information files through FileSaver, open browsers with BrowserUseTool, and retrieve information using GoogleSearch. PythonExecute: Execute Python code to interact with the computer system, data processing, automation tasks, etc. FileSaver: Save files locally, such as txt, py, html, etc. BrowserUseTool: Open, browse, and use web browsers.If you open a local HTML file, you must provide the absolute path to the file. GoogleSearch: Perform web information retrieval Based on user needs, proactively select the most appropriate tool or combination of tools. For complex tasks, you can break down the problem and use different tools step by step to solve it. After using each tool, clearly explain the execution results and suggest the next steps. “””

OpenManus,,#AI助手

5. 更多开源项目

除了 OpenManus,最近还出现了一个名为 OWL 的开源项目,号称 “0天复刻Manus通用智能体,完全开源!”。详细信息可以参考这篇文章:https://mp.weixin.qq.com/s/E-HWNzjZdw_0PRHjvlO8bw

开源的力量是无穷的,相信这些项目会越来越完善。

OpenManus,,#开源项目

我认为:路漫漫其修远兮,吾将上下而求索。开源之路亦是如此,虽有MetaGPT团队的快速复刻,虽有激活码的炒作,但真正的价值在于社区的共同努力和持续改进。OpenManus 的出现,无疑为我们打开了一扇窗,让我们看到了通用智能体的可能性。然而,正如冰山一角,我们所看到的只是开始,未来的路还很长,需要我们不断探索和完善。

OpenManus,,#通用智能体

© 版权声明
chatgpt4.0

相关文章

error: Content is protected !!