> This page is for version v0.24.1.
> For other versions, use one of these documentation indexes:
> - Latest (default): https://docs.nvidia.com/nemo/guardrails/latest/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.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/guardrails/_mcp/server.

# nemoguardrails.library.polygraf.request

Module for handling Polygraf PII detection requests.

## Module Contents

### Functions

| Name                                                                            | Description                                       |
| ------------------------------------------------------------------------------- | ------------------------------------------------- |
| [`polygraf_request`](#nemoguardrails-library-polygraf-request-polygraf_request) | Send a PII detection request to the Polygraf API. |

### Data

[`DEFAULT_TIMEOUT_SECONDS`](#nemoguardrails-library-polygraf-request-DEFAULT_TIMEOUT_SECONDS)

### API

```python
nemoguardrails.library.polygraf.request.polygraf_request(
    text: str,
    server_endpoint: str,
    api_key: typing.Optional[str] = None,
    http_client: typing.Optional[nemoguardrails.http.HTTPClient] = None,
    timeout: float = DEFAULT_TIMEOUT_SECONDS
) -> typing.List[typing.Dict[str, typing.Any]]
```

async

Send a PII detection request to the Polygraf API.

**Parameters:**

**`text`** `str`

The text to analyze.

---

**`server_endpoint`** `str`

The API endpoint URL.

---

**`api_key`** `Optional[str]` — default: None

The API key for the Polygraf service.

---

**`http_client`** `Optional[HTTPClient]` — default: None

Optional shared HTTP client. Passing a client lets callers
reuse connections across multiple PII checks.

---

**`timeout`** `float` — default: DEFAULT\_TIMEOUT\_SECONDS

Per-request timeout in seconds. Applied to both caller-provided
and internally created sessions.

---

**Returns:** `List[Dict[str, Any]]`

The list of entities detected by the Polygraf server.

**Raises:**

* `ValueError`: If the API call fails, times out, or the response cannot
  be parsed as JSON.

```python
nemoguardrails.library.polygraf.request.DEFAULT_TIMEOUT_SECONDS = 30
```