Giter Site home page Giter Site logo

Comments (7)

mrT23 avatar mrT23 commented on July 22, 2024

There is no such thing as "all suggestions"

  • Ask GPT-4 for 100 suggestions, you might get 100 suggestions. But most of them will probably be bad\repetative\simplistic. Without a cap, again you might get bad\repetative\simplistic suggestions

  • In addition, there is a limit on the number of output tokens, so even without a cap, you won't get "all suggestions".

  • Limiting the number of output suggestions is the right way to go, as we try to encourage the model to focus on the most important ones. We can still use a relatively high cap (~7-8). Reviewing each suggestion still takes time from a human.

I recommend reviewing the prompt. Try to remove lines 8 and 24, and you will see you still don't get "all suggestions", as there is no such thing.

from pr-agent.

esauser avatar esauser commented on July 22, 2024

How about all the most important ones? Setting an arbitrary limit doesn't make sense either. The two options seem to be ditch to ditch. How do we find the happy medium?

from pr-agent.

mrT23 avatar mrT23 commented on July 22, 2024

the prompt says " up to {{ num_code_suggestions }} ". It can provide less

More generally, It's always a challenge to prompt LLM, especially when the input is large and complicated like we have in PRs code. No prompt will give you 100% success, 100% of the time.

I recommend not relying on PR-Agent suggestions (or any other AI tool) to find every possible problem. The code suggestions are ... suggestions.
Use them as an extra reviewer to inspect and improve the code, but not as a replacement for baseline human inspection.

from pr-agent.

esauser avatar esauser commented on July 22, 2024

We are not relying on them for anything, we are using them as an extra tool. The point I'm trying to make is that for a very large PR it makes sense to get more suggestions, and for a very small PR it makes sense to get less suggestions. There ought to be a way to navigate this.

from pr-agent.

mrT23 avatar mrT23 commented on July 22, 2024

see #221 (comment), i am thinking about a tool to address this

from pr-agent.

zmeir avatar zmeir commented on July 22, 2024

I agree with @esauser, and also wanted to add that I tested num_code_suggestions configuration with large values (50) just to see what it does, and in moderate PRs (100-ish lines) it doesn't "explode" - it just gives me a few code suggestions, but it's usually capped at around 10 and doesn't actually reach 50 (as you would expect in a PR of that size). That is it say - it looks like the "up to" part of the prompt is really taken into account (at least in these cases).

from pr-agent.

mrT23 avatar mrT23 commented on July 22, 2024

@esauser
this tool ("/improve --extend"):
#229

Should address all the issues you raised.

It allows for:

  • no compression of diff files
  • generates code suggestions for each group of diff files, and aggregates these suggestions. (hence number of code suggestions will increase for larger PRs)
  • rank and sort suggestions based on their importance
  • clip the least important suggestions.

from pr-agent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.