> 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.rails.llm.utils

## Module Contents

### Functions

| Name                                                                                                 | Description                                          |
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| [`get_action_details_from_flow_id`](#nemoguardrails-rails-llm-utils-get_action_details_from_flow_id) | Get the action name and parameters from the flow id. |
| [`get_history_cache_key`](#nemoguardrails-rails-llm-utils-get_history_cache_key)                     | Compute the cache key for a sequence of messages.    |

### API

```python
nemoguardrails.rails.llm.utils.get_action_details_from_flow_id(
    flow_id: str,
    flows: typing.List[typing.Union[typing.Dict, typing.Any]]
) -> typing.Tuple[str, typing.Any]
```

Get the action name and parameters from the flow id.

First, try to find an exact match.
If not found, then if the provided flow\_id starts with one of the special prefixes,
return the first flow whose id starts with that same prefix.

```python
nemoguardrails.rails.llm.utils.get_history_cache_key(
    messages: typing.List[dict]
) -> str
```

Compute the cache key for a sequence of messages.

**Parameters:**

The list of messages.

**Returns:** `str`

A unique string that can be used as a key for the provided sequence of messages.