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

Prompts for the various steps in the interaction.

## Module Contents

### Functions

| Name                                                           | Description                                                |
| -------------------------------------------------------------- | ---------------------------------------------------------- |
| [`_get_prompt`](#nemoguardrails-llm-prompts-_get_prompt)       | Return the prompt for the given task.                      |
| [`_load_prompts`](#nemoguardrails-llm-prompts-_load_prompts)   | Load the predefined prompts from the `prompts` directory.  |
| [`get_prompt`](#nemoguardrails-llm-prompts-get_prompt)         | Return the prompt for the given task.                      |
| [`get_task_model`](#nemoguardrails-llm-prompts-get_task_model) | Return the model for the given task in the current config. |

### Data

[`CURRENT_DIR`](#nemoguardrails-llm-prompts-CURRENT_DIR)

[`_prompts`](#nemoguardrails-llm-prompts-_prompts)

### API

```python
nemoguardrails.llm.prompts._get_prompt(
    task_name: str,
    model: str,
    prompting_mode: str,
    prompts: typing.List
) -> nemoguardrails.rails.llm.config.TaskPrompt
```

Return the prompt for the given task.

We intentionally update the matching model at equal score, to take the last one,
basically allowing to override a prompt for a specific model.

```python
nemoguardrails.llm.prompts._load_prompts() -> typing.List[nemoguardrails.rails.llm.config.TaskPrompt]
```

Load the predefined prompts from the `prompts` directory.

```python
nemoguardrails.llm.prompts.get_prompt(
    config: nemoguardrails.rails.llm.config.RailsConfig,
    task: typing.Union[str, nemoguardrails.llm.types.Task]
) -> nemoguardrails.rails.llm.config.TaskPrompt
```

Return the prompt for the given task.

```python
nemoguardrails.llm.prompts.get_task_model(
    config: nemoguardrails.rails.llm.config.RailsConfig,
    task: typing.Union[str, nemoguardrails.llm.types.Task]
) -> typing.Optional[nemoguardrails.rails.llm.config.Model]
```

Return the model for the given task in the current config.

```python
nemoguardrails.llm.prompts.CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
```

```python
nemoguardrails.llm.prompts._prompts = _load_prompts()
```