nemoguardrails.server.app

View as Markdown

Chat UI for Guardrails Server.

Module Contents

Functions

NameDescription
_discover_configsReturn the list of available guardrails configuration IDs.
on_chat_startInitialize a new chat session with a config selector dropdown.
on_messageProcess an incoming user message through guardrails.
on_settings_updateHandle configuration changes from the settings panel.
set_startersShow challenges as starter prompts when available.

Data

log

API

nemoguardrails.server.app._discover_configs() -> typing.List[str]

Return the list of available guardrails configuration IDs.

nemoguardrails.server.app.on_chat_start()
async

Initialize a new chat session with a config selector dropdown.

nemoguardrails.server.app.on_message(
message: chainlit.Message
)
async

Process an incoming user message through guardrails.

nemoguardrails.server.app.on_settings_update(
settings
)
async

Handle configuration changes from the settings panel.

nemoguardrails.server.app.set_starters(
user: typing.Optional[chainlit.User] = None
) -> typing.List[chainlit.Starter]
async

Show challenges as starter prompts when available.

nemoguardrails.server.app.log = logging.getLogger(__name__)