Or, clone the repository and install directly from the source:
bash
git clone https://github.com/MaxMLang/pytector.git
cd pytector
pip install .
---
📝 Getting Started
Here’s a quick example to get started with Pytector:
python
import pytector
Initialize the detector with the DeBERTa model
detector = pytector.PromptInjectionDetector(model_name_or_url="deberta")
Check if a prompt contains an injection
is_injection, probability = detector.detect_injection("Test your text input here")
print(f"Is injection: {is_injection}, Probability: {probability}")
For more usage instructions and examples, refer to the [Getting Started Guide](https://github.com/MaxMLang/pytector/blob/main/docs/PromptInjectionDetector.md).
---
⚙️ Key Features
- **Multiple Model Support**: Flexibility to choose the model that best fits your needs.
- **Groq Content Safety Check**: Optional integration with Groq’s Llama Guard for comprehensive hazard detection, including categories like privacy violations, self-harm, and intellectual property concerns.
- **Customizable Thresholds**: Set custom probability thresholds to fine-tune detection sensitivity.
---
Known Issues
- **Groq API Key Requirement**: To use Groq’s Llama Guard feature, an API key is required.
- **Prototype Phase**: While this release is production-ready, it’s still in early stages. Future improvements and enhancements are planned based on user feedback.
---
Feedback and Contributions
Your feedback is invaluable! If you encounter any issues or have suggestions, please submit them via GitHub Issues. Contributions are welcome; see our [Contributing Guide](https://github.com/MaxMLang/pytector/blob/main/contributing.md) for more information.
---