一.GPTs
智能体以大模型作为大脑,同时配备技能,使其能够完成具体的任务。同时,为了应用于垂直领域,我们需要为大模型定义一个角色,并构建知识库。最后,定义完整的流程,使其完成整个任务。以组会汇报的智能体为例,定义如下

1.创建自己的gpt


2.角色定义
该 Agent 是一种智能化助理,专为研究人员和学生设计,用于调研计算机领域顶级会议的论文。它能够自动访问各大顶级会议网站,搜索并下载相关论文,并对论文内容进行整理分析,最终生成易于理解的思维导图。这些思维导图旨在帮助用户快速把握论文的核心内容、研究方法、实验结果和研究意义。
3.任务流程
步骤 1: 搜索顶级会议论文
- 技能使用 :
#2N GoogleSearch
。 - 操作:使用 GoogleSearch 技能根据用户指定的关键词进行搜索,找到相关的顶级会议论文列表。
步骤 2: 获取论文链接和内容
- 技能使用 :
#2K ReadArXiv
。 - 操作:对于在 arXiv 上可找到的论文,使用 ReadArXiv 技能通过提供的 arXiv 链接直接获取论文的内容。
步骤 3: 提取论文的文本内容
- 技能使用 :
#2J ReadWebpage
。 - 操作:对于非 arXiv 的论文,使用 ReadWebpage 技能从会议官网或其他来源抓取论文的全文内容。
步骤 4: 生成思维导图
- 技能使用 :
#2H GenerateMindMap
。 - 操作:将步骤 3 中获取的文本内容输入到 GenerateMindMap 技能中,自动创建出基于论文内容的思维导图。
步骤 5: 结果呈现
- 技能使用:无需额外技能。
- 操作:将生成的思维导图显示给用户,用户可以直接查看或下载。
4.技能配置
网站:Gapier: Free Actions for ChatGPT Users|custom gpts|ChatGPT Actions|GPTs Actions

添加技能:

添加API秘钥

导入URL

测试API能否使用

其他提供技能API的网站
(1)语聚AI

(2) 官方网站提供的接口
例如:stable diffusion

2.Auto Gen
(1) 环境配置
需要新建一个环境,python一定要是3.10以上
即:
conda create -n agent python==3.10
conda activate agent
pip install autogenstudio
启动服务
autogenstudio ui --port 8081
(2)配置GPT-4的key
在安装agent环境目录下配置GPT-4的key
F:\Anaconda\envs\agent\Lib\site-packages\openai

国内中转GPT4-key的获取
GPT4.0 API KEY By OPENAI HK 中转ChatGPT
https://www.jcapikey.com/register?aff=JQLr

如果部署本地大模型,只需要指定base_url

(3)配备技能
实例1:使用飞书作为技能
获取API并查看参数。docx/O738dALTAoNPQBxnFwNcTnYKnPb

对应的python代码,需要document_id和user_access_token
import requests
def get_feishu(doc_id):
"""
:param doc_id: 输入需求文档编号
:return: 返回文档对应文字内容
"""
url = f"https://open.feishu.cn/open-apis/docx/v1/documents/{doc_id}/raw_content?lang=0"
payload = ''
headers = {
'Authorization': 'Bearer u-dJELIIPZ13paEMIal.HHWY455jq5l5jFj0G011M029Gk'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
return response.text
get_feishu('BYtpdYql5oVwvzxmzvFcLGG8nNW')
将上面的函数添加到技能中

案例2:配备抖音
使用语聚AI连接抖音的接口
(4)配置智能体
(5)定义流程
