Spaces:
Sleeping
Sleeping
Contributing to RAG Document Assistant
Thank you for your interest in contributing to the RAG Document Assistant! This document provides guidelines and information to help you contribute effectively.
Table of Contents
Getting Started
- Fork the repository on GitHub
- Clone your fork locally
- Create a new branch for your feature or bug fix
- Make your changes
- Submit a pull request
Development Setup
Prerequisites
- Python 3.8 or higher
- pip (package installer for Python)
Installation
# Clone the repository
git clone https://github.com/your-username/RAG-document-assistant.git
cd RAG-document-assistant
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Install development dependencies
pip install -r requirements-dev.txt # If available
# Or install manually:
pip install pytest black flake8 mypy
Code Style
We follow these coding standards:
Python Style Guide
- Follow PEP 8 style guide
- Use 4 spaces for indentation (no tabs)
- Line length should not exceed 88 characters
- Use meaningful variable and function names
- Write docstrings for all public functions and classes
Formatting
We use Black for code formatting:
# Format code
black src/ tests/
# Check formatting
black --check src/ tests/
Linting
We use Flake8 for linting:
flake8 src/ tests/
Type Checking
We use MyPy for static type checking:
mypy src/
Testing
Running Tests
# Run all tests
pytest
# Run tests with coverage
pytest --cov=src tests/
# Run specific test file
pytest tests/test_retrieval.py
Writing Tests
- Place test files in the
tests/directory - Follow the naming convention:
test_*.py - Use descriptive test function names
- Include both positive and negative test cases
- Test edge cases and error conditions
Submitting Changes
- Ensure your code follows the style guidelines
- Run all tests and ensure they pass
- Add tests for new functionality
- Update documentation as needed
- Commit your changes with a clear, descriptive commit message
- Push to your fork
- Submit a pull request to the main repository
Pull Request Guidelines
- Include a clear title and description
- Reference any related issues
- Keep changes focused and atomic
- Ensure all CI checks pass
- Be responsive to feedback during review
Reporting Issues
If you find a bug or have a feature request, please open an issue on GitHub with:
- A clear, descriptive title
- Detailed steps to reproduce the issue
- Expected vs. actual behavior
- Screenshots or code examples if applicable
- Information about your environment (Python version, OS, etc.)
Code of Conduct
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Questions?
If you have any questions about contributing, feel free to open an issue or contact the maintainers.