langchain_community.llms.yandex.YandexGPT¶
class langchain_community.llms.yandex.YandexGPT[source]¶
Bases: _BaseYandexGPT, LLM
Yandex large language 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.
Or specify the model URI in a constructor parameter model_uri
Example
from langchain_community.llms import YandexGPT
yandex_gpt = YandexGPT(iam_token="t1.9eu...", folder_id="b1g...")
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¶
param callback_manager: Optional[BaseCallbackManager] = None¶
param callbacks: Callbacks = None¶
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.