Code Monkey home page Code Monkey logo

radventure's Introduction

Radventure - Children's Book Builder

Radventure is a Python script that uses OpenAI's GPT-3.5-turbo to generate a unique story based on user input. The script takes user input for genre, target audience, theme, setting, content hint, and a twist option. It generates a story outline, writes a draft, refines the draft, and creates a finished PDF copy with a generated photo, title, and story text.

Features

Customizable input for genre, target audience, theme, setting, additional details and an optional twist. Enhanced prompts and outlines using GPT-3.5-turbo. Automated drafting, editing, and continuity checks. Automated cover photo generation. Export your final story as a pdf file with an appropriate cover photo for the story.

Dependencies

Python 3 OpenAI Python package Requests Pillow ReportLab Backoff Transformers

Usage

Install the required Python packages:

pip install openai backoff requests pillow reportlab transformers

Clone the repository or copy the BookBuilderHelpers.py and BookBuilderTest.py to your local machine.

Set up your OpenAI API key in a config.ini file (refer to the instructions below).

Run the main script in your terminal:

python BookBuilderTest.py

Follow the prompts to input your story's genre, target audience, theme, setting, additional details and if you'd like a twist.

The script will create an enhanced prompt, outline, draft, edit, refine and create a photo for the story. Your final story will be saved as a .pdf file in the same directory.

4/4/2023 - You can now use the BookBuilderGUI.py file to run a simple tkinter-based GUI for Radventure

API Key Setup

To use Radventure, you need to set up your OpenAI API key. Create a config.ini file in the same directory as your main script and BookBuilderHelpers.py with the following content:

[OpenAI] api_key = your_openai_api_key_here

Notes

Occasionally, the story produced will have some continuity issues (referring to characters that were never mentioned before, changing random details and characteristics partway through, etc). Updates to prompt engineering in the script will continue to make this less likely, and access to gpt-4 will likely enhance the entire finished product.

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.