Thank you for your interest in contributing to the LessTokens SDK! This document provides guidelines and instructions for contributing.
- Be respectful and inclusive
- Welcome newcomers and help them learn
- Focus on constructive feedback
- Respect different viewpoints and experiences
- Check if the bug has already been reported
- Create a new issue with:
- Clear title and description
- Steps to reproduce
- Expected vs actual behavior
- Environment details (Python version, OS, etc.)
- Check if the feature has already been suggested
- Create a new issue with:
- Clear description of the feature
- Use cases and examples
- Potential implementation approach
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes
- Add tests for new functionality
- Ensure all tests pass:
pytest - Run linting:
black . && isort . - Commit your changes:
git commit -m "Add feature" - Push to your fork:
git push origin feature/your-feature - Create a Pull Request
- Python 3.8+
- pip
- virtualenv (recommended)
- Clone the repository:
git clone https://github.com/hivellm/lesstokens-sdk-python.git
cd lesstokens-sdk-python- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -e ".[all,dev]"- Install pre-commit hooks (optional):
pre-commit install- Follow PEP 8
- Use Black for formatting:
black . - Use isort for imports:
isort . - Maximum line length: 100 characters
- Use type hints for all functions
- Use
Optional[T]for nullable types - Use
Dict[str, Any]for flexible dictionaries
- Add docstrings to all public functions and classes
- Use Google-style docstrings
- Include examples in docstrings
- Write tests for all new functionality
- Aim for high test coverage
- Use pytest for testing
- Mock external dependencies
lesstokens-sdk-python/
├── lesstokens_sdk/
│ ├── __init__.py
│ ├── sdk.py # Main SDK class
│ ├── types.py # Type definitions
│ ├── errors.py # Error classes
│ ├── clients/ # API clients
│ ├── providers/ # LLM provider implementations
│ └── utils/ # Utility functions
├── tests/ # Test files
├── docs/ # Documentation
├── examples/ # Example code
├── pyproject.toml # Project configuration
└── README.md # Project README
Follow conventional commits:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changes (formatting, etc.)refactor:Code refactoringtest:Test changeschore:Maintenance tasks
Example:
feat: Add support for custom message roles
- Update documentation if needed
- Add tests for new functionality
- Ensure all tests pass
- Run linting and formatting
- Update CHANGELOG.md if applicable
- Request review from maintainers
If you have questions, feel free to:
- Open an issue
- Contact the maintainers
- Check existing documentation
Thank you for contributing! 🎉