Optimize MLA lookup and fix tests#17
Conversation
- Refactored `backend/maharashtra_locator.py` to use dictionaries for O(1) lookups instead of list iteration. - Added in-memory caching to `backend/gemini_summary.py` to reduce redundant AI API calls. - Updated `tests/test_mh_endpoint.py` to match real-world data in the JSON files. - Suppressed `FutureWarning` from `google.generativeai` package. - Updated `tests/test_maharashtra_locator.py` to verify dictionary data structures.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
✅ Deploy Preview for fixmybharat canceled.
|
This PR addresses performance and correctness issues in the MLA lookup and AI summary features.
Performance:
maharashtra_locator.pyto O(1) dictionary lookups.generate_mla_summaryto avoid hitting the Gemini API for repeated requests for the same MLA.Correctness:
tests/test_mh_endpoint.pywhich was asserting against placeholder data ("Sample MLA") while the actual JSON data contained real names ("Ravindra Dhangekar").Maintenance:
google.generativeai.PR created automatically by Jules for task 3080651485260252964 started by @RohanExploit