nemoguardrails.testing

View as Markdown

Public testing surface for NeMo Guardrails.

This subpackage ships utilities that help users write fast, deterministic tests for their guardrails configurations. The two main building blocks are:

  • :class:FakeLLMModel: a scriptable implementation of the LLMModel protocol that returns canned responses.
  • :class:TestChat: an ergonomic helper for asserting bot replies against a scripted conversation.

Pytest fixtures are exposed via the nemoguardrails.testing.fixtures plugin. Add it to your conftest.py to opt in::

pytest_plugins = [“nemoguardrails.testing.fixtures”]

Submodules

Package Contents

Data

__all__

API

nemoguardrails.testing.__all__ = ['FakeLLMModel', 'TestChat']