π€ Contributing to openstackai
First off, thank you for considering contributing to openstackai! We're building the pandas of AI, and every contribution helps make AI development simpler for everyone.
Code of Conductβ
Be respectful, inclusive, and constructive. We're all here to build something amazing together.
How Can I Contribute?β
π Reporting Bugsβ
- Check if the bug is already reported in Issues
- If not, create a new issue with:
- Clear title and description
- Steps to reproduce
- Expected vs actual behavior
- Python version and OS
- openstackai version (
import openstackai; print(openstackai.__version__))
π‘ Suggesting Featuresβ
- Check existing feature requests
- Create an issue with the
enhancementlabel - Describe the feature and use case
- If possible, suggest implementation approach
π§ Pull Requestsβ
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Write/update tests
- Ensure all tests pass
- Commit (
git commit -m 'Add amazing feature') - Push (
git push origin feature/amazing-feature) - Open a Pull Request
Development Setupβ
Prerequisitesβ
- Python 3.9+
- pip or poetry
- OpenAI API key (for integration tests)
Installationβ
# Clone the repository
git clone https://github.com/gitpavleenbali/PYAI.git
cd PYAI
# Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/macOS
# or
venv\Scripts\activate # Windows
# Install development dependencies
pip install -e ".[dev]"
Running Testsβ
# Unit tests
pytest tests/
# With coverage
pytest tests/ --cov=openstackai --cov-report=html
# Integration tests (requires API key)
export OPENAI_API_KEY=sk-...
pytest tests/integration/
Code Styleβ
We use:
- Black for formatting
- isort for import sorting
- Ruff for linting
- mypy for type checking
# Format code
black openstackai/
isort openstackai/
# Check linting
ruff check openstackai/
# Type checking
mypy openstackai/
Project Structureβ
openstackai/
βββ openstackai/
β βββ easy/ # Simple API (contributions welcome!)
β βββ core/ # Core components
β βββ instructions/ # Prompt engineering
β βββ skills/ # Agent capabilities
β βββ blueprint/ # Complex workflows
βββ tests/
β βββ unit/ # Unit tests
β βββ integration/ # Integration tests
βββ docs/ # Documentation
βββ examples/ # Usage examples
Contribution Guidelinesβ
For Easy API (openstackai/easy/)β
This is where the magic happens! When adding new one-liner functions:
- Simplicity First: The function should do one thing well
- Sensible Defaults: Work out-of-the-box without configuration
- Progressive Complexity: Basic usage is simple, advanced options available
- Type Hints: Full type annotations required
- Documentation: Docstrings with examples
Example:
def new_function(
input: str,
*,
option1: bool = False,
option2: str = "default",
model: Optional[str] = None,
) -> str:
"""
One-line description.
Args:
input: What this input is
option1: What this option does
option2: What this option does
model: Override default model
Returns:
What the function returns
Example:
>>> from openstackai import new_function
>>> result = new_function("example input")
>>> print(result)
"Expected output"
"""
config = get_config()
llm = LLMInterface.from_config(config, model=model)
# Implementation...
return result
For Core Componentsβ
When modifying core components:
- Maintain backward compatibility
- Add tests for new functionality
- Update type stubs (
.pyifiles) - Document any API changes
For Skillsβ
When adding new skills:
- Extend the
Skillbase class - Implement
execute()method - Add to
builtin.pyif it's commonly useful - Write comprehensive tests
Adding New LLM Providersβ
To add support for a new LLM provider:
- Create provider class in
openstackai/core/llm.py:
class NewProvider(LLMProvider):
def __init__(self, api_key: str, **kwargs):
self.client = NewLLMClient(api_key)
def complete(self, prompt: str, **kwargs) -> str:
response = self.client.generate(prompt)
return response.text
- Add to provider selection in
llm_interface.py - Add configuration options
- Add integration tests
- Update documentation
Writing Documentationβ
- Use clear, concise language
- Include code examples
- Keep examples runnable
- Update API reference for new features
- Add to CHANGELOG.md
Release Processβ
- Update version in
pyproject.toml - Update CHANGELOG.md
- Create git tag (
git tag v0.2.0) - Push tag (
git push origin v0.2.0) - CI/CD handles PyPI release
Recognitionβ
Contributors will be:
- Listed in CONTRIBUTORS.md
- Mentioned in release notes
- Part of building the most revolutionary AI library ever!
Questions?β
- Open a Discussion
- Join our Discord (coming soon)
- Email: contributors@openstackai.dev
Thank you for being part of the openstackai revolution! πΌπ€