[HN Gopher] Show HN: Pair: Open Tool for Coding with GPTs, Built...
       ___________________________________________________________________
        
       Show HN: Pair: Open Tool for Coding with GPTs, Built by Coding with
       GPTs
        
       Github Copilot is a great tool for leveraging GPTs while coding,
       but I find that it is too "open loop" for more complex tasks that
       require Q&A, feedback to guide it in a particular direction,
       iteration on code execution errors, etc. There is a large class of
       tasks that are better accomplished in an iterative, stateful chat-
       like interface.  I have been experimenting with a local command
       line chat interface to GPT-4 and my mind was blown once again a few
       days ago when I copied documentation for a pretty involved API into
       the model context and managed to chat-guide GPT-4 to implement the
       API in under 30 minutes, complete with a ridiculous amount of unit
       test coverage.  This involved a lot of manual copy and pasting back
       and forth and other friction points that could be removed by a
       streamlined REPL interface optimized for code interactions. It
       occurred to me that it would be fun to build such a tool, and as
       the ultimate act of dogfooding, try to build it with GPT!  So PAIR
       is the starting point here. You can see a recent commit message has
       a log of my interactions with the model that produced that commit.
       Next step is to add better mechanisms to manage the model input
       context (e.g. make it easy for the model to see the latest version
       of a source file when needed) followed by mechanisms for allowing
       the model to suggest changes via diffs that are quickly reviewed
       and accepted by the human in the loop before being applied to the
       file and tested.  I would love to hear from others who have
       experimented with GPT pair programming in a chat-style interface
       and any feedback you might have on your experience with it.
        
       Author : wskish
       Score  : 11 points
       Date   : 2023-03-21 16:55 UTC (6 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | amy-why wrote:
       | An immediate benefit is that you can leverage the power of GPT-4
       | now for coding!
        
       | [deleted]
        
       | mackatsol wrote:
       | Can you give us a walk through of a session?
       | 
       | While I think I understand what is going on, seeing it in action
       | will make more sense. Thanks!
        
         | wskish wrote:
         | See https://github.com/jiggy-ai/pair/blob/main/example.md for a
         | minimal example.
         | 
         | The bold parts are the user inputs.
         | 
         | First I give it a source file to put in the model context.
         | 
         | Then i give it an instruction, asking for a change to the
         | source file to how two messages are output.
         | 
         | The model outputs a diff, which is extracted and presented for
         | confirmation.
         | 
         | I accept the diff and the patch is applied to the source file.
        
           | amy-why wrote:
           | You can ask to summarize the code, suggest for improvements,
           | new features... and then you can just ask it to implement
           | them :).
        
       | [deleted]
        
       | amy-why wrote:
       | Add a command to pair using pair. I just chatted with pair to add
       | a /cd command. It starts with explaining the the code I was
       | loading (pair.py) which was helpful. It helped me to write the
       | code, can show the diff of changes.
       | 
       | I tested the code and find an issue, chatting with it and it
       | fixed it. I like the work flow of chatting, and asking questions
       | related to it while coding.
        
       ___________________________________________________________________
       (page generated 2023-03-21 23:02 UTC)