---
title: ChatYandexGPT
---

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

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

```python
pip install -qU  yandexcloud
먼저, ai.languageModels.user role을 가진 service account를 생성해야 합니다. 다음으로, 두 가지 인증 옵션이 있습니다:
  • IAM token. constructor parameter iam_token 또는 environment variable YC_IAM_TOKEN에 token을 지정할 수 있습니다.
  • API key constructor parameter api_key 또는 environment variable YC_API_KEY에 key를 지정할 수 있습니다.
model을 지정하려면 model_uri parameter를 사용할 수 있습니다. 자세한 내용은 문서를 참조하세요. 기본적으로 parameter folder_id 또는 YC_FOLDER_ID environment variable에 지정된 folder의 최신 버전 yandexgpt-lite가 사용됩니다.
from langchain_community.chat_models import ChatYandexGPT
from langchain.messages import HumanMessage, SystemMessage
chat_model = ChatYandexGPT()
answer = chat_model.invoke(
    [
        SystemMessage(
            content="You are a helpful assistant that translates English to French."
        ),
        HumanMessage(content="I love programming."),
    ]
)
answer
AIMessage(content='Je adore le programmement.')

---

<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/chat/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