Thank you for your interest in contributing! This document provides guidelines for contributing to the project.
- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive criticism
- Help each other learn and grow
git clone https://github.com/yourusername/LLM-Chatbot-Framework.git
cd LLM-Chatbot-Frameworkpython -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt # If availablegit checkout -b feature/your-feature-nameWe follow PEP 8 with these tools:
- Black for code formatting
- isort for import sorting
- flake8 for linting
- mypy for type checking
Run formatters:
black app/ tests/
isort app/ tests/
flake8 app/ tests/
mypy app/Always use type hints:
def process_message(user_id: str, message: str) -> dict:
"""Process a chat message."""
pass- Add docstrings to all functions, classes, and modules
- Use Google-style docstrings
- Update README.md for new features
- Add examples to EXAMPLES.md
Example docstring:
def create_user(email: str, username: str, password: str) -> User:
"""Create a new user account.
Args:
email: User's email address
username: Unique username
password: Plain text password (will be hashed)
Returns:
Created User object
Raises:
ValueError: If username already exists
"""
pass- Write tests for all new features
- Maintain test coverage above 80%
- Use pytest for testing
Run tests:
pytest
pytest --cov=app tests/ # With coverageUse conventional commits:
type(scope): subject
body
footer
Types:
feat: New featurefix: Bug fixdocs: Documentationstyle: Code style changesrefactor: Code refactoringtest: Testschore: Maintenance
Examples:
feat(chat): add streaming response support
Implement WebSocket-based streaming for real-time chat responses.
Includes connection management and error handling.
Closes #123
fix(auth): resolve token expiration bug
Fixed issue where tokens were expiring prematurely due to
incorrect timezone handling.
- Code follows style guidelines
- All tests pass
- Added tests for new features
- Updated documentation
- No merge conflicts
- Push your branch
- Create pull request on GitHub
- Fill out PR template
- Link related issues
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
How was this tested?
## Checklist
- [ ] Tests pass
- [ ] Code follows style guidelines
- [ ] Documentation updated
- [ ] No breaking changes (or documented)- Maintainers will review within 3-5 days
- Address review comments
- Keep PR updated with main branch
Create an issue with:
- Clear description
- Use case
- Expected behavior
- Alternative solutions considered
Include:
- Description
- Steps to reproduce
- Expected behavior
- Actual behavior
- Environment details
- Screenshots (if applicable)
Template:
**Describe the bug**
Clear description of the bug
**To Reproduce**
1. Step 1
2. Step 2
3. ...
**Expected behavior**
What should happen
**Actual behavior**
What actually happens
**Environment**
- OS: [e.g., Ubuntu 20.04]
- Python version: [e.g., 3.10]
- Package version: [e.g., 1.0.0]
**Additional context**
Any other relevant informationapp/
├── api/ # API endpoints
│ └── v1/
├── core/ # Core configuration
├── models/ # Database models
├── schemas/ # Pydantic schemas
├── services/ # Business logic
├── middleware/ # Custom middleware
└── utils/ # Utilities
tests/ # Test suite
docs/ # Documentation
To add a new LLM provider:
- Update
app/services/llm_service.py - Add provider initialization method
- Handle provider-specific configuration
- Add tests
- Update documentation
- Create route in appropriate file
- Define Pydantic schemas
- Implement service logic
- Add authentication if needed
- Write tests
- Update OpenAPI docs
- Create model in
app/models/ - Add relationships
- Create migration (if using Alembic)
- Update schemas
- Add service methods
- Write tests
Install pre-commit hooks:
pre-commit installuvicorn app.main:app --reload# All tests
pytest
# Specific test file
pytest tests/test_auth.py
# With coverage
pytest --cov=app --cov-report=html
# Watch mode
pytest-watchIf using Alembic:
# Create migration
alembic revision --autogenerate -m "description"
# Apply migration
alembic upgrade head
# Rollback
alembic downgrade -1- Open an issue for questions
- Check existing issues and PRs
- Join our community discussions
By contributing, you agree that your contributions will be licensed under the project's MIT License.
Contributors will be added to CONTRIBUTORS.md.
Thank you for contributing! 🎉