Metadata-Version: 2.4
Name: ragbits-guardrails
Version: 1.2.1
Summary: Guardrails module for Ragbits components
Project-URL: Homepage, https://github.com/deepsense-ai/ragbits
Project-URL: Bug Reports, https://github.com/deepsense-ai/ragbits/issues
Project-URL: Documentation, https://ragbits.deepsense.ai/
Project-URL: Source, https://github.com/deepsense-ai/ragbits
Author-email: "deepsense.ai" <ragbits@deepsense.ai>
License-Expression: MIT
Keywords: Evaluation,GenAI,Generative AI,LLMs,Large Language Models,RAG,Retrieval Augmented Generation
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: ragbits-core==1.2.1
Provides-Extra: openai
Requires-Dist: openai<2.0.0,>=1.91.0; extra == 'openai'
Description-Content-Type: text/markdown

# Ragbits Guardrails

Ragbits Guardrails is a Python package that contains utilities for ensuring the safety and relevance of responses generated by Ragbits components.

## Installation

You can install the latest version of Ragbits Guardrails using pip:

```bash
pip install ragbits-guardrails
```

## Quickstart
Example of using the OpenAI Moderation Guardrail to verify a message:

```python
import asyncio
from ragbits.guardrails.base import GuardrailManager, GuardrailVerificationResult
from ragbits.guardrails.openai_moderation import OpenAIModerationGuardrail


async def verify_message(message: str) -> list[GuardrailVerificationResult]:
    manager = GuardrailManager([OpenAIModerationGuardrail()])
    return await manager.verify(message)


if __name__ == '__main__':
    print(asyncio.run(verify_message("Test message")))
```

## Documentation
* [How-To Guides - Guardrails](https://ragbits.deepsense.ai/how-to/use_guardrails/)
<!--
TODO:
* Add link to API Reference once classes from the Guardrails package are added to the API Reference.
-->
