Skip to main content

Guardrails module for Ragbits components

Project description

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:

pip install ragbits-guardrails

Quickstart

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

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

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ragbits_guardrails-1.4.0.dev202512151244.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file ragbits_guardrails-1.4.0.dev202512151244.tar.gz.

File metadata

File hashes

Hashes for ragbits_guardrails-1.4.0.dev202512151244.tar.gz
Algorithm Hash digest
SHA256 41b25c833184e459617d483f62d6082721eabe99ed746ce5a5b8413062b18bb4
MD5 d766fe5e60a8f3ce27f9889b2d78073c
BLAKE2b-256 0419300ea3d03cd5149937e738a6dcdb382896830d4e4655a9c452add798986b

See more details on using hashes here.

File details

Details for the file ragbits_guardrails-1.4.0.dev202512151244-py3-none-any.whl.

File metadata

File hashes

Hashes for ragbits_guardrails-1.4.0.dev202512151244-py3-none-any.whl
Algorithm Hash digest
SHA256 6a7f8cf8f1bc027f80bbab28cebea21de57afb6c2f5ff451ec2b1a3753b152eb
MD5 d2bc3e397df7cb729f5b42e016e0f097
BLAKE2b-256 0a23e6d547098c83f5115bdc554801dd26f1ca85fa8b8487564ff289f8f9b663

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page