Contributing
Thank you for your interest in contributing to LLM Data Processer!
Ways to Contribute
- 🐛 Report bugs
- 💡 Suggest features
- 📝 Improve documentation
- 🔧 Submit code changes
- ✅ Add tests
- 💬 Help others in discussions
Getting Started
1. Fork and Clone
# Fork the repository on GitHub, then:
git clone https://github.com/YOUR-USERNAME/LLM-data-processer.git
cd LLM-data-processer
2. Set Up Environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
pip install -e ".[dev]"
3. Create a Branch
Development Guidelines
Code Style
Follow PEP 8 and use type hints:
def add_guideline(self, guideline: str) -> None:
"""Add a custom guideline to influence model behavior.
Args:
guideline: A string describing the desired behavior
Returns:
None
"""
self.guideline.append(guideline)
Docstring Format
Use Google-style docstrings:
def ask(self, prompt: str, with_history: bool = True) -> str:
"""Generate a response from the LLM.
Args:
prompt: The question or instruction to send
with_history: Whether to include conversation context
Returns:
The model's response as a string
Raises:
ValueError: If prompt is empty
"""
Testing
Test your changes manually:
# Test basic functionality
from llm_helper import AIHelper
ai = AIHelper(model_name='Llama-3.1', display_response=False)
response = ai.ask("Test question")
assert isinstance(response, str)
Adding New Features
Adding a New LLM Provider
- Create a new class in
llm_helper/ai_helper.py:
class AIHelper_NewProvider:
def __init__(self, model: str = 'default-model', display_response: bool = True):
self.client = NewProviderClient()
self.model = model
self.display_response = display_response
self.history = []
def ask(self, prompt: str, display_response: bool = None) -> str:
"""Generate response using NewProvider."""
# Implementation
pass
- Update
__init__.py:
from .ai_helper import AIHelper, AIHelper_Google, AIHelper_NewProvider
__all__ = ["AIHelper", "AIHelper_Google", "AIHelper_NewProvider"]
- Add documentation
- Add examples
- Update README
Adding New Methods
- Add method to class
- Add docstring
- Update API reference
- Add usage example
- Test thoroughly
Submitting Changes
Commit Guidelines
# Good commit messages
git commit -m "Add: Support for Claude API"
git commit -m "Fix: Memory leak in chat_widget"
git commit -m "Docs: Update installation guide"
# Bad commit messages
git commit -m "updates"
git commit -m "fix stuff"
Pull Request Process
- Update documentation if needed
- Test your changes
- Update CHANGELOG.md
- Push your branch:
- Open a Pull Request on GitHub
- Address review feedback
PR Template
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Performance improvement
## Testing
How you tested your changes
## Checklist
- [ ] Code follows style guidelines
- [ ] Documentation updated
- [ ] CHANGELOG.md updated
- [ ] Examples added (if applicable)
Documentation
Updating Docs
Documentation is in the docs/ folder using Markdown.
Adding Examples
Add to examples/ folder with clear comments:
"""
Example: Analyzing customer data with AI.
This example shows how to...
"""
from llm_helper import AIHelper
import pandas as pd
# Step 1: Load data
df = pd.DataFrame({...})
# Step 2: Initialize AI
ai = AIHelper(...)
# Step 3: Query
response = ai.ask(...)
Community Guidelines
Be Respectful
- Be welcoming to newcomers
- Provide constructive feedback
- Respect different viewpoints
- Focus on the code, not the person
Getting Help
- 📖 Read the documentation
- 💬 Ask in GitHub Discussions
- 🐛 Check existing issues
Development Tips
Testing Locally
# Quick smoke test
python -c "from llm_helper import AIHelper; ai = AIHelper(); print('OK')"
# Run examples
python examples/basic_usage.py
Debugging
# Enable verbose logging
import logging
logging.basicConfig(level=logging.DEBUG)
# Test in interactive mode
python -i -m llm_helper.ai_helper
Performance
- Keep responses under 2 seconds for simple queries
- Optimize DataFrame serialization for large datasets
- Cache repeated queries when appropriate
Release Process
Maintainers follow this process:
- Update version in
__init__.pyandsetup.py - Update
CHANGELOG.md - Create git tag:
git tag v0.0.2 - Push tag:
git push --tags - Create GitHub release
- Deploy documentation
Recognition
Contributors will be:
- Added to
CONTRIBUTORS.md - Mentioned in release notes
- Credited in documentation
Questions?
Open an issue with the question label or ask in Discussions.
License
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing! 🎉