diff --git a/docs/README-USECASES.md b/docs/README-USECASES.md index ff848ae0..a7420a57 100644 --- a/docs/README-USECASES.md +++ b/docs/README-USECASES.md @@ -79,9 +79,12 @@ Here is a GPTScript that summarizes the the code stored under the current direct ## Vision, Image, and Audio ### Vision + Here is an example of a web app that leverages GPTScript to recognize ingredients in a photo and suggest a recipe based on them: [recipe-generator](../examples/recipegenerator). -[More details to come] +### Image Generation + +Here is a GPTScript that takes a story prompt and generates an illustrated children's book: [story-book.gpt](../examples/story-book) ## Memory Management diff --git a/examples/story-book/README.md b/examples/story-book/README.md new file mode 100644 index 00000000..a30f4e68 --- /dev/null +++ b/examples/story-book/README.md @@ -0,0 +1,34 @@ +# Story Book + +Story Book is a GPTScript that can generate a story based on a prompt and the number of pages you want the story to be in. It is generated in HTML format and can then be viewed +by `index.html` which has some JS/CSS to make the story styling consistent and readable. + +## Usage Instructions + +1. **Install and bootstrap the `image-generation` tool.** + + This tool uses the `image-generation` tool, which is in a separate repository. To install and bootstrap the `image-generation` tool, starting at the root of `gptscript` run the following commands: + + > Note: We'll soon have package management that handles tools installation for you, but until then, you have to manually clone and boostrap tools. + + ```shell + cd .. # This assumes you're starting at the root of the gptscript project. We want image-generation to be a sibling of gptscript. + git clone https://github.com/gptscript-ai/image-generation + cd image-generation + make bootstrap + source .venv/bin/activate + cd - # returns you back to your original directory + ``` + +2. **Run the `story-book.gpt` script.** + + In the same terminal session where the virtual environment (venv) is now activated, navigate to the `story-book` example directory and run the `story-book.gpt` script: + + ```shell + cd examples/story-book + gptscript story-book.gpt --prompt "Goldilocks" --pages 3 + ``` + +3. **View the story.** + + Open `index.html` in your browser to view the generated story. diff --git a/examples/story-book/index.html b/examples/story-book/index.html new file mode 100644 index 00000000..e8bf7ebd --- /dev/null +++ b/examples/story-book/index.html @@ -0,0 +1,147 @@ + + +
+