The Personal Fun Facts Generator App is a fun, interactive web application that generates random "fun facts" about the user. Built using HTML, CSS, and JavaScript, this app allows users to apply the concepts of prompt engineering, context setting, and handling AI limitations (hallucinations) learned in GenAI 101.
This app was designed as a capstone project for the GenAI 101 workshop, allowing participants to:
- Understand prompt engineering and context setting.
- Recognize and address potential hallucinations in AI-generated content.
- Practice creating and customizing a simple, shareable web application using Pieces Copilot and basic web technologies.
- Random Fun Fact Generation: Displays a random, user-defined fun fact each time you click the button.
- Customizable Facts: Users can personalize the app by adding their own unique facts.
- Easy Hosting on GitHub Pages: With no additional setup, users can deploy their app online to share with others.
You can view a sample app hosted on GitHub Pages here: https://ialimustufa.github.io/genai101-project/
This project is designed to be completed in 15 minutes. Each step incorporates key concepts from GenAI 101.
- Objective: Create a fun, shareable app with "fun facts" about yourself, generated and customized using Pieces Copilot.
- GenAI Concept: Setting a clear project goal and prompt focus.
- Open Pieces Copilot and input a prompt like, “Generate a fun fact about someone who loves hiking and has traveled to five national parks.”
- Experiment with variations, adjusting the prompt to include specific details (e.g., hobbies, skills) and see how different prompt styles affect the generated text.
- GenAI Concept: Practice prompt engineering and adjusting context to create accurate outputs.
- Review the Generated Output: Check for any unrealistic or fabricated details in the fun facts.
- Refine the Prompt: Modify the prompt in Pieces Copilot if you notice hallucinations, ensuring the facts are realistic and accurate.
- GenAI Concept: Learn to identify hallucinations and handle inaccuracies in AI-generated content.
- Use Pieces Copilot to generate code snippets for HTML, CSS, and JavaScript to create a simple single-page app.
- index.html: Provides the basic HTML structure.
- style.css: Adds styling for a personalized look and feel.
- script.js: Contains JavaScript to handle random fact generation and user interactions.
- Customize the fun facts by modifying the facts array in
script.js
.
Example:
const facts = [
"I love hiking and have traveled to five national parks.",
"I am an avid reader and read around 20 books per year.",
"I once baked a 3-tiered cake for a family gathering!",
"I speak three languages fluently.",
"I’m learning to play the guitar in my free time."
];
- GenAI Concept: Document prompt adjustments and observe how context changes impact code accuracy.
-
Go to your GitHub repository and navigate to Settings > Pages.
-
Under Source, select the main branch and set the folder to
/root
. -
Click Save. Your app will be live at a link like
https://yourusername.github.io/genai101/
. -
Share the link to let others explore and enjoy your fun facts generator app.
- GenAI Concept: Share a practical AI-powered creation, reinforcing the importance of presentation and sharing.
- Open the app in a browser using your GitHub Pages link.
- Click the Generate Another Fun Fact button.
- A new fun fact will appear each time you click the button.
- Share the link with friends or on social media to let others enjoy your personalized fun facts!
- Fun facts not displaying?
- Check that
script.js
is correctly linked inindex.html
. - Ensure each fun fact in the facts array is enclosed in quotes and separated by commas.
- Check that
- Site not loading on GitHub Pages?
- Confirm you’ve set the source to the main branch in GitHub Pages settings.
- Make sure your GitHub Pages URL is correctly formatted as
https://yourusername.github.io/genai101/
.
This project is open-source and available under the MIT License. Feel free to use, modify, and distribute it as you like.