Weekend Project 02 - Encode Club AI BootCamp 24Q2 Repository
This project is part of the Encode Club AI BootCamp and involves creating a new application from scratch using Next.js, focusing on generating jokes using AI. The application will allow users to customize various joke parameters and generate jokes based on their preferences. Additionally, the AI will evaluate the generated jokes for humor, appropriateness, and potential offensiveness. The project leverages the Text Generation WebUI to serve text generation tasks.
- Joke Generation: Generate jokes using AI with customizable parameters.
- Customizable Parameters:
- Topic (e.g., work, people, animals, food, television)
- Tone (e.g., witty, sarcastic, silly, dark, goofy)
- Type of joke (e.g., pun, knock-knock, story)
- Temperature (randomness/fun level)
- Joke Evaluation: AI evaluates jokes for humor, appropriateness, and offensiveness.
- Integration with Text Generation WebUI: Serve text generation tasks using the WebUI.
Before you begin, ensure you have the following installed:
- Node.js (v14 or higher)
- npm
- Git
- https://github.com/oobabooga/text-generation-webui
- a model that works for your hardware.
-
Clone the Repository
git clone https://github.com/90barricade93/ai-joke-generator cd ai-joke-generator
-
Install Dependencies
Using npm:
npm install ai openai
-
Set Up Environment Variables
Create a
.env.local
file in the root directory and add a placeholder for your OpenAI API environment variables to prevent⨯ Error: The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'My API Key' }).
OPENAI_API_KEY="placeholder"
-
Run the Development Server
Using npm:
npm run dev
-
Run the Text Generation WebUI
Follow the instructions in the Text Generation WebUI documentation to set up and run the WebUI on your local environment.
cd /path/to/text-generation-webui ./start_linux.sh -api
This project demonstrates the integration of Next.js with AI capabilities, providing users with a fun and interactive way to generate jokes. By customizing parameters and evaluating the generated content, users can explore the capabilities of AI in creative content generation. The Text Generation WebUI serves as a powerful backend for handling text generation tasks, showcasing the potential of local AI model deployment.
Feel free to contribute, suggest improvements, or ask questions. Happy coding!
We would like to thank the Encode Club AI BootCamp for this opportunity and @mpagani for his guidance.