"Trip" is a simple yet interesting project that uses Python, HTML, and OpenAI's GPT-3 model to create an interactive visual experience. It uses Flask, a lightweight web framework in Python, to serve a webpage that displays an HTML animation generated by the GPT-3 model.
The main script, main.py
, sends a request to OpenAI's GPT-3 model asking it to generate HTML and JavaScript code for an interactive animation. This generated code is then rendered on the webpage served by Flask. The project also has a feature where it can randomly decide to use an HTML file from the local system instead of generating it using the GPT-3 model.
The project currently contains two main files:
main.py
: This is the main script that runs the Flask server and handles the interactions with the GPT-3 model.index.html
: This is the basic HTML structure that is served by the Flask server. The generated HTML code from the GPT-3 model is inserted into this structure.
- Python (67.5%)
- HTML (32.5%)
To use this project, follow these steps:
-
Clone this repository to your local machine.
-
Install the required dependencies. The project uses Flask and OpenAI's python client library, so you can install them using pip:
pip install flask openai
-
Run the
main.py
script:python main.py
-
The Flask server will start running and you can access the webpage on
localhost:5000
.
Please note that you need to provide your OpenAI API key in the main.py
file to use the GPT-3 model.
Contributions are welcome! Please feel free to submit a pull request.
This project is open source, under the MIT license.