Spaces:
Sleeping
Sleeping
Enhance AI Concept Explainer with version 2.0.0: Introduced new features including real-time reading time estimates, a character counter, and a copy-to-clipboard function. Improved UI with a modern gradient header and responsive design. Added structured logging and comprehensive error handling for better user experience.
7997e54
metadata
title: AI Concept Explainer
emoji: ๐ง
colorFrom: indigo
colorTo: gray
sdk: docker
pinned: false
license: mit
short_description: AI-powered concept explainer with adaptive complexity
๐ง AI Concept Explainer v2.0
A clean, Gradio app that explains any concept at different complexity levels using OpenAI's GPT-4.1-mini. Get personalized explanations tailored to your understanding level and preferred language, with a modern interface optimized for ease of use.
โจ Features
๐ Core Functionality
- 5 Complexity Levels: From "like I'm 5" to expert-level explanations
- 6 Languages: English, Russian, German, Spanish, French, Italian
- Real-time Streaming: Watch explanations generate live with streaming responses
- Quick Examples: 3 pre-selected questions to get started instantly
๐จ Professional UI/UX
- Compact Design: Clean layout that fits on one screen without scrolling
- Modern Gradient Header: Beautiful purple gradient with professional styling
- Dark/Light Mode: Automatic theme detection with smooth transitions
- Responsive Layout: Optimized for desktop, tablet, and mobile (900px max-width)
- Smooth Animations: Entrance animations and hover effects throughout
๐ Productivity Features
- ๐ Copy to Clipboard: One-click copy of any explanation
- ๐ Reading Time: Real-time reading time estimates as text streams
- โจ๏ธ Keyboard Shortcuts: Ctrl/Cmd+Enter to submit, Escape to clear
- ๐ Character Counter: Color-coded visual feedback (green/orange/red, 0/500 chars)
- ๐๐ Feedback: Simple helpful/not helpful reactions for continuous improvement
- ๐ Clear Button: Quick reset to start fresh
๐ก๏ธ Code Quality & Reliability
- Type Hints: Full type annotations throughout the codebase
- Professional Logging: Structured logging system (not print statements)
- Error Handling: User-friendly error messages with collapsible technical details
- Input Validation: Character limits, language verification, and edge case handling
- Clean Architecture: Well-organized code with clear sections and documentation
๐ Setup
Hugging Face Spaces
- Fork or import this repository to your Hugging Face Space
- Go to Settings โ Repository secrets
- Add secret:
OPENAI_API_KEYwith your OpenAI API key - The app will automatically deploy!
Local Development
# Clone and navigate to the project
cd Explainer_docker
# Create virtual environment (Python 3.11+)
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Set your API key
echo "OPENAI_API_KEY=your_api_key_here" > .env
# Run the app
python app.py
Visit http://127.0.0.1:7860 in your browser.
To stop: Press Ctrl+C in the terminal, then deactivate the virtual environment:
deactivate
Docker Deployment
# Create .env file with your API key
echo "OPENAI_API_KEY=your_key_here" > .env
# Build and run
docker-compose up --build
# Access at http://localhost:7860
To stop: Press Ctrl+C, then:
docker-compose down
๐ฎ How to Use
- Click a quick example or enter your own question (up to 500 characters)
- Adjust complexity level (1-5) using the slider to match your knowledge
- Select your language from the dropdown (6 languages available)
- Click "๐ Explain Concept" or press
Ctrl/Cmd + Enter(keyboard shortcut) - Watch the explanation stream in real-time with live reading time estimate
- Copy to clipboard with one click for easy sharing
- Give feedback with ๐ Helpful or ๐ Not Helpful to improve the app
๐ Complexity Levels Explained
| Level | Description | Best For |
|---|---|---|
| 1 ๐ง | Like I'm 5 - Simple words and analogies | Young learners, complete beginners |
| 2 ๐ฆ | Like I'm 10 - Basic concepts with examples | Elementary understanding |
| 3 ๐ | High school - Intermediate with technical terms | General audience (default) |
| 4 ๐ฏ | College - Advanced concepts with details | Students and professionals |
| 5 ๐จโ๐ฌ | Expert - Professional depth and precision | Subject matter experts |
๐ง Technical Stack
- Framework: Gradio 5.47.2 with custom theming
- AI Model: OpenAI GPT-4o-mini (optimized for quality and speed)
- Language: Python 3.11+ with type hints
- UI/UX: Custom CSS with Inter font, responsive design
- Features: Real-time streaming, session management, client-side interactivity
- Architecture: Modular code structure with proper separation of concerns
๐ Security
- API keys stored as environment variables only
- No data persistence or storage
- Secure HTTPS API calls to OpenAI
.envfiles are gitignored and never committed
๐ License
MIT License - Part of the LLM and Agentic AI Bootcamp Materials.
๐ What's New in v2.0
โจ New Features
- โ Compact, professional header with beautiful gradient design
- โ Copy to clipboard - Share explanations with one click
- โ Real-time reading time - Know how long each explanation will take
- โ Character counter - Visual feedback with color coding (green/orange/red)
- โ 3 Quick examples - Get started instantly with pre-selected questions
- โ Keyboard shortcuts - Power user features (Ctrl/Cmd+Enter, Escape)
- โ User feedback system - ๐/๐ to help improve the experience
- โ Clear button - Quick reset to start fresh
- โ Enhanced error handling - Friendly messages with technical details for debugging
๐ป Code Quality Improvements
- โ Full type hints - Complete type annotations throughout the codebase
- โ Professional logging - Structured logging system replacing print statements
- โ Modular organization - Clean code structure with clear sections
- โ Comprehensive documentation - Detailed docstrings for all functions
- โ Better error handling - Categorized errors with helpful user messages
- โ Input validation - Character limits, language verification, edge cases
๐จ UI/UX Enhancements
- โ One-screen design - Everything fits without scrolling for optimal UX
- โ Wider but shorter - 900px width, minimal vertical space
- โ Modern gradient header - Professional purple gradient (indigo to purple)
- โ Inter font - Modern, readable typography from Google Fonts
- โ Smooth animations - Entrance effects and hover transitions
- โ Enhanced dark mode - Automatic detection with beautiful themes
- โ Clean, focused layout - No sidebars, distractions, or clutter
- โ Responsive design - Works beautifully on desktop, tablet, and mobile
v2.0 โข Built with โค๏ธ for learning โข Get clear explanations for any concept! ๐ฏ