Spaces:
Sleeping
Sleeping
AI Assistant
feat: add support for Gemini API and implement state management for quiz turns and answers
b85377a |
Download README.md from amer003100/securityChatbot: direct link, hf CLI and curl.
- Browser
- Download file 2.66 kB
-
https://huggingface.co/spaces/amer003100/securityChatbot/resolve/main/README.md
- Command line
-
hf download hf://spaces/amer003100/securityChatbot/README.md
-
curl -L -o README.md https://huggingface.co/spaces/amer003100/securityChatbot/resolve/main/README.md
2.66 kB
| title: SecurityChatbot | |
| emoji: π | |
| colorFrom: gray | |
| colorTo: pink | |
| sdk: docker | |
| pinned: false | |
| # Security Awareness Chatbot ππ€ | |
| A modular, AI-powered backend that simulates social engineering attacks and provides interactive quizzes to train users on cybersecurity best practicesβall in a friendly **Egyptian Arabic** persona! | |
| ## π What Does This Bot Offer? | |
| 1. **π‘οΈ Interactive Security Assistant** | |
| Talk to a cybersecurity expert AI. Ask any question about digital safety, and get answers in simple, casual Egyptian Arabic. | |
| 2. **π΅οΈββοΈ Social Engineering Simulation (Roleplay)** | |
| Users can type `/train` to enter a simulated attack scenario. | |
| - **Scenarios:** Bank employee, Delivery Courier, IT Support, WhatsApp Support, Lottery. | |
| - **Difficulty Levels:** Easy, Medium, Hard (ranging from obvious to highly manipulative). | |
| - **Mechanism:** The AI plays the attacker, trying to extract sensitive info. A separate AI (Evaluator) acts as a referee to catch if the user leaks data or successfully defends themselves for 4 turns. | |
| 3. **π Dynamic Cybersecurity Quizzes** | |
| Users can choose the Quiz mode to get a dynamically generated Multiple Choice Question (MCQ) about cybersecurity topics. The bot evaluates their answer and provides a friendly explanation. | |
| 4. **β‘ High Reliability (Fallback Logic)** | |
| Powered by OpenAI (GPT-4o-mini) and Groq (Llama-3), with built-in automatic fallback to Google Gemini (1.5-flash) if the primary models experience downtime. | |
| --- | |
| ## π Project Structure | |
| ``` | |
| securityChatbot/ | |
| βββ app/ | |
| β βββ __init__.py | |
| β βββ main.py | |
| β βββ core/ | |
| β β βββ __init__.py | |
| β β βββ config.py | |
| β β βββ prompts.py | |
| β βββ models/ | |
| β β βββ __init__.py | |
| β β βββ schemas.py | |
| β βββ routers/ | |
| β β βββ __init__.py | |
| β β βββ webhook.py | |
| β βββ services/ | |
| β βββ __init__.py | |
| β βββ llm_service.py | |
| β βββ state_manager.py | |
| βββ Dockerfile | |
| βββ .dockerignore | |
| βββ pyproject.toml | |
| βββ README.md | |
| ``` | |
| ## Setup & Run Locally | |
| ```bash | |
| uv sync | |
| uv run uvicorn app.main:app --reload --host 0.0.0.0 --port 8000 | |
| ``` | |
| ## API Endpoints | |
| | Method | Path | Description | | |
| |--------|------------|------------------------------| | |
| | GET | `/` | Health check | | |
| | POST | `/webhook` | Main chat endpoint | | |
| ### Webhook Payload | |
| ```json | |
| { | |
| "user_id": "user123", | |
| "message": "Hello" | |
| } | |
| ``` | |
| ### Commands | |
| - `/train` β Start the social engineering simulation | |