SuperAPI AI Directory

AutoPR

AutoPR is an experimental automation tool based on GitHub that can autonomously generate pull requests based on issues. When a label containing AutoPR is added to an issue, the tool is triggered and attempts to automatically open a pull request in response to the requirements in the issue. It uses Guardrails to guide large language models in generating structured data that conforms to a JSON Schema, and re-requests when it does not conform. AutoPR is considered the first robot to autonomously generate pull requests, but according to the author, its success rate is about 20%, and there are several known limitations, such as possibly referencing incorrect code in other files, producing duplicate lines, calling non-existent functions, and only supporting the GitHub platform.

Open website

About this tool

AutoPR is a GitHub repository, with the name from irgolic/AutoPR. According to the repository description, AutoPR can autonomously write pull requests based on issues, and Guardrails was used in its construction.

Purpose

AutoPR aims to automate the process of responding to GitHub issues: when a user adds a label containing AutoPR to an issue, AutoPR is triggered and then opens a pull request. It attempts to let a robot complete the preliminary work from issue to code changes on behalf of developers. The repository description mentions that well-written issues usually lead to better results.

Main capabilities

According to the materials, AutoPR can:

  • Autonomously generate pull requests based on issues.
  • Open a pull request after being triggered.
  • Use Guardrails to prompt large language models to generate structured data (JSON Schema), and re-ask when it does not conform.

The repository also lists some examples generated by AutoPR, including: creating a dice-rolling bot, creating a "jargon generator", creating a user-friendly weather app, writing three programming interview challenges, and replacing GPT2FastTokenizer with tiktoken.

Usage

Trigger method: add a label containing AutoPR to an issue.

The tool exists as a GitHub Action, and the materials say it is "under development and is an alpha version". For more information, see USAGE.md and CONTRIBUTING.md in the repository.

Applicable scenarios

AutoPR is suitable for issue automation scenarios on GitHub, especially preliminary attempts to have a robot automatically generate pull requests based on issue content.

Limitations

The repository explicitly lists the following known issues:

  • It may incorrectly reference code in other files.
  • It may produce duplicate lines.
  • It may call non-existent functions.
  • It only applies to GitHub (see issue #46).

In addition, the author says it "only works about 20% of the time".

Background

The materials mention that AutoPR was created by the author during a weekend codingsprint in March 2023, when OpenAI had just launched the first "ChatGPT API". The author believes that AutoPR is the first robot to autonomously generate pull requests. The inspiration came from Guardrails, which uses JSON Schema to prompt large language models to generate structured data and re-asks when it does not conform, which happened before syntax-driven structured data generation appeared.