-
Notifications
You must be signed in to change notification settings - Fork 2
Feat/dual mode support #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add Simple Mode alongside existing Full Mode to support LLMs with limited tool-calling capabilities. Simple Mode provides a single intelligent tool that accepts natural language queries and routes to appropriate operations. Features: - New Simple Mode with zim_query tool for natural language queries - Full Mode maintains all 15 existing specialized tools - Intelligent intent parsing with 11 supported query types - Auto-selection of ZIM files when only one exists - Configuration via --mode flag or OPENZIM_MCP_TOOL_MODE env var - Backward compatible (defaults to Full mode) Implementation: - Created openzim_mcp/simple_tools.py with IntentParser and SimpleToolsHandler - Updated config.py to support tool_mode field - Modified server.py for mode-based tool registration - Enhanced main.py with --mode command line argument - Added comprehensive documentation in docs/SIMPLE_MODE_GUIDE.md - Applied code formatting (black, isort) to all files Testing: - 27 new tests covering intent parsing and handler functionality - All 312 tests passing (100% success rate) - 77% code coverage for simple_tools.py - No regressions in existing tests Documentation: - Complete Simple Mode Guide with examples - Updated README with dual-mode information - Implementation summary document - Deployment plan and PR description - Comparison table: Full vs Simple mode Code Quality: - All files formatted with black - Imports organized with isort - Unused imports removed - Line length issues fixed
- Fix type error in config.py: use literal 'full' instead of constant - Fix type error in simple_tools.py: explicitly cast path to str - Remove unused MagicMock import from test_simple_tools.py - All 312 tests passing - Mypy type checking passes with no errors
- PR_REVIEW_FIXES.md: Detailed analysis of all issues and fixes - PR_REVIEW_COMPLETE.md: Complete review summary report - Documents all changes, verifications, and next steps
- Fix types-all dependency error by using specific type packages - Limit mypy pre-commit check to openzim_mcp/ directory only - Fix type error in content_processor.py: explicit str() cast - Add --ignore-missing-imports flag for better compatibility This resolves the pre-commit hook failure caused by yanked types-pkg-resources package.
- Remove unused TOOL_MODE_FULL import from config.py - Add noqa comment for intentional local import in simple_tools.py - Remove unused 'result' variable in test_simple_tools.py - Fix line length issue by splitting long string literal All linting checks now pass: - flake8: 0 errors - All 312 tests passing - Code coverage maintained at 79%
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #33 +/- ##
=======================================
Coverage 23.63% 23.63%
=======================================
Files 13 13
Lines 2065 2065
=======================================
Hits 488 488
Misses 1577 1577
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|



Dual-Mode Support - Cleanup and Refinement
Description
This PR refines and cleans up the dual-mode support feature implementation. It removes unnecessary Python helper scripts and replaces them with efficient shell commands in the Makefile, improving maintainability and reducing complexity.
Type of Change
Changes Made
Testing
Test Coverage
CI Status
Security Considerations
Performance Impact
Documentation
Backward Compatibility
Checklist
Additional Notes
This PR builds on the dual-mode support feature that enables both Simple Mode (for LLMs with limited tool-calling capabilities) and Full Mode (with all 15 specialized tools). The cleanup removes unnecessary Python helper scripts while maintaining all functionality and improving code maintainability.
Reviewer Guidelines
Please review:
Thank you for your contribution!