Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AI-generated pull request feature #217

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

aarohmankad
Copy link

@aarohmankad aarohmankad commented May 20, 2023

Add AI-generated pull request feature

This pull request adds a new command called aipr to generate a Github pull request with AI-generated content. The command uses OpenAI's GPT-3 to generate a descriptive Github Pull Request written in present tense for the given code diff.

Changes Made

  • Added aipr command in the CLI.
  • Created aipr.ts file under the commands directory to support the aipr command.
  • Modified git.ts file to get the diff for aipr command.
  • Modified openai.ts file to generate pull request with AI-generated content.
  • Added prompt.ts file to generate prompt messages for aipr command.

How to use

The aipr command can be used to generate a Github pull request with AI-generated content. It supports the following flags:

  • --generate or -g : Number of
aicommits_pr.mp4

@aarohmankad aarohmankad changed the title "## Add AI-generated pull request feature" Add AI-generated pull request feature May 20, 2023
@aarohmankad
Copy link
Author

Hey @Nutlope! I wanted to add a command, pr, that would allow us to create automated PR copy as well! I think there are some still outstanding issues on this with:

  • proper markdown formatting passed to the gh command
  • using the minimal diff algorithm so we don't run into token limits for the description itself.

Copy link

@mohsinsr mohsinsr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!!

@davidawad
Copy link

this looks like a really interesting idea, thanks for sharing

@aarohmankad
Copy link
Author

@mohsinsr it's been a while since I looked at this, but would you be able to merge? I don't have permissions on this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants