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

## Module Contents

### Functions

| Name                                                                                                             | Description                                                                                                   |
| ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| [`call_gcp_text_moderation_api`](#nemoguardrails-library-gcp_moderate_text-actions-call_gcp_text_moderation_api) | Application Default Credentials (ADC) is a strategy used by the GCP authentication libraries to automatically |
| [`gcp_text_moderation_mapping`](#nemoguardrails-library-gcp_moderate_text-actions-gcp_text_moderation_mapping)   | Determines whether the output from the GCP text moderation API should be blocked.                             |

### Data

[`log`](#nemoguardrails-library-gcp_moderate_text-actions-log)

### API

```python
nemoguardrails.library.gcp_moderate_text.actions.call_gcp_text_moderation_api(
    context: typing.Optional[dict] = None,
    kwargs = {}
) -> dict
```

async

Application Default Credentials (ADC) is a strategy used by the GCP authentication libraries to automatically
find credentials based on the application environment. ADC searches for credentials in the following locations (Search order):

1. GOOGLE\_APPLICATION\_CREDENTIALS environment variable
2. User credentials set up by using the Google Cloud CLI
3. The attached service account, returned by the metadata server

For more information check [https://cloud.google.com/docs/authentication/application-default-credentials](https://cloud.google.com/docs/authentication/application-default-credentials)

```python
nemoguardrails.library.gcp_moderate_text.actions.gcp_text_moderation_mapping(
    result: dict
) -> bool
```

Determines whether the output from the GCP text moderation API should be blocked.

Returns True (i.e. block the output) if any of the conditions are met.

```python
nemoguardrails.library.gcp_moderate_text.actions.log = logging.getLogger(__name__)
```