-
Notifications
You must be signed in to change notification settings - Fork 126
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
[Enhancement] Add guideline classifier integration #294
base: develop
Are you sure you want to change the base?
Conversation
- Add DSPy integration for guideline optimization - Implement COPRO optimizer with batch processing - Add metrics tracking for model performance - Add Ollama support for local models - Add tests for DSPy integration - Update dependencies for DSPy support
- Fixed example creation to use direct field assignment instead of inputs/outputs dict - Updated _calculate_response_quality to handle new example format - Added difflib for better response quality calculation
- Inherit from ChatAdapter instead of Adapter - Properly initialize parent class with callbacks - Implement format method to store messages in history - Simplify inspect_history to match base LM interface - Add proper type hints and docstrings following PEP 257
- Add GuidelineClassifier implementation for determining which guidelines to activate - Update run_guideline_optimization.py to support both OpenAI and Llama2 models - Add classification script and tests - Improve response optimization with COPRO parameters Key changes: - GuidelineClassifier class for smart guideline activation - Support for both OpenAI and local Llama2 models - Enhanced optimization parameters for better responses - Comprehensive test coverage
GuidelineClassifier ImplementationThe classifier uses DSPy's optimization framework with COPRO to improve classification accuracy: ```python
``` The classifier is designed to be model-agnostic, supporting both cloud-based and local models through a unified interface. |
COPRO Optimization ConfigurationEnhanced optimization parameters for better response quality: ```python These parameters were tuned to balance between response quality and computational efficiency. |
Test CoverageAdded comprehensive tests for the classifier: ```python
``` The tests verify both functionality and output format across different model types. |
- Add detailed integration phases - Document implementation details - Specify environment variables - Provide timeline and dependencies
- Add comprehensive DSPy integration section - Document installation and configuration steps - Add code examples with type hints - Include roadmap overview and feature list - Highlight differences from main repository - Add contribution guidelines Part of Phase 1 implementation.
Hey @jmanhype awesome initiative! I'd love a deeper tour of the roadmap here and where you'd like to take this. Could you DM me on Discord to set up a call? |
Overview
This PR adds a guideline classifier to improve the optimization pipeline by determining which guidelines should be activated based on conversation context. This is Phase 1 of our DSPy integration roadmap.
Key Changes
Implementation Details
Testing
Performance
Notes
Next Steps
Please see the detailed roadmap in ROADMAP.md for the complete integration plan. This PR represents Phase 1 of 5 phases:
Each phase will be submitted as a separate PR to maintain code review quality and manage complexity.