任务:
使用 Lagent 复现文档中 “制作一个属于自己的Agent” 和 “Multi-Agents博客写作系统的搭建”两部分内容,记录复现过程并截图。]
操作过程:
一、制作一个属于自己的Agent
1、启动开发机
2、配置环境并安装agent
# 创建环境
conda create -n lagent python=3.10 -y
# 激活环境
conda activate lagent
# 安装 torch
conda install pytorch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 pytorch-cuda=12.1 -c pytorch -c nvidia -y
# 安装其他依赖包
pip install termcolor==2.4.0
pip install streamlit==1.39.0
pip install class_registry==2.1.2
pip install datasets==3.1.0
3、创建agent_api_web_demo.py
4、在终端中将获取的API密钥写入环境变量,然后启动程序
对比有无ArxivSearch插件的演示效果:
5、搭建查询实时天气的agent
注册并获得和风天气的 API