Python API Reference#

This reference is auto-generated from source code docstrings.

Core Classes#

The primary entry points for the NeMo Guardrails library.

nemoguardrails.rails.llm.llmrails.LLMRails

Rails based on a given configuration.

nemoguardrails.rails.llm.config.RailsConfig

Configuration object for the models and the rails.

Generation Options and Responses#

Control generation behavior and inspect results.

nemoguardrails.rails.llm.options.GenerationOptions

A set of options that should be applied during a generation.

nemoguardrails.rails.llm.options.GenerationResponse

nemoguardrails.rails.llm.options.GenerationRailsOptions

Options for what rails should be used during the generation.

nemoguardrails.rails.llm.options.GenerationLogOptions

Options for what should be included in the generation log.

nemoguardrails.rails.llm.options.GenerationLog

Contains additional logging information associated with a generation call.

nemoguardrails.rails.llm.options.GenerationStats

General stats about the generation.

nemoguardrails.rails.llm.options.ActivatedRail

A rail that was activated during the generation.

nemoguardrails.rails.llm.options.ExecutedAction

Information about an action that was executed.

Actions#

Register custom Python functions as actions for use in guardrails flows.

nemoguardrails.actions.action

Decorator to mark a function or class as an action.

Enumerations#