Skip to content

Repository files navigation

Learning GenAI 🚀

This repository contains a simple yet powerful Python application that leverages the Google Generative AI API to create an interactive chatbot. The chatbot is specifically designed to act as an expert in teaching science to kids, making complex scientific concepts accessible and engaging through conversation, analogies, humor, and real-world examples. It's a great starting point for anyone looking to build conversational AI agents with a specific persona and educational focus.

Table of Contents 📚

Features 🌟

  • Interactive Science Tutor Bot: Engages users in conversations about science, explaining concepts in an easy-to-understand manner suitable for children.
  • Personalized Learning Experience: Uses analogies, relatable examples, humor, and asks questions to tailor the educational experience.
  • Real-World Connections: Suggests ways scientific concepts relate to the real world, encouraging observation and experimentation.
  • Google Generative AI Integration: Utilizes the gemini-2.5-pro model for powerful natural language understanding and generation.
  • Configurable Generation Settings: Allows customization of AI response generation parameters like temperature, top-p, top-k, and max output tokens.
  • Safety Settings: Implements configurable safety settings to manage harmful content categories.
  • Environment Variable Support: Uses .env file for securely managing API keys.

Tech Stack 💻

  • Languages: Python 🐍
  • Frameworks/Libraries:
    • google-generativeai: For interacting with the Gemini API.
    • python-dotenv: For loading environment variables from a .env file.
  • AI Model: Gemini 2.5 Pro

Installation ⚙️

To set up and run this project locally, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/SG17THEProgrammer/GenAI.git
    cd GenAI
  2. Install Dependencies: The project relies on a few Python packages. It's recommended to use a virtual environment.

    python -m venv venv
    source venv/bin/activate   # On Windows use `venv\Scripts\activate`
    pip install google-generativeai python-dotenv
  3. Set Up API Key:

    • Create a .env file in the root directory of the project (GenAI/.env).
    • Add your Google Generative AI API key to this file in the following format:
      GEMINI_API_KEY='YOUR_API_KEY'
      
    • Obtain an API key from the Google AI Studio: https://makersuite.google.com/app/apikey

Usage 💡

This project provides a command-line interface (CLI) application that allows you to interact with the AI chatbot.

  1. Run the Application: Navigate to the genAICourseMicrosoft/Practice directory and run the app.py script.

    cd genAICourseMicrosoft/Practice
    python app.py
  2. Interact with the Bot: The application will start, and you'll see the initial greeting from the bot. You can then type your questions or prompts related to science.

    Bot: Hello, how can I help you?
    
    You (Enter `exit` to exit the bot else write your prompt): What is photosynthesis?
    

    The bot will respond with an explanation tailored for children.

  3. Exiting the Chat: Type exit and press Enter to end the conversation.

Real-World Use Case: This application serves as a fantastic educational tool for parents and educators looking to make learning science fun and accessible for children. It can be used for homework help, sparking curiosity about scientific topics, or simply engaging in interactive learning sessions.

How to Use 📖

To get started with the interactive science tutor:

  1. Ensure you have completed the Installation steps.
  2. Execute the app.py script from the genAICourseMicrosoft/Practice directory using python app.py.
  3. Engage in a conversation with the bot by typing your science-related queries. The bot is programmed to be a knowledgeable and engaging science educator for kids.
  4. For example, you can ask questions like:
    • "Why is the sky blue?"
    • "What happens when you mix baking soda and vinegar?"
    • "Tell me about dinosaurs."

The bot will provide age-appropriate explanations, use analogies, and encourage further exploration.

Project Structure 🌳

GenAI/
├── .env
├── Gen_AI_Global_Logic_Numpy.ipynb
├── Gen_AI_Global_Logic_NumpyL1_L3.ipynb
├── Global_Logic_L3_L5.ipynb
├── Pandas.ipynb
├── Practice.ipynb
├── ipl dataset.csv
├── matches.csv
└── genAICourseMicrosoft/
    ├── ChatApplication/lec7.txt
    ├── Creating_Adv_Prompts/lec5.txt
    ├── Explore_Compare_LLMS/lec2.txt
    ├── ImageApps/lec9.txt
    ├── Intro_To_GenAI/lec1.txt
    ├── Prompt_Engg_Fundamentals/lec4.txt
    ├── SearchApps/lec8.txt
    ├── Using_GENAI_Responsibly/lec3.txt
    └── Practice/
        └── app.py
  • genAICourseMicrosoft/Practice/app.py: The main Python script for the interactive chatbot.
  • .env: Stores sensitive API keys and environment configurations.
  • .ipynb files: Jupyter notebooks, likely containing course material or examples related to AI, Numpy, and Pandas.
  • .txt files: Text files within genAICourseMicrosoft subdirectories, probably containing lecture notes or learning materials for different AI topics.
  • .csv files: Dataset files (ipl dataset.csv, matches.csv) that might be used in conjunction with notebooks for data analysis examples.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages