网站建设遵循的规范,腾讯qq官网登录入口,做哪个行业的网站好,福州搜索优化网站之前跟着《MetaGPT智能体开发入门课程》学了一些MetaGPT的知识和实践#xff0c;主要关注在MetaGPT入门和单智能体部分#xff08;系列文章附在文末#xff0c;感兴趣的可以看下#xff09;。现在新的教程来了#xff0c;新教程主要关注多智能体部分。
本系列文章跟随《M…之前跟着《MetaGPT智能体开发入门课程》学了一些MetaGPT的知识和实践主要关注在MetaGPT入门和单智能体部分系列文章附在文末感兴趣的可以看下。现在新的教程来了新教程主要关注多智能体部分。
本系列文章跟随《MetaGPT多智能体课程》https://github.com/datawhalechina/hugging-multi-agent深入理解并实践多智能体系统的开发。
本文为该课程的前期准备 - 环境搭建。 文章目录 0. 环境准备中遇到的坑0.1 环境升级0.2 坑一1 validation error for Config0.3 坑二No module named pwd0.4 运行成功 附之前MetaGPT单智能体课程的系列笔记 0. 环境准备中遇到的坑
0.1 环境升级
距离上次单智能体的入门课程已经过了一个多月了这一个月间MetaGPT也在快速迭代0.5版本到0.6版本再到0.7版本。要用就用最新的… 所以我升级了0.7版本。并且从源码安装
git clone https://github.com/geekan/MetaGPT.git
cd /your/path/to/MetaGPT
pip install -e .更具体和更多的安装方式可参考官方教程。
升级的过程很顺利然后运行示例程序检验环境是否能用。先不要管这个程序是干嘛的直接拷贝到一个python文件中点运行。
import asynciofrom metagpt.actions import Action
from metagpt.environment import Environment
from metagpt.roles import Role
from metagpt.team import Teamaction1 Action(nameAlexSay, instructionExpress your opinion with emotion and dont repeat it)
action2 Action(nameBobSay, instructionExpress your opinion with emotion and dont repeat it)
alex Role(nameAlex, profileDemocratic candidate, goalWin the election, actions[action1], watch[action2])
bob Role(nameBob, profileRepublican candidate, goalWin the election, actions[action2], watch[action1])
env Environment(descUS election live broadcast)
team Team(investment10.0, envenv, roles[alex, bob])asyncio.run(team.run(ideaTopic: climate change. Under 80 words per message., send_toAlex, n_round5))0.2 坑一1 validation error for Config 这是因为没有设置API key导致的。找到 MetaGPT/config/config2.yaml文件修改里面的参数把你的keymodel等填进去 0.3 坑二No module named ‘pwd’ 这是因为Windows环境下没有pwd命令。因为这是封装在langchain内部的我们不太好改源码。可以用以下两种解决方法
1换 WSL 环境来运行程序
2还是Windows环境将 langchain 的版本换一下
pip install langchain0.1.6
pip install langchain-community0.0.19所以如果你是Windows环境那么大概也只能使用 WSL 来运行程序了。
0.4 运行成功
运行后的输出应该类似下图这样 至此环境准备好了。
附之前MetaGPT单智能体课程的系列笔记
【AI的未来 - AI Agent系列】【MetaGPT】0. 你的第一个MetaGPT程序【AI的未来 - AI Agent系列】【MetaGPT】1. AI Agent如何重构世界【AI的未来 - AI Agent系列】【MetaGPT】2. 实现自己的第一个Agent【AI的未来 - AI Agent系列】【MetaGPT】3. 实现一个订阅智能体订阅消息并打通微信和邮件【AI的未来 - AI Agent系列】【MetaGPT】4. ActionNode从理论到实战【AI的未来 - AI Agent系列】【MetaGPT】4.1 细说我在ActionNode实战中踩的那些坑【AI的未来 - AI Agent系列】【MetaGPT】5. 更复杂的Agent实战 - 实现技术文档助手【AI的未来 - AI Agent系列】【MetaGPT】6. 用ActionNode重写技术文档助手【AI Agent系列】【MetaGPT】7. 实战只用两个字让MetaGPT写一篇小说【AI Agent系列】【MetaGPT】8. 一句话订阅专属信息 - 订阅智能体进阶实现一个更通用的订阅智能体【AI Agent系列】【MetaGPT】9. 一句话订阅专属信息 - 订阅智能体进阶实现一个更通用的订阅智能体2【AI Agent系列】【MetaGPT】【深入源码】智能体的运行周期以及多智能体间如何协作【AI Agent系列】【MetaGPT】总结这段时间学习MetaGPT的一些学习方法和感悟