Code Monkey home page Code Monkey logo

codewithgpt's Introduction

Code with GPT

Chat interface that allows you to send files from your code repository to OpenAI when asking questions.

screenshot

Getting Started

  1. Install the requirements
pip install -r requirements.txt
  1. Create a .env file in the root directory of your project with the following content:
OPENAI_API_KEY=your_openai_api_key_here
  1. The application supports a .gptignore file that helps in excluding files or directories from being processed by the GPT model. This is similar in concept to .gitignore. Review the .gptignore file to make sure it's excluding files you don't want to be shown on the file viewer.

  2. Start the Flask application

python application.py

How The App Works

  1. Initialization: Upon launching, the app loads the environment variables, initializes the OpenAI SDK with your API key, and starts the Flask server.
  2. Index Page: The main page (/) lists the available GPT models fetched from OpenAI, and allows the user to select a model to work with. The model selection is stored in a user session.
  3. File Viewer: The folder in which to search for files is configurable and defaults to the current working directory. Users can view the files in the specified directory and select specific files to include in their prompt to the GPT model. The .gptignore file in the directory helps filter out unwanted files or directories.
  4. Chat Interface: Users can type in prompts or questions, which, along with the selected files' contents, are sent to the GPT model. The response from the model is then displayed on the web page.

Contributing

Contributions are welcome! Here are a few things that need attention:

  • Tests: Adding unit and integration tests
  • Request Customization: Add more customization options for the requests sent to OpenAI, such as choosing request parameters.
  • Response Formatting: Make the API response more user-friendly. Code formatting is not happening in the response window.

To contribute, please fork the repository, make your changes, and submit a pull request with a clear description of what you've done.

codewithgpt's People

Contributors

ekerstein avatar

Stargazers

 avatar Deepanshu Anand avatar Noah Zoarski avatar

Watchers

 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.