RepIt is an experimental AI “class representative” that uses Google Gemini tool-calling to answer questions and trigger helper functions like class scheduling, canceling, polling, and quiz creation. The codebase currently contains a simple CLI loop plus several service stubs for future integrations (MongoDB, PostgreSQL, Excel-based schedules).
- Python 3.11+ recommended.
- Create and activate a virtual environment, then install the deps (rough set):
pip install google-genai google-auth-httplib2 google-api-python-client pymongo psycopg2-binary python-dotenv pandas openpyxl
- Set your Gemini API key (the repo currently contains placeholder keys that should be removed):
set GEMINI_API_KEY=your-key-here # Windows PowerShell: $env:GEMINI_API_KEY="your-key-here"
- Run the CLI demo (note:
core/ai_client.pystill needs aGeminiClientimplementation for this to work):python main.py
- main.py – CLI loop that prompts the user and calls
RepItAgent. - core/agents.py –
RepItAgentorchestrates prompt construction and routes Gemini function calls vs. text. - core/tools.py – Tool schema definitions (CheckUser, CancelClass, SceduleClass, ShowSchedule, ShowClassForToday, MakeQuiz, MakePoll).
- core/ai_client.py – Placeholder Gemini client script; missing the
GeminiClientclass expected bymain.py. - services/scedule_service.py – String-format stubs for scheduling/canceling/showing classes.
- services/poll_service.py – Empty stub for poll creation.
- rule.py – Hard-coded role lookup for Admin/Teacher/Student.
- db.py – MongoDB helper stub (hard-coded URI;
readnot yet implemented). - supa.py – Example PostgreSQL connection using
.envvariables. - scedule.py – Reads
Book1.xlsxinto a DataFrame; prints schedule data. - ai.py and agent.py – Earlier prototypes of the Gemini interaction loop.
main.pybuilds a context with today’s date/day and instantiatesRepItAgentwith an AI client plus the tool schema.- User input is sent to Gemini with tool definitions; responses are split into plain text vs. function calls.
- Function calls are currently just printed; wiring to real services (e.g.,
services/functions or DB calls) is pending.
GEMINI_API_KEYmust be set for any Gemini calls. Remove hard-coded keys from the codebase before deploying.- Database examples:
- If you rely on Excel schedules, keep
Book1.xlsxin the project root for scedule.py.
- Implement
GeminiClientin core/ai_client.py and replace hard-coded API keys with env-based config. - Wire tool calls to
services/implementations and expand them beyond string responses. - Add error handling, logging, and tests.
- Add a
requirements.txtorpyproject.tomlto lock dependencies.