RepoAI21 LabsAI21 Labspublished Jan 12, 2023seen 5d

AI21Labs/Rick-and-Morty-episode-generator

JavaScript

Open original ↗

Captured source

source ↗

AI21Labs/Rick-and-Morty-episode-generator

Description: An interactive one-pager browser game, primarily built with React.js. It makes use of the state-of-the-art Jurassic-2 language models to generate made-up episodes of the popular animated science fiction TV show Rick and Morty.

Language: JavaScript

License: MIT

Stars: 16

Forks: 0

Open issues: 0

Created: 2023-01-12T10:32:39Z

Pushed: 2023-09-13T07:42:41Z

Default branch: main

Fork: no

Archived: yes

README:

Rick and Morty Episode Generator

An interactive one-pager browser game, primarily built with React.js. It makes use of the state-of-the-art Jurassic-2 language models to generate made-up episodes of the popular animated science fiction TV show Rick and Morty.

Getting Started

1. Clone the repository

git clone https://github.com/AI21Labs/Rick-and-Morty-Episode-Generator.git

2. Navigate to cloned folder

cd Rick-and-Morty-Episode-Generator

3. Install dependencies

npm install

4. Start the game in your local environment

npm start

5. Open http://localhost:3000 to view it in the browser.

Play

1. Get your API key from your account page, and paste it in [apiKey.consts.js](src/api/constants/apiKey.consts.js) file. Now you are all set and ready to play!

2. Press the "Generate Title" button, which will invoke the generateTitle() function. This function sends an API request to the /complete endpoint of the Jurassic-2 Mid model. The main request includes a "few shot" prompt parameter with a value that prompts the model to generate a new made-up Rick and Morty episode title. Other parameters worth noticing are maxTokens, temperature, and stopSequences.

3. Once the model returns a response, it is rendered in the text field next to the "Generate Title" button.

4. The second button, "Generate Plot", becomes clickable, and when clicked, invokes the generatePlot() function. The function takes the generated title and uses it in its prompt value in another API request to Jurassic-2 Mid. This time, the model returns a longer response with a made-up plot for the made-up title.

5. The last button, "Generate End Scene", uses the same functionality as the "Generate Plot" button to create a post-credits scene.

Contribute

This is an open source project. Your contributions are welcome!

Made with ❤️ by the AI21 Labs team