Code Monkey home page Code Monkey logo

pair's Introduction

PAIR (Pair AI REPL)

PAIR is an AI-powered coding assistance REPL that pairs GPT-4 with you the developer to augment the best of both human and AI intelligence. It provides an interactive environment where users can input existing code, ask questions about the code or other open source projects or dependencies, receive helpful answers from the GPT-based programming assistant, add new code or refactor existing code, etc.

The REPL supports special commands for loading files and changing directories, and it can propose code changes as context diffs that can be processed automatically. Users have the option to accept or reject the proposed changes, making PAIR a flexible and powerful tool for developers.

Example

Currently we are using GPT-4 to help build PAIR, and are very open to other collaborators who are similarly inclined to eat their own dogfood.

Installation

To install Pair AI, run the following command:

pip install pair_ai

Usage

After installing the package, you can use the pair command in your terminal or command prompt to start the REPL:

pair

In the REPL, enter your questions or guidance or /file to input local files into the context.

When PAIR detects a diff in the model output, it extracts the diff and presents it to the user. If the user accepts the diff then the diff is applied to the referenced source file using patch. There are probably a lot of corner cases here so I expect this functionality to be fragile.

See example.md for a typical edit interaction.

Commands

  • help - Display this help message
  • /file <path>: Load a file's content into the model context by providing its path.
  • /cd <path>: Change the current working directory to the specified path.
  • /url <url>: Load the content of a URL into the context.
  • /status: - Show the status of the OPENAI_API_KEY and the model being used.

To use the special commands, simply type the command followed by the appropriate path or command in the REPL.

Example:

/file /path/to/your/file.py
/cd /path/to/your/directory

Dependencies

The following environment variables are used to inject credentials and other required configuration for the major dependencies:

OpenAI

  • OPENAI_API_KEY # your OpenAI API key
  • PAIR_MODEL # one of "gpt-3.5-turbo" or "gpt-4", default to gpt-4

Community Discussions

pair's People

Contributors

amy-why avatar wskish avatar

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.