---
title: YandexGPT
---

이 노트북은 [YandexGPT](https://cloud.yandex.com/en/services/yandexgpt) embeddings 모델과 함께 LangChain을 사용하는 방법을 다룹니다.

사용하려면 `yandexcloud` python 패키지가 설치되어 있어야 합니다.

```python
pip install -qU  yandexcloud
먼저, ai.languageModels.user 역할을 가진 서비스 계정을 생성해야 합니다. 다음으로, 두 가지 인증 옵션이 있습니다:
  • IAM token. 생성자 매개변수 iam_token 또는 환경 변수 YC_IAM_TOKEN에 토큰을 지정할 수 있습니다.
  • API key 생성자 매개변수 api_key 또는 환경 변수 YC_API_KEY에 키를 지정할 수 있습니다.
모델을 지정하려면 model_uri 매개변수를 사용할 수 있습니다. 자세한 내용은 문서를 참조하세요. 기본적으로 folder_id 매개변수 또는 YC_FOLDER_ID 환경 변수에 지정된 폴더의 최신 버전 text-search-query가 사용됩니다.
from langchain_community.embeddings.yandex import YandexGPTEmbeddings
embeddings = YandexGPTEmbeddings()
text = "This is a test document."
query_result = embeddings.embed_query(text)
doc_result = embeddings.embed_documents([text])
query_result[:5]
[-0.021392822265625,
 0.096435546875,
 -0.046966552734375,
 -0.0183258056640625,
 -0.00555419921875]
doc_result[0][:5]
[-0.021392822265625,
 0.096435546875,
 -0.046966552734375,
 -0.0183258056640625,
 -0.00555419921875]

---

<Callout icon="pen-to-square" iconType="regular">
    [Edit the source of this page on GitHub.](https://github.com/langchain-ai/docs/edit/main/src/oss/python/integrations/text_embedding/yandex.mdx)
</Callout>
<Tip icon="terminal" iconType="regular">
    [Connect these docs programmatically](/use-these-docs) to Claude, VSCode, and more via MCP for    real-time answers.
</Tip>
I