The README is entirely generated by GPT so some steps might be slighlty inaccurate. However, I used this instructions to fastly deploy the current version of the code with minimal changes.
This Flask application provides an API to interact with GitHub repositories. You can clone public repositories, fetch latest changes, get the diff of a specific commit, and retrieve the README file.
- Python 3.x
- Flask
- GitPython
-
Ensure Python 3.x is installed on your system.
-
Install the required Python packages:
pip install flask gitpython
-
Clone this repository to your local machine:
git clone <URL_OF_THIS_REPO>
-
Navigate to the cloned directory:
cd <CLONED_DIRECTORY>
-
Run the Flask application:
python app.py
The application will start on
http://127.0.0.1:5000/
.
Follow these steps to deploy your application on PythonAnywhere:
-
Sign up for an account on PythonAnywhere.
-
Once logged in, open the Bash console from the Dashboard.
-
Clone your repository:
git clone <URL_OF_YOUR_REPO>
-
Create a virtual environment:
mkvirtualenv --python=/usr/bin/python3.x myenv
Replace
3.x
with the specific Python 3 version you want to use. -
Activate the virtual environment:
workon myenv
-
Navigate to your project directory and install the dependencies:
pip install flask gitpython
-
Open the "Web" tab and set up a new web app. Choose "Manual configuration" and select the Python version you used earlier.
-
Edit the WSGI configuration file (found under the "Code" section of the "Web" tab) to point to your Flask application. Replace the existing Flask app configuration with:
import sys path = '/home/yourusername/path_to_your_app' if path not in sys.path: sys.path.append(path) from app import app as application # noqa
Replace
yourusername
with your PythonAnywhere username andpath_to_your_app
with the path to your Flask application. -
Reload your web app from the PythonAnywhere dashboard to apply the changes.
-
Your API should now be live at
http://yourusername.pythonanywhere.com
.
Remember to replace placeholder texts with your actual data.
-
Open your web browser and navigate to https://chat.openai.com/create to start creating your GPT instance.
-
Once you're on the page, begin by naming your GPT instance (example "GitHub Repo Analyst").
-
Provide a description for your GPT instance (example "I provide repo insights and README guidance.")
-
Set up the instructions for using your GPT instance as shown in
instructions.txt
: -
Provide conversation starters to guide users on how to interact with your GPT instance:
- How to clone a repo?
- Show last commit messages.
- Get the README version.
- Guide for GitHub API.
-
In the "Knowledge" section of the configuration, enable the option to "Upload files".
-
Enable the following capabilities:
- Web Browsing
- DALL-E Image Generation
- Code Interpreter
-
In the same "Actions" section, copy and paste the OpenAPI schema JSON directly. This JSON defines the available actions and endpoints that your GPT instance can interact with. Be sure to format the JSON correctly and include all necessary details for the endpoints as defined in your Flask application.
After completing these steps, your GPT instance should be configured with the "GitHub Repo Analyst" tool, ready to provide insights and guidance on GitHub repositories as per the OpenAPI schema provided.
Alternatively you can use GPT Builder
to generate the above instructions.