This is a simple web application built with Flask that uses the OpenAI GPT-3 API to generate short stories based on user-provided prompts.
- Python 3.x
- OpenAI GPT-3 API Key
-
Clone the repository:
git clone https://github.com/manish-jsx/py-openai.git
-
Navigate to the project directory:
cd py-openai
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: .\venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.env
file in the project root and add your GPT-3 API key:OPENAI_API_KEY=your_actual_api_key
Replace
your_actual_api_key
with your real OpenAI GPT-3 API key.
-
Run the Flask application:
python app.py
-
Open your web browser and visit http://127.0.0.1:5000/.
-
Enter a story prompt and click "Generate Story" to see the GPT-3-generated story.