Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Idea: Implement ChatGPT's feedback as a commit or suggested change #27

Open
ademidun opened this issue Dec 12, 2022 · 1 comment
Open

Comments

@ademidun
Copy link
Contributor

ademidun commented Dec 12, 2022

This is a really cool idea Levi! @kxxt. I've been really impressed by the ingenuity of all the awesome ways people are implementing ChatGPT.

One thing I thought while reading this project. Instead of just asking it to tell you what you did wrong, why stop there? We can also ask it to rewrite the code without the mistake and commit those changes to the PR.

For example, in #12, ChatGPT points out the errors made in this comment. You can also go a step further and ask it to rewrite that file with those errors fixed.

"if there are any errors in this file, rewrite this file without errors"

Then extract the code snippet and commit it.

There's some resources that show how to push commits in a Github Action

If people don't want to give the bot full commit access, they can start by just allowing it to suggest changes. A tool like action-suggester could be used.

Imagine a workflow where:

  1. Human writes some code
  2. Chat GPT summarizes changes and gives feedback
  3. ChatGPT adds recommendations as a suggested change or commits changes directly to branch/PR.
@kxxt
Copy link
Owner

kxxt commented Dec 12, 2022

Hi @ademidun. It's a great idea but I simply didn't get it working. There are some early attempts like #7, in which ChatGPT shows its strength on spotting bugs, but it doesn't know how to properly write a patch.

Of course, we can let ChatGPT rewrite the entire file for us. But that requires us sending the entire file over the API, which means when your source code is too long, you will hit 403 errors. However, this repo is just a PoC, I would love to see if anyone could improve the prompts to make ChatGPT generate correct patches or let it rewrite the entire file.

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

No branches or pull requests

2 participants