ChatYandexGPT
LangChain.js supports calling YandexGPT chat models.
Setup
First, you should create a service account with the ai.languageModels.user role.
Next, you have two authentication options:
- IAM token.
You can specify the token in a constructor parameter as 
iam_tokenor in an environment variableYC_IAM_TOKEN. - API key
You can specify the key in a constructor parameter as 
api_keyor in an environment variableYC_API_KEY. 
Usage
import { ChatYandexGPT } from "langchain/chat_models/yandex";
import { HumanMessage, SystemMessage } from "langchain/schema";
const chat = new ChatYandexGPT();
const res = await chat.call([
  new SystemMessage(
    "You are a helpful assistant that translates English to French."
  ),
  new HumanMessage("I love programming."),
]);
console.log(res);
/*
AIMessage {
  lc_serializable: true,
  lc_kwargs: { content: "Je t'aime programmer.", additional_kwargs: {} },
  lc_namespace: [ 'langchain', 'schema' ],
  content: "Je t'aime programmer.",
  name: undefined,
  additional_kwargs: {}
}
 */
API Reference:
- ChatYandexGPT from 
langchain/chat_models/yandex - HumanMessage from 
langchain/schema - SystemMessage from 
langchain/schema