# YandexGPTEmbeddings

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/embeddings/yandex/YandexGPTEmbeddings)

YandexGPT Embeddings models.

To use, you should have the ``yandexcloud`` python package installed.

There are two authentication options for the service account
with the ``ai.languageModels.user`` role:
    - You can specify the token in a constructor parameter `iam_token`
    or in an environment variable `YC_IAM_TOKEN`.
    - You can specify the key in a constructor parameter `api_key`
    or in an environment variable `YC_API_KEY`.

To use the default model specify the folder ID in a parameter `folder_id`
or in an environment variable `YC_FOLDER_ID`.

## Signature

```python
YandexGPTEmbeddings()
```

## Description

**Example:**

.. code-block:: python

from langchain_community.embeddings.yandex import YandexGPTEmbeddings
embeddings = YandexGPTEmbeddings(iam_token="t1.9eu...", folder_id=<folder-id>)

## Extends

- `BaseModel`
- `Embeddings`

## Properties

- `iam_token`
- `api_key`
- `model_uri`
- `doc_model_uri`
- `folder_id`
- `doc_model_name`
- `model_name`
- `model_version`
- `url`
- `max_retries`
- `sleep_interval`
- `disable_request_logging`
- `grpc_metadata`
- `model_config`

## Methods

- [`validate_environment()`](https://reference.langchain.com/python/langchain-community/embeddings/yandex/YandexGPTEmbeddings/validate_environment)
- [`embed_documents()`](https://reference.langchain.com/python/langchain-community/embeddings/yandex/YandexGPTEmbeddings/embed_documents)
- [`embed_query()`](https://reference.langchain.com/python/langchain-community/embeddings/yandex/YandexGPTEmbeddings/embed_query)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/a6a6079511ac8a5c1293337f88096b8641562e77/libs/community/langchain_community/embeddings/yandex.py#L23)