langchain_community.chat_models.yandex.ChatYandexGPT¶
class langchain_community.chat_models.yandex.ChatYandexGPT[source]¶
Bases: _BaseYandexGPT, BaseChatModel
Wrapper around YandexGPT large language models.
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.
Example
from langchain_community.chat_models import ChatYandexGPT
chat_model = ChatYandexGPT(iam_token="t1.9eu...")
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param api_key: str = ''¶
Yandex Cloud Api Key for service account
with the ai.languageModels.user role
param cache: Optional[bool] = None¶
Whether to cache the response.
param callback_manager: Optional[BaseCallbackManager] = None¶
Callback manager to add to the run trace.
param callbacks: Callbacks = None¶
Callbacks to add to the run trace.
param folder_id: str = ''¶
Yandex Cloud folder ID
param iam_token: str = ''¶
Yandex Cloud IAM token for service or user account
with the ai.languageModels.user role
param max_tokens: int = 7400¶
Sets the maximum limit on the total number of tokens
used for both the input prompt and the generated response.
Must be greater than zero and not exceed 7400 tokens.
param metadata: Optional[Dict[str, Any]] = None¶
Metadata to add to the run trace.