> 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.library.privateai.request

Module for handling Private AI detection requests.

## Module Contents

### Functions

| Name                                                                                 | Description                                         |
| ------------------------------------------------------------------------------------ | --------------------------------------------------- |
| [`private_ai_request`](#nemoguardrails-library-privateai-request-private_ai_request) | Send a PII detection request to the Private AI API. |

### Data

[`log`](#nemoguardrails-library-privateai-request-log)

### API

```python
nemoguardrails.library.privateai.request.private_ai_request(
    text: str,
    enabled_entities: typing.List[str],
    server_endpoint: str,
    api_key: typing.Optional[str] = None
)
```

async

Send a PII detection request to the Private AI API.

**Parameters:**

The text to analyze.

List of entity types to detect.

The API endpoint URL.

The API key for the Private AI service.

**Returns:**

The response from the Private AI API. See Private AI API reference for more details:

**Raises:**

* `ValueError`: If api\_key is missing for cloud API, if the API call fails,
  or if the response cannot be parsed as JSON.

```python
nemoguardrails.library.privateai.request.log = logging.getLogger(__name__)
```