> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/guardrails/llms.txt.
> For full documentation content, see https://docs.nvidia.com/nemo/guardrails/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/guardrails/_mcp/server.

# nemoguardrails.colang.runtime

## Module Contents

### Classes

| Name                                                | Description                         |
| --------------------------------------------------- | ----------------------------------- |
| [`Runtime`](#nemoguardrails-colang-runtime-Runtime) | Base Colang Runtime implementation. |

### Data

[`log`](#nemoguardrails-colang-runtime-log)

### API

```python
class nemoguardrails.colang.runtime.Runtime(
    config: nemoguardrails.rails.llm.config.RailsConfig,
    verbose: bool = False
)
```

Base Colang Runtime implementation.

Return registered actions.

```python
nemoguardrails.colang.runtime.Runtime._init_flow_configs() -> None
```

abstract

```python
nemoguardrails.colang.runtime.Runtime.generate_events(
    events: typing.List[dict],
    processing_log: typing.Optional[typing.List[dict]] = None
) -> typing.List[dict]
```

async

Generates the next events based on the provided history.

This is a wrapper around the `process_events` method, that will keep
processing the events until the `listen` event is produced.

:return: The list of events.

**Parameters:**

The list of events.

The processing log so far. This will be mutated.

```python
nemoguardrails.colang.runtime.Runtime.process_events(
    events: typing.List[dict],
    state: typing.Optional[typing.Any] = None,
    blocking: bool = False
) -> typing.Tuple[typing.List[dict], typing.Any]
```

async

Process a sequence of events in a given state.

The events will be processed one by one, in the input order.

**Parameters:**

A sequence of events that needs to be processed.

The state that should be used as the starting point. If not provided,
a clean state will be used.

In blocking mode, the event processing will also wait for all
local async actions.

**Returns:** `Tuple[List[dict], Any]`

(output\_events, output\_state) Returns a sequence of output events and an output
state.

```python
nemoguardrails.colang.runtime.Runtime.register_action(
    action: typing.Callable,
    name: typing.Optional[str] = None,
    override: bool = True
) -> None
```

Registers an action with the given name.

:param name: The name of the action.
:param action: The action function.
:param override: If an action already exists, whether it should be overriden or not.

```python
nemoguardrails.colang.runtime.Runtime.register_action_param(
    name: str,
    value: typing.Any
) -> None
```

Registers an additional parameter that can be passed to the actions.

:param name: The name of the parameter.
:param value: The value of the parameter.

```python
nemoguardrails.colang.runtime.Runtime.register_actions(
    actions_obj: typing.Any,
    override: bool = True
) -> None
```

Registers all the actions from the given object.

```python
nemoguardrails.colang.runtime.log = logging.getLogger(__name__)
```