OpenManus实战-基于Ollama+qwen2.5搭建openmanus

0 环境准备

  • ollama已部署推理模型qwen:7b(deepseek目前不支持function calling)
  • 已安装miniconda环境
  • 具备科学上网条件

1 OpenManus安装

1.1 下载OpenManus源码包

https://github.com/mannaandpoem/OpenManus/archive/refs/heads/main.zip

1.2 复制配置文件

        解压下载的源码后,讲config目录下面的config.example-model-ollama.toml复制一份,命名为config.toml

 cp .\config\config.example-model-ollama.toml .\config\config.toml

1.3 修改配置文件

        windows环境下使用notepad命令打开配置文件,此处以windows环境为例,linux环境可以使用vim打开配置文件。

notepad .\config\config.toml

        修改成qwen2.5:7b模型,如下图:

# Global LLM configuration
[llm] #OLLAMA:
api_type = 'ollama'
model = "qwen2.5:7b"                                                 # The LLM model to use
base_url = "http://localhost:11434/v1"                             # API endpoint URL
api_key = "ollama"                                                 # Your API key
max_tokens = 8192                                                  # Maximum number of tokens in the response
temperature = 0.0                                                  # Controls randomness

2 python环境准备

        建议使用conda创建python。

2.1 创建python环境

conda create -n open_manus python=3.12

2.2 激活python环境

conda activate open_manus

2.3 安装依赖包

进入解压后的openmanus目录,安装openmanus需要的安装包。

pip install -r requirements.txt

等待安装完成。

3 运行openmanus

        执行main.py脚本

python .\main.py

4 测试效果

4.1 此处问的是武汉的天气,如下图:

4.2 可以看到openmanus需要执行的步骤以及执行的进度

4.3 openmanus编写抓取天气脚本

附录

问题-运行脚本错误

File "E:\dev\conda\envs\open_manus\Lib\asyncio\windows_utils.py", line 102, in fileno
    raise ValueError("I/O operation on closed pipe")
ValueError: I/O operation on closed pipe

openmanus编写的脚本基于linux环境编写的。在windows环境下执行会报错,建议在linux环境下安装openmanus。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值