manish-jsx / py-openai

Home Page:https://manishjsx.pythonanywhere.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GPT-3 Story Generator with Flask

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.

Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/manish-jsx/py-openai.git
  2. Navigate to the project directory:

    cd py-openai
  3. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: .\venv\Scripts\activate
  4. Install dependencies:

    pip install -r requirements.txt
  5. 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.

Usage

  1. Run the Flask application:

    python app.py
  2. Open your web browser and visit http://127.0.0.1:5000/.

  3. Enter a story prompt and click "Generate Story" to see the GPT-3-generated story.

Screenshots

Screenshot 1 Description of Screenshot 1

Screenshot 2 Description of Screenshot 2

Screenshot 3 Description of Screenshot 3

Screenshot 4 Description of Screenshot 4

Screenshot 5 Description of Screenshot 5

About

https://manishjsx.pythonanywhere.com/


Languages

Language:Python 64.5%Language:HTML 35.5%