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.dev202512050236.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.dev202512050236.tar.gz.

File metadata

File hashes

Hashes for ragbits_guardrails-1.4.0.dev202512050236.tar.gz
Algorithm Hash digest
SHA256 83848fbaa9a62053ffa8065d1b524ee91884c312023706cea73da2325bdcf646
MD5 6d1f04d35e05c3249152a6898ffbfc8b
BLAKE2b-256 5e62f713c2b74ec8dfc874f91f8623a76feb893694b7d0c3e04bb7150bc08c97

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ragbits_guardrails-1.4.0.dev202512050236-py3-none-any.whl
Algorithm Hash digest
SHA256 c6e1abe055432bc68361a386d5b7a202ef31f553f0b63712e12668a25cda553a
MD5 78efa0593aa5fd50418d746ab4397379
BLAKE2b-256 a54a2ff470366a1b6c6ccc3a7fe56ee5f5862eee12237892c6bde3dd205ae4b2

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