nemoguardrails.llm.completion_parsing
nemoguardrails.llm.completion_parsing
Text helpers for interpreting raw LLM completions.
Pure string transformations with no Colang, event, or configuration dependency, so they can be used from a rail action that runs without a Colang runtime.
The completion parsers that do depend on Colang intent/action vocabulary stay in
nemoguardrails.actions.llm.utils.
Module Contents
Functions
API
Helper that extracts multi-line responses from the LLM. Stopping conditions: when a non-empty line ends with a quote or when the token “user” appears after a newline. Empty lines at the begging of the string are skipped.
Removes the action/intent identifiers.
Helper that removes quotes from a string if the entire string is between quotes