> This page is for version Latest (default).
> For other versions, use one of these documentation indexes:
> - Latest (default): https://docs.nvidia.com/nemo/guardrails/latest/llms.txt
> - v0.25.0: https://docs.nvidia.com/nemo/guardrails/v0.25.0/llms.txt
> - v0.24.1: https://docs.nvidia.com/nemo/guardrails/v0.24.1/llms.txt
> - v0.24.0: https://docs.nvidia.com/nemo/guardrails/v0.24.0/llms.txt
> - v0.23.0: https://docs.nvidia.com/nemo/guardrails/v0.23.0/llms.txt
> - v0.22.0: https://docs.nvidia.com/nemo/guardrails/v0.22.0/llms.txt

> 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.

# nemoguardrails.deprecation

Removal warnings for what leaves with the LLMRails engine: direct LLMRails use and Colang 2.x.

## Module Contents

### Classes

| Name                                                                           | Description                                                  |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------ |
| [`LLMRailsRemovalWarning`](#nemoguardrails-deprecation-LLMRailsRemovalWarning) | A feature that is removed together with the LLMRails engine. |

### Functions

| Name                                                                                           | Description                                                                                                   |
| ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| [`_is_package_file`](#nemoguardrails-deprecation-_is_package_file)                             | -                                                                                                             |
| [`_stacklevel_outside_package`](#nemoguardrails-deprecation-_stacklevel_outside_package)       | Return the stacklevel, counted from warn_at_caller_outside_package, of the nearest frame outside the package. |
| [`called_from_package`](#nemoguardrails-deprecation-called_from_package)                       | Return True when the function calling this one was itself called from inside the nemoguardrails package.      |
| [`llmrails_removal_message`](#nemoguardrails-deprecation-llmrails_removal_message)             | Return the removal notice for *subject*, naming *alternative* as the way forward.                             |
| [`removal_warnings_silenced`](#nemoguardrails-deprecation-removal_warnings_silenced)           | Silence LLMRailsRemovalWarnings in the block, so that one construction emits at most one.                     |
| [`warn_at_caller_outside_package`](#nemoguardrails-deprecation-warn_at_caller_outside_package) | Emit *message* as *category*, attributed to the nearest caller outside the nemoguardrails package.            |
| [`warn_llmrails_removal`](#nemoguardrails-deprecation-warn_llmrails_removal)                   | Emit an LLMRailsRemovalWarning attributed to the nearest caller outside the nemoguardrails package.           |

### Data

[`COLANG_2_ALTERNATIVE`](#nemoguardrails-deprecation-COLANG_2_ALTERNATIVE)

[`DEPRECATED_SINCE`](#nemoguardrails-deprecation-DEPRECATED_SINCE)

[`REMOVAL_RELEASE`](#nemoguardrails-deprecation-REMOVAL_RELEASE)

[`_PACKAGE_DIR`](#nemoguardrails-deprecation-_PACKAGE_DIR)

[`_removal_warnings_silenced`](#nemoguardrails-deprecation-_removal_warnings_silenced)

### API

```python
class nemoguardrails.LLMRailsRemovalWarning()
```

**Bases:** `DeprecationWarning`

A feature that is removed together with the LLMRails engine.

```python
nemoguardrails.deprecation._is_package_file(
    filename: str
) -> bool
```

```python
nemoguardrails.deprecation._stacklevel_outside_package() -> int
```

Return the stacklevel, counted from warn_at_caller_outside_package, of the nearest frame outside the package.

```python
nemoguardrails.deprecation.called_from_package() -> bool
```

Return True when the function calling this one was itself called from inside the nemoguardrails package.

```python
nemoguardrails.deprecation.llmrails_removal_message(
    subject: str,
    alternative: str
) -> str
```

Return the removal notice for *subject*, naming *alternative* as the way forward.

```python
nemoguardrails.deprecation.removal_warnings_silenced() -> typing.Iterator[None]
```

Silence LLMRailsRemovalWarnings in the block, so that one construction emits at most one.

```python
nemoguardrails.deprecation.warn_at_caller_outside_package(
    message: str,
    category: type[Warning]
) -> None
```

Emit *message* as *category*, attributed to the nearest caller outside the nemoguardrails package.

```python
nemoguardrails.deprecation.warn_llmrails_removal(
    subject: str,
    alternative: str
) -> None
```

Emit an LLMRailsRemovalWarning attributed to the nearest caller outside the nemoguardrails package.

```python
nemoguardrails.deprecation.COLANG_2_ALTERNATIVE = 'IORails will not support Colang 2.x, so there is no replacement.'
```

```python
nemoguardrails.deprecation.DEPRECATED_SINCE = '0.25.0'
```

```python
nemoguardrails.deprecation.REMOVAL_RELEASE = '0.27.0'
```

```python
nemoguardrails.deprecation._PACKAGE_DIR = os.path.dirname(os.path.realpath(__file__)) + os.sep
```

```python
nemoguardrails.deprecation._removal_warnings_silenced: ContextVar[bool] = ContextVar('llmrails_removal_warnings_silenced', default=False)
```