GPT-Engineer

指定您希望它构建什么,人工智能会询问您的要求,然后建造它。「Specify what you want it to build, the AI asks for clarification, and then builds it.」

Github stars Tracking Chart

GPT-Engineer

GPT-engineer 可让您:

  • 用自然语言指定软件
  • 坐等人工智能编写和执行代码
  • 要求人工智能实施改进

入门

安装 gpt-engineer

稳定版

  • python -m pip install gpt-engineer

用于开发:

  • git clone https://github.com/gpt-engineer-org/gpt-engineer.git
  • cd gpt-engineer
  • poetry install
  • poetry shell to activate the virtual environment

We actively support Python 3.10 - 3.11. The last version to support python 3.8 - 3.9 was 0.2.6.

我们积极支持 Python 3.10 - 3.11。上一个支持 Python 3.8 - 3.9 的版本是 0.2.6

设置 API 密钥

选择其中一项:

  • 导出环境变量(可将其添加到 .bashrc,这样就不必在每次启动终端时都进行导出了)
    • export OPENAI_API_KEY=[your api key]
  • .env 文件:
    • 创建名为 .env 的 .env.template 副本
    • 在 .env 中添加 OPENAI_API_KEY
  • 定制模型:
    • 参见文档,支持本地模型、azure 等。

有关 Windows 的使用方法,请查看 Windows README

其他运行方式

  • 使用 Docker (说明)
  • 在浏览器中完成所有操作: Open in GitHub Codespaces

创建新代码(默认用法)

  • 在计算机的任意位置为项目创建一个空文件夹
  • 在新文件夹中创建一个名为 prompt(无扩展名)的文件,并在其中填写说明
  • 使用文件夹的相对路径运行 gpte <project_dir>
    • 例如:在 gpt-engineer 目录根目录下创建 gpte projects/my-new-project 项目,在 projects/ 目录下创建新文件夹。

改进现有代码

  • 在计算机上的任意位置找到包含要改进的代码的文件夹
  • 在新文件夹中创建一个名为 prompt(无扩展名)的文件,并在其中填写如何改进代码的说明
  • 使用文件夹的相对路径运行 gpte <project_dir> -i
    • 例如:在 gpt-engineer 目录根目录下的 gpte projects/my-old-project 中,将你的文件夹放在 projects/ 中。

运行 gpt-engineer 即表示您同意我们的条款

注意

  • 要运行该工具,建议使用新命令 gpte,以获得更好的用户体验。不过,也支持早期的默认命令 gpt-engineer 和 ge。

与 gptengineer.app 的关系

gptengineer.app 是一个自动生成 web-apps 应用程序的商业项目。它脱胎于 gpt-engineer,致力于回馈开源社区。gptengineer.app 的部分收入将用于资助全职人员和基础设施,以维护代码生成的开源工具。

特性

您可以通过编辑 preprompts 文件夹中的文件来指定人工智能代理的 "identity(身份)"。

编辑前置提示,并改进项目提示的书写方式,是让代理商在项目间记住东西的方法。

你还可以使用 cli 参数 --use-custom-preprompts 将所有预置文件自动复制到项目文件夹中。这样,你就可以为所有项目定制预置文件,而无需编辑主文件。

您也可以使用 WizardCoder 等开源模型运行。有关示例说明,请参阅文档

使命

gpt-engineer 社区的使命是维护编码代理构建者可以使用的工具,并促进开源社区的合作。

如果您有兴趣为此做出贡献,我们非常欢迎您的加入。

如果您想了解我们更广阔的目标,请查看路线图,并加入 discord,就如何为路线图献计献策

gpt-engineer 由长期贡献者组成的董事会管理。如果您经常做出贡献,并有意塑造 gpt-engineer 的未来,您将被考虑进入董事会。

示例

(恕删略。请参见源README文件。)

Main metrics

Overview
Name With OwnerAntonOsika/gpt-engineer
Primary LanguagePython
Program language (Language Count: 5)
Platform
License:MIT License
所有者活动
Created At2023-04-29 12:52:15
Pushed At2024-11-17 22:47:32
Last Commit At
Release Count21
Last Release Namev0.3.1 (Posted on )
First Release Namev0.0.2 (Posted on )
用户参与
Stargazers Count54k
Watchers Count529
Fork Count7.1k
Commits Count1.6k
Has Issues Enabled
Issues Count492
Issue Open Count23
Pull Requests Count351
Pull Requests Open Count14
Pull Requests Close Count249
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

GPT-Engineer

Discord Follow
GitHub Repo stars
Twitter Follow

GPT-engineer lets you:

  • Specify a software in natural language
  • Sit back and watch as an AI writes and executes the code
  • Ask the AI to implement improvements

Getting Started

Install gpt-engineer

For stable release:

  • python -m pip install gpt-engineer

For development:

  • git clone https://github.com/gpt-engineer-org/gpt-engineer.git
  • cd gpt-engineer
  • poetry install
  • poetry shell to activate the virtual environment

We actively support Python 3.10 - 3.11. The last version to support python 3.8 - 3.9 was 0.2.6.

Setup API Key

Choose one of:

  • Export env variable (you can add this to .bashrc so that you don't have to do it each time you start the terminal)
    • export OPENAI_API_KEY=[your api key]
  • .env file:
    • Create a copy of .env.template named .env
    • Add your OPENAI_API_KEY in .env
  • Custom model:
    • See docs, supports local model, azure, etc.

Check the Windows README for windows usage.

Other ways to run:

Creating new code (default usage)

  • Create an empty folder for your project anywhere on your computer
  • Create a file called prompt (no extension) inside your new folder and fill it with instructions
  • Run gpte <project_dir> with a relative path to your folder
    • For example: gpte projects/my-new-project from the gpt-engineer directory root with your new folder in projects/

Improving Existing Code

  • Locate a folder with code which you want to improve anywhere on your computer
  • Create a file called prompt (no extension) inside your new folder and fill it with instructions for how you want to improve the code
  • Run gpte <project_dir> -i with a relative path to your folder
    • For example: gpte projects/my-old-project from the gpt-engineer directory root with your folder in projects/

By running gpt-engineer you agree to our terms.

Note

  • To run this tool, the new command gpte is recommended for better user experience. However, the earlier default commands gpt-engineer and ge are also supported.

Relation to gptengineer.app

gptengineer.app is a commercial project for automatic generation of web-apps. It emerged from gpt-engineer and is committed to giving back to the open source community. A portion of gptengineer.app’s revenue will fund a full-time role and infrastructure for maintaining open-source tools for code generation.

Features

You can specify the "identity" of the AI agent by editing the files in the preprompts folder.

Editing the preprompts, and evolving how you write the project prompt, is how you make the agent remember things between projects.

You can also automatically copy all preprompts files into your project folder using the cli parameter --use-custom-preprompts. This way you can have custom preprompts for all of your projects without the need to edit the main files.

You can also run with open source models, like WizardCoder. See the documentation for example instructions.

Mission

The gpt-engineer community mission is to maintain tools that coding agent builders can use and facilitate collaboration in the open source community.

If you are interested in contributing to this, we are interested in having you.

If you want to see our broader ambitions, check out the roadmap, and join
discord
to get input on how you can contribute to it.

gpt-engineer is governed by a board of long term contributors. If you contribute routinely and have an interest in shaping the future of gpt-engineer, you will be considered for the board.

Example

https://github.com/gpt-engineer-org/gpt-engineer/assets/4467025/40d0a9a8-82d0-4432-9376-136df0d57c99