下载源码
AutoGPT 官方仓库:https://github.com/Significant-Gravitas/Auto-GPT
安装库
下载后,进入到目录中
# 建一个虚拟环境
conda create -n autoGPT python=3.10
conda activate autoGPT
# 安装使用到的库
pip install requirements.txt
修改配置文件
找到 .env.template
文件,右键修改文件名为 .env
,并且修改 OPEN_API_KEY 为自己的。
API配置:
AutoGPT需要用到以下几个API:
ChatGPT:AutoGPT工具的本质还是利用ChatGPT工作,所以需要接入ChatGPT
Google API及Google Search engine ID:让AutoGPT能够利用谷歌搜索,提高信息准确程度
Pinecone:Pinecone是一个矢量数据库,用于保存AutoGPT运行时生成的数据
ElevenLabs(可选):提供语音功能
API详细获取教程:
https://blog.csdn.net/E_Magic_Cube/article/details/130191306
运行
需要在VPN的环境下进行,因为chatGPT、Google目前需要翻墙才能运行。
python -m autogpt -- continuous --gpt3only
--continuous
参数表示自动确认命令,不需要你手动去确认,--gpt3only
参数表示只用gpt3模型
在windows也可以直接运行该目录下的run.bat
,其内的代码如下。
@echo off
setlocal enabledelayedexpansion
:FindPythonCommand
for %%A in (python python3) do (
where /Q %%A
if !errorlevel! EQU 0 (
set "PYTHON_CMD=%%A"
goto :Found
)
)
echo Python not found. Please install Python.
pause
exit /B 1
:Found
%PYTHON_CMD% scripts/check_requirements.py requirements.txt
if errorlevel 1 (
echo Installing missing packages...
%PYTHON_CMD% -m pip install -r requirements.txt
)
%PYTHON_CMD% -m autogpt %*
pause
autoGPT命令的帮助手册如下:
(autoGPT) PS D:\test\Auto-GPT-master> python -m autogpt --help
Usage: python -m autogpt [OPTIONS] COMMAND [ARGS]...
Welcome to AutoGPT an experimental open-source application showcasing the
capabilities of the GPT-4 pushing the boundaries of AI.
Start an Auto-GPT assistant.
Options:
-c, --continuous Enable Continuous Mode
-y, --skip-reprompt Skips the re-prompting messages at the
beginning of the script
-C, --ai-settings TEXT Specifies which ai_settings.yaml file to
use, will also automatically skip the re-
prompt.
-P, --prompt-settings TEXT Specifies which prompt_settings.yaml file to
use.
-l, --continuous-limit INTEGER Defines the number of times to run in
continuous mode
--speak Enable Speak Mode
--debug Enable Debug Mode
--gpt3only Enable GPT3.5 Only Mode
--gpt4only Enable GPT4 Only Mode
-m, --use-memory TEXT Defines which Memory backend to use
-b, --browser-name TEXT Specifies which web-browser to use when
using selenium to scrape the web.
--allow-downloads Dangerous: Allows Auto-GPT to download files
natively.
--skip-news Specifies whether to suppress the output of
latest news on startup.
--install-plugin-deps Installs external dependencies for 3rd party
plugins.
--help Show this message and exit.
参考:
1、炸裂的 AutoGPT,鱼皮教你免费用! - 知乎 (zhihu.com)