> 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.embeddings.providers.google

## Module Contents

### Classes

| Name                                                                                       | Description                       |
| ------------------------------------------------------------------------------------------ | --------------------------------- |
| [`GoogleEmbeddingModel`](#nemoguardrails-embeddings-providers-google-GoogleEmbeddingModel) | Embedding model using Gemini API. |

### API

```python
class nemoguardrails.embeddings.providers.google.GoogleEmbeddingModel(
    embedding_model: str,
    kwargs = {}
)
```

**Bases:** [EmbeddingModel](/guardrails-python-sdk/nemoguardrails/embeddings/providers/base#nemoguardrails-embeddings-providers-base-EmbeddingModel)

Embedding model using Gemini API.

This class is a wrapper for using embedding models powered by Gemini API.

To use, you must have either:

1. The `GOOGLE_API_KEY` environment variable set with your API key, or
2. Pass your API key using the api\_key kwarg to the genai.Client().

**Parameters:**

The name of the embedding model to be used.

Additional keyword arguments. Supports:

* output\_dimensionality (int, optional): Desired output dimensions (128-3072 for gemini-embedding-001).
  Recommended values: 768, 1536, or 3072. If not specified, API defaults to 3072.
* api\_key (str, optional): API key for authentication (or use GOOGLE\_API\_KEY env var).
* Other arguments passed to genai.Client() constructor.

```python
nemoguardrails.embeddings.providers.google.GoogleEmbeddingModel.encode(
    documents: typing.List[str]
) -> typing.List[typing.List[float]]
```

Encode a list of documents into their corresponding sentence embeddings.

**Parameters:**

The list of documents to be encoded.

**Returns:** `List[List[float]]`

List\[List\[float]]: The list of sentence embeddings, where each embedding is a list of floats.

**Raises:**

* `RuntimeError`: If the embedding request fails.

```python
nemoguardrails.embeddings.providers.google.GoogleEmbeddingModel.encode_async(
    documents: typing.List[str]
) -> typing.List[typing.List[float]]
```

async

Encode a list of documents into their corresponding sentence embeddings.

**Parameters:**

The list of documents to be encoded.

**Returns:** `List[List[float]]`

List\[List\[float]]: The list of sentence embeddings, where each embedding is a list of floats.