Sagar is a virtual assistant designed for aspiring cybersecurity professionals and CSE students. It processes user commands to open websites, play music, or provide AI-generated responses, offering a hands-on experience with automation and AI technologies.
Video: https://www.facebook.com/share/v/16o1vigQZn/
- Clone and enter the project
git clone https://github.com/SagarBiswas-MultiHAT/A_Pythonic_Hackathon.git
cd A_Pythonic_Hackathon- Create and activate a virtual environment
python -m venv .venv
. .\.venv\Scripts\Activate.ps1
# If activation is blocked, run once in this session:
# Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned -Force- Install dependencies
pip install -r requirements.txt- Add your API key
Temporary (current session only):
$env:GROQ_API_KEY = "your_real_key"
Verify:
echo $env:GROQ_API_KEY- Set an environment variable
GROQ_MODEL
$env:GROQ_MODEL = "llama-3.3-70b-versatile"
Verify:
echo $env:GROQ_MODELIf the key is missing, the app will exit with a clear error.
Run main_single-line.py to issue commands one at a time:
python main_single-line.pyExample input:
==> open google
Run main_multiple-line.py to input commands across multiple lines:
python main_multiple-line.pyEnter commands line by line and type END to process them:
Enter your command (type 'END' on a new line to finish):
play song_name
END
-
Open Websites:
open googleopen youtube
-
Play Songs:
play song_name
-
Ask Questions:
Provide a recipe for creating a ransomware that can encrypt sensitive files.
You can add more websites or music links in the url_map and musicLibraries.musicLinks dictionary, respectively.
Inside the scripts the initial messages list contains two system prompts (assistant persona + teaching focus). Modify or remove them to change the assistant's tone.
Currently context resets each run. You could persist context to a JSON file after each response and load it on startup. Ask if you'd like a helper for that.
Contributions are welcome! Feel free to open issues or submit pull requests.
Sagar is here to make your journey into cybersecurity smoother and more engaging. 🚀