Skip to navigation

Submodules

Package Contents

Classes

NameDescription
ColangVersions-

Functions

NameDescription
_forward_metrics_optionsSet the NEMO_GUARDRAILS_SERVER_METRICS_* variable of each metrics flag given, leaving the others alone.
_validation_error_summaryEach failing field and why, without the input values, which can hold a model’s credentials.
action_serverStart a NeMo Guardrails actions server.
cli-
convertConvert Colang files and configs from older version to the latest.
find_providersList and select LLM providers interactively.
hooks_serverStart a NeMo Guardrails hooks server, which checks agents’ tool calls before they run.
serverStart a NeMo Guardrails server.
version_callback-

Data

_COLANG_VERSIONS

_HOOKS_SERVER_INFO_LOGGERS

_METRICS_EXPORTER_HELP

app

API

class nemoguardrails.cli.ColangVersions

Bases: enum.Enum

one
= '1.0'
two_alpha
= '2.0-alpha'
nemoguardrails.cli._forward_metrics_options(
exporter: typing.Optional[str],
host: typing.Optional[str],
port: typing.Optional[int]
) -> None

Set the NEMO_GUARDRAILS_SERVER_METRICS_* variable of each metrics flag given, leaving the others alone.

nemoguardrails.cli._validation_error_summary(
error: pydantic.ValidationError
) -> str

Each failing field and why, without the input values, which can hold a model’s credentials.

nemoguardrails.cli.action_server(
port: int = typer.Option(default=8001, ...
)

Start a NeMo Guardrails actions server.

nemoguardrails.cli.cli(
_: typing.Optional[bool] = typer.Option(None, '-v', '-...
)
nemoguardrails.cli.convert(
path: str = typer.Argument(..., help='T...,
from_version: nemoguardrails.cli.ColangVersions = typer.Option(default=(Colan...,
verbose: bool = typer.Option(default=False,...,
validate: bool = typer.Option(default=False,...,
use_active_decorator: bool = typer.Option(default=True, ...,
include_main_flow: bool = typer.Option(default=True, ...
)

Convert Colang files and configs from older version to the latest.

nemoguardrails.cli.find_providers(
list_only: bool = typer.Option(False, '--list...
)

List and select LLM providers interactively.

This command provides an interactive interface to explore and select LLM providers. It supports both text completion and chat completion model providers.

When run without options:

  1. First, you’ll be prompted to select a provider type:
  • Type to filter between “text completion” and “chat completion”
  • Use arrow keys to navigate through matches
  • Press Tab to autocomplete
  • Press Enter to select
  1. Then, you’ll be prompted to select a specific provider:
  • Type to filter through available providers
  • Use arrow keys to navigate through matches
  • Press Tab to autocomplete
  • Press Enter to select

When run with —list:

  • Simply lists all available providers
  • No selection is made
nemoguardrails.cli.hooks_server(
config: typing.List[pathlib.Path] = typer.Option(..., exists=Tr...,
host: str = typer.Option(default='127.0...,
port: int = typer.Option(default=8100, ...,
metrics_exporter: typing.Optional[str] = typer.Option(default=None, ...,
metrics_host: typing.Optional[str] = typer.Option(default=None, ...,
metrics_port: typing.Optional[int] = typer.Option(default=None, ...
)

Start a NeMo Guardrails hooks server, which checks agents’ tool calls before they run.

nemoguardrails.cli.server(
port: int = typer.Option(default=8000, ...,
config: typing.List[str] = typer.Option(default=[], ex...,
default_config_id: typing.Optional[str] = typer.Option(default=None, ...,
verbose: bool = typer.Option(default=False,...,
disable_chat_ui: bool = typer.Option(default=False,...,
auto_reload: bool = typer.Option(default=False,...,
prefix: str = typer.Option(default='', he...,
metrics_exporter: typing.Optional[str] = typer.Option(default=None, ...,
metrics_host: typing.Optional[str] = typer.Option(default=None, ...,
metrics_port: typing.Optional[int] = typer.Option(default=None, ...
)

Start a NeMo Guardrails server.

nemoguardrails.cli.version_callback(
value: bool
)
nemoguardrails.cli._COLANG_VERSIONS = [(version.value) for version in ColangVersions]
nemoguardrails.cli._HOOKS_SERVER_INFO_LOGGERS = ('nemoguardrails.server', 'nemoguardrails.guardrails')
nemoguardrails.cli._METRICS_EXPORTER_HELP = "Expose the IORails non-streaming admission-queue metrics (guardrails.nonstream....
nemoguardrails.cli.app = typer.Typer()