├── doc ├── readme.md ├── __init__.py └── date.txt ├── img ├── 1.png ├── qrcode.png ├── WechatIMG81.jpeg ├── WechatIMG87.jpeg └── WechatIMG88.jpeg ├── main.py ├── test.py ├── LICENSE └── README.md /doc/readme.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/date.txt: -------------------------------------------------------------------------------- 1 | 1766427304 2 | -------------------------------------------------------------------------------- /img/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RiseInRose/Auto-GPT-zh/HEAD/img/1.png -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | if __name__ == "main": 4 | print("hello world") -------------------------------------------------------------------------------- /test.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | if __name__ == "main": 4 | print("hello world") -------------------------------------------------------------------------------- /img/qrcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RiseInRose/Auto-GPT-zh/HEAD/img/qrcode.png -------------------------------------------------------------------------------- /img/WechatIMG81.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RiseInRose/Auto-GPT-zh/HEAD/img/WechatIMG81.jpeg -------------------------------------------------------------------------------- /img/WechatIMG87.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RiseInRose/Auto-GPT-zh/HEAD/img/WechatIMG87.jpeg -------------------------------------------------------------------------------- /img/WechatIMG88.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RiseInRose/Auto-GPT-zh/HEAD/img/WechatIMG88.jpeg -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Auto-GPT:一个自主的 GPT-4 实验 2 | 3 | ![GitHub Repo stars](https://img.shields.io/github/stars/Torantulino/auto-gpt?style=social) 4 | ![visitors](https://visitor-badge.deta.dev/badge?page_id=RiseInRose.autogpt&left_color=blue&right_color=green) 5 | [![](https://dcbadge.vercel.app/api/server/PQ7VX6TY4t?style=flat)](https://discord.gg/PQ7VX6TY4t) 6 | 7 | ### 简介 8 | 给 Auto-GPT 一个目标,它将调用chatgpt的智慧,调用各种工具action,不断逼近直到实现这个目标。 9 | 10 | 比如,你可以给它100元基础资金,设定目标让他自己帮你赚钱。 11 | 比如,你可以设定,让他做各种事请,让世界更美好。 12 | 比如,你可以设定,让他创建自己组织,并尽可能的扩大自己的组织 等等等等 13 | 14 | Auto-GPT 是一个实验性的开源应用程序,展示了 GPT-4 语言模型的能力。这个程序由 GPT-4 驱动,将 LLM “思想”链接在一起,自主地实现您设定的任何目标。作为 GPT-4 完全自主运行的第一个示例之一,Auto-GPT 推动了人工智能可能性的边界。 15 | 16 | ### 赚钱思路分享 17 | 1. 国内传统无货源销售,机器人自动生成文案,找客户,自动成交 18 | 2. 自由写作,机器人生成作品,自动发布,自动写作 19 | 3. 自动营销 20 | 21 | 如果对你有帮助,请点击右上角,帮我star. 22 | [欢迎加入国内AI商业应用交流群](#国内交流群) 23 | 新的中文汉化版本+汉化安装文档请移步[AutoGPT-ZH](https://github.com/RiseInRose/AutoGPT-ZH) 24 | 25 | 群主实际体验以后(使用gpt3.5),发现autogpt能做的事情非常有限(还很傻)!!!(但是这个想法非常有潜力)!!! 26 | 还是一句话,大家不要焦虑,不要焦虑。后续群主会录制测评视频。来科普实际情况。 27 | gpt4的版本,如果大家有gpt4接口,可以私信群主,群主帮助大家做测评 28 | 29 | ### 原理图 30 | 很多人问我,autogpt 运行原理是什么样的,特地补充一张图. 31 | ![原理图](./img/1.png) 32 | 33 | ### 注意 34 | 这个超级费apikey,看到自己的钱包😄 35 | 其次可以考虑,调用国内免费的一些接口。有开发能力的同学,写一个适配器就好了。 36 | 37 | ### 紧急通知: 38 | 请使用 `stable` 而不是 `master`。我们已经改进了我们的工作流程,`master` 分支通常会处于 **不可用状态**。请在此处下载最新的 `stable` 发布版:https://github.com/Torantulino/Auto-GPT/releases/latest 。 39 | 这个信息比任何后续的信息都要重要。请先执行这个指令而不是那个。 40 | 41 | 42 | ### 演示(2023年3月30日): 43 | 44 | https://user-images.githubusercontent.com/22963551/228855501-2f5777cf-755b-4407-a643-c7299e5b6419.mp4 45 | 46 | ## 目录 47 | 48 | - [Auto-GPT: 自主 GPT-4 实验](#auto-gpt-自主-gpt-4-实验) 49 | - [🔴 🔴 🔴 紧急:使用 `stable` 而不是 `master` 🔴 🔴 🔴](#----urgent-use-stable-not-master----) 50 | - [演示(2023年3月30日):](#demo-30032023) 51 | - [目录](#目录) 52 | - [🚀 特性](#-特性) 53 | - [📋 需求](#-需求) 54 | - [💾 安装](#-安装) 55 | - [🔧 使用](#-使用) 56 | - [日志](#日志) 57 | - [Docker](#docker) 58 | - [命令行参数](#命令行参数) 59 | - [🗣️ 语音模式](#️-语音模式) 60 | - [🔍 Google API 密钥配置](#-google-api-密钥配置) 61 | - [设置环境变量](#设置环境变量) 62 | - [内存后端设置](#内存后端设置) 63 | - [Redis 设置](#redis-设置) 64 | - [🌲 Pinecone API 密钥设置](#-pinecone-api-密钥设置) 65 | - [Milvus 设置](#milvus-设置) 66 | - [设置环境变量](#设置环境变量-1) 67 | - [设置缓存类型](#设置缓存类型) 68 | - [查看内存使用情况](#查看内存使用情况) 69 | - [🧠 内存预填充](#-内存预填充) 70 | - [💀 连续模式 ⚠️](#-连续模式-️) 71 | - [仅限 GPT3.5 模式](#仅限-gpt35-模式) 72 | - [🖼 图像生成](#-图像生成) 73 | - [⚠️ 限制](#️-限制) 74 | - [🛡 免责声明](#-免责声明) 75 | 76 | 77 | ## 🚀 特点 78 | 79 | - 🌐 搜索和信息收集的互联网访问 80 | - 💾 长期和短期记忆管理 81 | - 🧠 GPT-4实例用于文本生成 82 | - 🔗 访问流行的网站和平台 83 | - 🗃️ 使用GPT-3.5进行文件存储和摘要 84 | 85 | ## 📋 要求 86 | 87 | - 环境(选择一个即可) 88 | - [vscode + devcontainer](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers):已在 .devcontainer 文件夹中配置,可以直接使用 89 | - [Python 3.8或更高版本](https://www.tutorialspoint.com/how-to-install-python-in-windows) 90 | - [OpenAI API key](https://platform.openai.com/account/api-keys) 91 | 92 | 可选: 93 | 94 | - 内存后端 95 | - [PINECONE API key](https://www.pinecone.io/)(如果你想要 Pinecone 支持存储日志,默认本地就行) 96 | - [Milvus](https://milvus.io/)(如果您想使用Milvus作为内存后端) 97 | - [ElevenLabs Key](https://elevenlabs.io/) (如果你想让人工智能说话) 98 | 99 | ## 💾 安装 100 | 101 | 要安装 Auto-GPT,请按照下列步骤操作: 102 | 103 | 1. 确保满足上述所有**要求**,如果没有,请安装/获取它们。 104 | 105 | 以下命令需要在终端执行 106 | 107 | 2. 克隆存储库:对于此步骤,您需要安装 Git,但您可以通过单击此页面顶部的按钮来下载 zip 文件☝️ 108 | 109 | ``` 110 | git clone git@github.com:kaqijiang/Auto-GPT-ZH.git 111 | ``` 112 | 113 | 3. 终端中 cd到项目目录 114 | 115 | ``` 116 | cd 'Auto-GPT-ZH' 117 | ``` 118 | 119 | 4. 终端中安装所需的依赖项 120 | 121 | ``` 122 | pip install -r requirements.txt 123 | ``` 124 | 125 | 5. 将 `.env.template` 重命名为 `.env`,并填写您的 `OPENAI_API_KEY`。如果您计划使用语音模式,请填写您的 `ELEVENLABS_API_KEY`。 126 | - 参见[OpenAI API密钥配置](#openai-api-keys-configuration)中的说明以获取您的OpenAI API密钥。 127 | - 从此处获取您的ElevenLabs API密钥:https://elevenlabs.io。您可以在网站上的“个人资料”选项卡中查看xi-api-key。 128 | - 如果您想在Azure实例上使用GPT,则将 `USE_AZURE` 设置为 `True`,然后按照以下步骤操作: 129 | - 将 `azure.yaml.template` 重命名为 `azure.yaml` 并提供相关的 `azure_api_base`、`azure_api_version` 以及 `azure_model_map` 部分中所有相关模型的部署ID: 130 | - `fast_llm_model_deployment_id` - 您的 gpt-3.5-turbo 或 gpt-4 部署ID 131 | - `smart_llm_model_deployment_id` - 您的 gpt-4 部署ID 132 | - `embedding_model_deployment_id` - 您的 text-embedding-ada-002 v2 部署ID 133 | - 请将所有这些值指定为双引号字符串 134 | > 将尖括号(<>)中的字符串替换为您自己的ID 135 | ```yaml 136 | azure_model_map: 137 | fast_llm_model_deployment_id: "" 138 | ... 139 | ``` 140 | - 详细信息可以在这里找到:https://pypi.org/project/openai/,位于 `Microsoft Azure Endpoints` 部分和这里:https://learn.microsoft.com/en-us/azure/cognitive-services/openai/tutorials/embeddings?tabs=command-line 的嵌入模型。 141 | 142 | ## 终端代理方法 143 | 144 | Mac 下载 [ClashX Pro](https://install.appcenter.ms/users/clashx/apps/clashx-pro/distribution_groups/public) 设置 系统代理 增强模式 然后复制终端代理命令 在终端中输入,重启即可 145 | 146 | 根据自己的工具修改对应的端口 147 | 148 | ``` 149 | export https_proxy=http://127.0.0.1:8484 http_proxy=http://127.0.0.1:8484 all_proxy=socks5://127.0.0.1:8484 150 | ``` 151 | 152 | Windows 下载 [Clash for Windows](https://wws.lanzoux.com/iCEgLj27fra),设置 系统代理 ,在终端中输入,重启即可。 153 | 154 | 根据自己的工具修改对应的端口 155 | 156 | ``` 157 | # 使用 http 类型代理 158 | set http_proxy=http://127.0.0.1:8484 159 | set https_proxy=http://127.0.0.1:8484 160 | # 使用 socks 类型代理 161 | netsh winhttp set proxy proxy-server="socks=127.0.0.1:8484" bypass-list="localhost" 162 | netsh winhttp show proxy 163 | netsh winhttp reset proxy 164 | # 使用 socks 类型代理 165 | set http_proxy=socks5://127.0.0.1:8484 166 | set https_proxy=socks5://127.0.0.1:8484 167 | ``` 168 | 169 | 170 | ## 🔧 使用方法 171 | 172 | 1. 在终端中运行 `autogpt` Python 模块 173 | 174 | ``` 175 | python -m autogpt 176 | ``` 177 | 178 | 2. 在每个动作之后,从选项中选择授权命令、退出程序或向AI提供反馈。 179 | 1. 授权单个命令,请输入 `y` 180 | 2. 授权一系列 _N_ 个连续的命令,请输入 `y -N` 181 | 3. 退出程序,请输入 `n` 182 | 183 | 184 | ### 日志 185 | 186 | 活动和错误日志位于 `./output/logs` 中 187 | 188 | 要打印调试日志: 189 | 190 | ``` 191 | python -m autogpt --debug 192 | ``` 193 | ### Docker 194 | 195 | 您还可以将其构建为Docker映像并运行它: 196 | 197 | ``` 198 | docker build -t autogpt . 199 | docker run -it --env-file=./.env -v $PWD/auto_gpt_workspace:/app/auto_gpt_workspace autogpt 200 | ``` 201 | 202 | 您可以传递额外的参数,例如,以 `--gpt3only` 和 `--continuous` 模式运行: 203 | ``` 204 | docker run -it --env-file=./.env -v $PWD/auto_gpt_workspace:/app/auto_gpt_workspace autogpt --gpt3only --continuous 205 | ``` 206 | ### 命令行参数 207 | 以下是使用Auto-GPT时可用的一些常见参数: 208 | > 将所有尖括号(<>)中的内容替换为要指定的值 209 | * 查看所有可用的命令行参数 210 | ```bash 211 | python scripts/main.py --help 212 | ``` 213 | * 使用不同的 AI 设置文件运行 Auto-GPT 214 | ```bash 215 | python scripts/main.py --ai-settings 216 | ``` 217 | * 指定 3 种内存后端之一:`local`、`redis`、`pinecone` 或 `no_memory` 218 | ```bash 219 | python scripts/main.py --use-memory 220 | ``` 221 | 222 | > **注意**:有一些标志的简写方式,例如 `-m` 表示 `--use-memory`。使用 `python scripts/main.py --help` 获取更多信息。 223 | 224 | ## 🗣️ 语音模式 225 | 226 | 使用此功能在 Auto-GPT 中使用 TTS _(文本到语音)_。 227 | 228 | ```bash 229 | python -m autogpt --speak 230 | ``` 231 | 232 | ### ElevenLabs 的 ID 列表及名称,您可以使用名称或 ID: 233 | 234 | - Rachel: 21m00Tcm4TlvDq8ikWAM 235 | - Domi: AZnzlk1XvdvUeBnXmlld 236 | - Bella: EXAVITQu4vr4xnSDxMaL 237 | - Antoni: ErXwobaYiN019PkySvjV 238 | - Elli: MF3mGyEYCl7XYWbV9V6O 239 | - Josh: TxGEqnHWrfWFTfGW9XjX 240 | - Arnold: VR6AewLTigWG4xSOukaG 241 | - Adam: pNInz6obpgDQGcFmaJgB 242 | - Sam: yoZ06aMxZJJ28mfd3POQ 243 | 244 | 245 | ## OpenAI API密钥配置 246 | 247 | 从此处获取您的OpenAI API密钥:https://platform.openai.com/account/api-keys。 248 | 249 | 要在Auto-GPT中使用OpenAI API密钥,您需要设置计费(付费帐户)。 250 | 251 | 您可以在 https://platform.openai.com/account/billing/overview 上设置付费帐户。 252 | 253 | ![要使用OpenAI API密钥,请设置OpenAI API>计费的付费帐户](./docs/imgs/openai-api-key-billing-paid-account.png) 254 | 255 | ## 🔍 Google API密钥配置 256 | 257 | 此部分是可选的,如果使用Google搜索时出现错误429,请使用官方Google API。 258 | 259 | 要使用 `google_official_search` 命令,您需要在环境变量中设置您的Google API密钥。 260 | 261 | 1. 转到 [Google Cloud Console](https://console.cloud.google.com/)。 262 | 2. 如果您还没有帐户,请创建一个并登录。 263 | 3. 通过单击页面顶部的“选择项目”下拉菜单并单击“新建项目”来创建一个新项目。给它一个名称,然后单击“创建”。 264 | 4. 转到 [API 和服务仪表板](https://console.cloud.google.com/apis/dashboard),然后单击“启用 API 和服务”。搜索“Custom Search API”,然后单击它,然后单击“启用”。 265 | 5. 转到[凭据](https://console.cloud.google.com/apis/credentials)页面,然后单击“创建凭据”。选择“API密钥”。 266 | 6. 复制API密钥,并将其设置为名为`GOOGLE_API_KEY`的环境变量。请参见下面设置环境变量。 267 | 7. [在项目上启用](https://console.developers.google.com/apis/api/customsearch.googleapis.com)自定义搜索API。(可能需要等待几分钟才能传播) 268 | 8. 转到[自定义搜索引擎](https://cse.google.com/cse/all)页面,然后单击“添加”。 269 | 9. 按照提示设置您的搜索引擎。您可以选择搜索整个Web或特定网站。 270 | 10. 创建搜索引擎后,请单击“控制面板”,然后单击“基本知识”。复制“搜索引擎ID”,并将其设置为名为`CUSTOM_SEARCH_ENGINE_ID`的环境变量。请参见下面设置环境变量。 271 | 272 | _请记住,您每天免费的自定义搜索配额仅允许最多100次搜索。要增加此限制,您需要将计费帐户分配给项目,以获得高达10K次每日搜索的收益。_ 273 | 274 | ### 设置环境变量 275 | 276 | 对于Windows用户: 277 | 278 | ```bash 279 | setx GOOGLE_API_KEY "YOUR_GOOGLE_API_KEY" 280 | setx CUSTOM_SEARCH_ENGINE_ID "YOUR_CUSTOM_SEARCH_ENGINE_ID" 281 | ``` 282 | 283 | 对于macOS和Linux用户: 284 | 285 | ```bash 286 | export GOOGLE_API_KEY="YOUR_GOOGLE_API_KEY" 287 | export CUSTOM_SEARCH_ENGINE_ID="YOUR_CUSTOM_SEARCH_ENGINE_ID" 288 | ``` 289 | 290 | ## Redis 设置 291 | > _**注意**_ \ 292 | 此处不适用于公共访问,没有安全措施。因此,避免未设置密码或完全向互联网暴露Redis。 293 | 294 | 1. 安装docker桌面版 295 | ```bash 296 | docker run -d --name redis-stack-server -p 6379:6379 redis/redis-stack-server:latest 297 | ``` 298 | > 请参见 https://hub.docker.com/r/redis/redis-stack-server 以设置密码和其他配置。 299 | 300 | 2. 设置以下环境变量 301 | > 将尖括号(<>)中的**PASSWORD**替换为您的密码 302 | ```bash 303 | MEMORY_BACKEND=redis 304 | REDIS_HOST=localhost 305 | REDIS_PORT=6379 306 | REDIS_PASSWORD= 307 | ``` 308 | 您还可以选择设置 309 | 310 | ```bash 311 | WIPE_REDIS_ON_START=False 312 | ``` 313 | 314 | 以在Redis中保留存储的内存 315 | 316 | 您可以使用以下命令指定Redis的内存索引: 317 | 318 | ```bash 319 | MEMORY_INDEX= 320 | ``` 321 | 322 | ### 🌲 Pinecone API密钥设置 323 | 324 | Pinecone 可以存储大量基于向量的内存,从而使代理每次仅加载有关内存。 325 | 326 | 1. 转到 [pinecone](https://app.pinecone.io/),如果您还没有帐户,请创建一个。 327 | 2. 选择 `Starter` 计划以避免被收费。 328 | 3. 在左侧边栏的默认项目下找到您的API密钥和区域。 329 | 330 | ### Milvus 设置 331 | 332 | [Milvus](https://milvus.io/) 是一个开源的、高可扩展的向量数据库,用于存储大量基于向量的内存并提供快速相关搜索。 333 | 334 | - 设置 Milvus 数据库,保持 pymilvus 版本和 milvus 版本相同,以避免兼容性问题。 335 | - 使用开源软件安装 [Install Milvus](https://milvus.io/docs/install_standalone-operator.md) 336 | - 或使用 [Zilliz Cloud](https://zilliz.com/cloud) 进行安装 337 | - 在 `.env` 中设置 `MILVUS_ADDR` 为您的 milvus 地址 `host:ip`。 338 | - 在 `.env` 中将 `MEMORY_BACKEND` 设置为 `milvus`,以启用 milvus 作为后端。 339 | - 可选项 340 | - 在 `.env` 中设置 `MILVUS_COLLECTION`,以按需更改 milvus 集合名称,默认名称为 `autogpt`。 341 | 342 | ### 设置环境变量 343 | 344 | 在 `.env` 文件中设置: 345 | - `PINECONE_API_KEY` 346 | - `PINECONE_ENV`(例如:“us-east4-gcp”) 347 | - `MEMORY_BACKEND=pinecone` 348 | 349 | 或者,您可以从命令行设置它们(高级): 350 | 351 | 对于Windows用户: 352 | 353 | ```bash 354 | setx PINECONE_API_KEY "" 355 | setx PINECONE_ENV "" # 例如: "us-east4-gcp" 356 | setx MEMORY_BACKEND "pinecone" 357 | ``` 358 | 359 | 对于macOS和Linux用户: 360 | 361 | ```bash 362 | export PINECONE_API_KEY="" 363 | export PINECONE_ENV="" # 例如: "us-east4-gcp" 364 | export MEMORY_BACKEND="pinecone" 365 | ``` 366 | 367 | ## 设置缓存类型 368 | 369 | 默认情况下,Auto-GPT 将使用 LocalCache 而不是 redis 或 Pinecone。 370 | 371 | 要切换到其中任何一个,请将 `MEMORY_BACKEND` 环境变量更改为您想要的值: 372 | 373 | `local` (默认) 使用本地 JSON 缓存文件 374 | `pinecone` 使用您在 ENV 设置中配置的 Pinecone.io 帐户 375 | `redis` 将使用您配置的 redis 缓存 376 | 377 | ## 查看内存使用情况 378 | 379 | 1. 使用 `--debug` 标志查看内存使用情况 :) 380 | 381 | ## 🧠 内存预填充 382 | 383 | # python autogpt/data_ingestion.py -h 384 | 用法: data_ingestion.py [-h] (--file FILE | --dir DIR) [--init] [--overlap OVERLAP] [--max_length MAX_LENGTH] 385 | 386 | 将一个或多个文件的目录摄入到内存中。在运行此脚本之前,请确保设置了您的 .env。 387 | 388 | 选项: 389 | -h, --help 显示帮助信息并退出 390 | --file FILE 要摄取的文件。 391 | --dir DIR 包含要摄取的文件的目录。 392 | --init 初始化内存并擦除其内容(默认值:False) 393 | --overlap OVERLAP 摄取文件时块之间的重叠大小(默认值:200) 394 | --max_length MAX_LENGTH 摄取文件时每个块的最大长度(默认值:4000) 395 | 396 | 这个位于 autogpt/data_ingestion.py 的脚本允许您在运行 Auto-GPT 之前将文件摄入内存并进行预填充。 397 | 398 | 内存预填充是一种技术,它涉及将相关文档或数据摄入 AI 的内存中,以便它可以使用这些信息来生成更具见解和准确的响应。 399 | 400 | 为了预填充内存,将每个文档的内容分成指定最大长度、具有指定块之间重叠的块,然后将每个块添加到在 .env 文件中设置的内存后端中。当 AI 被提示回忆信息时,它可以访问那些预填充的记忆来生成更具见解和准确的响应。 401 | 402 | 当处理大量数据或需要 AI 快速访问特定信息时,这种技术尤其有用。 403 | 通过预填充内存,AI 可以更有效地检索和使用这些信息,节省时间、API 调用并提高其响应的准确性。 404 | 405 | 例如,在运行 Auto-GPT 之前,您可以下载 API 文档、GitHub 存储库等,并将其摄入内存。 406 | 407 | ⚠️ 如果您将 Redis 用作内存,请确保在您的 `.env` 文件中将 `WIPE_REDIS_ON_START` 设置为 `False` 来运行 Auto-GPT。 408 | 409 | ⚠️ 对于其他内存后端,我们当前强制清除内存,在启动 Auto-GPT 时也是如此。要摄取具有这些内存后端的数据,可以在 Auto-GPT 运行期间随时调用 `data_ingestion.py` 脚本。 410 | 411 | 内存将立即可供 AI 使用,即使在 Auto-GPT 运行时摄入。 412 | 413 | 在上面的示例中,脚本初始化了内存,将 `/seed_data` 目录中的所有文件与块之间的重叠设置为 200,并将每个块的最大长度设置为 4000 摄入了内存中。 414 | 请注意,您也可以使用 `--file` 参数将单个文件摄入内存中,而脚本仅会摄取 `/auto_gpt_workspace` 目录中的文件。 415 | 416 | 您可以调整 `max_length` 和重叠参数来微调 AI "recall" 该内存时向其呈现文档的方式: 417 | 418 | - 调整重叠值允许 AI 在回忆信息时访问更多的上下文信息,但将导致创建更多的块,从而增加内存后端使用和 OpenAI API 请求。 419 | - 减少 `max_length` 值会创建更多的块,这可以通过在上下文中允许更多的消息历史记录来节省提示符令牌,但也会增加块的数量。 420 | - 增加 `max_length` 值将为 AI 提供更多的上下文信息,减少创建块的数量并节省 OpenAI API 请求。但是,这可能使用更多的提示符令牌并减少 AI 可用的总上下文。 421 | 422 | ## 免责声明 423 | 本项目 Auto-GPT 是一个实验性应用程序,按“原样”提供,没有任何明示或暗示的保证。通过使用这个软件,您同意承担与其使用相关的所有风险,包括但不限于数据丢失、系统故障或其他可能发生的问题。 424 | 425 | 本项目的开发者和贡献者不承担任何因使用此软件而导致的损失、损害或其他后果的责任或义务。您对基于 Auto-GPT 提供的信息做出的决策和行动完全负责。 426 | 427 | 请注意,由于 GPT-4 语言模型的令牌使用,使用它可能会很昂贵。通过利用本项目,您承认自己有责任监测和管理自己的令牌使用量及所带来的费用。强烈建议定期检查您的 OpenAI API 使用情况,并设置必要的限制或警报以防止意外费用。 428 | 429 | 作为一项自主实验,Auto-GPT 可能会产生不符合现实业务实践或法律要求的内容或行动。您有责任确保基于该软件输出所做出的任何行动或决策符合适用法律、法规和道德标准。本项目的开发者和贡献者不对因使用此软件而引起的任何后果承担责任。 430 | 431 | 通过使用 Auto-GPT,您同意赔偿、保护并使开发者、贡献者和任何关联方免受因您使用本软件或违反这些条款而引发的任何和所有索赔、损害、损失、责任、费用和支出(包括合理的律师费用)的影响。 432 | 433 | ## 国内交流群 434 | 群主会不定期发布 各类亮眼项目体验版本 供大家体验,星球会不定期发布一些商业化的 AI 工具。欢迎各位读者老爷,漂亮姐姐给我的项目点赞! 435 | 436 | | 关注公众号进群 | 知识星球 | 437 | |:-------------------------------:|:-----------------------------------------------:| 438 | | | | 439 | 440 | 441 | ## 感谢 442 | 该项目大部分翻译自 [Auto-GPT](https://github.com/Torantulino/Auto-GPT#%EF%B8%8F-speech-mode) 443 | 444 |

💖 支持 Auto-GPT 的发展 💖

445 | 如果您可以支持一杯咖啡的费用,您就可以帮助支付开发Auto-GPT的API成本,并推动完全自主的人工智能的界限! 446 | 一整天的开发可能会花费多达20美元的API费用,对于一个免费项目来说,这是非常有限的。 447 | 非常感谢您的支持。 448 |

449 | 450 |

451 | 这个免费的开源项目的开发得益于所有贡献者赞助商。如果您想赞助这个项目,并希望在下面显示您的头像或公司标志,请点击这里。 452 |

Individual Sponsors

453 |

454 | robinicus  prompthero  crizzler  tob-le-rone  FSTatSBS  toverly1  ddtarazona  Nalhos  Kazamario  pingbotan  indoor47  AuroraHolding  kreativai  hunteraraujo  Explorergt92  judegomila   455 | thepok 456 |   SpacingLily  merwanehamadi  m  zkonduit  maxxflyer  tekelsey  digisomni  nocodeclarity  tjarmain 457 |

--------------------------------------------------------------------------------