Code Monkey home page Code Monkey logo

Comments (6)

anthrax3 avatar anthrax3 commented on May 31, 2024 2

smaller diff text:

const diffCached = ['diff', '--cached','--ignore-all-space','--diff-algorithm=minimal'];

from aicommits.

privatenumber avatar privatenumber commented on May 31, 2024 1

I thought about this, but some commits are just white-space changes (e.g. stylistic/linting).

If the diff doesn't show, GPT wouldn't be able to produce an accurate description of the change.

from aicommits.

salomartin avatar salomartin commented on May 31, 2024 1

Or actually even better, now that the new chat API is available and they take turns, the entire diff could be consumed file by file actually if detect it's bigger than some threshold and have a turn by turn chat, managing then to generate a comment about each and then asking to summarise each comment in the end. This would allow to work with quite large diffs as well.

https://github.com/openai/openai-python/blob/main/chatml.md
https://platform.openai.com/docs/guides/chat/chat-vs-completions

from aicommits.

privatenumber avatar privatenumber commented on May 31, 2024

I wonder if we can be smart about this and detect how much of the diff is white-space changes.

If the diff is mainly white-space change, we can pass in the diff with white-space.

If not (or if the diff is close to the OpenAI size limit), we can pass in the white-space ignored diff.

from aicommits.

salomartin avatar salomartin commented on May 31, 2024

It could be a conf option, but for many cases detecting these changes are important, particularly for languages where indentation matters and as above - ie formatting & linting changes. How about just counting the tokens with tokeniser and set it to the models max number instead of line count? and allow people to set a limit themselves.

from aicommits.

privatenumber avatar privatenumber commented on May 31, 2024

I don't think we can ignore white space for the reason provided above, and we've added --diff-algorithm=minimal so I think this is closable.

@salomartin
That idea sounds interesting but I worry that it may (unexpectedly) incur large expenses for generating a commit.

from aicommits.

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.