Setup
First, you should create a service account with theai.languageModels.user
role.
Next, you have two authentication options:
- IAM token.
You can specify the token in a constructor parameter as
iam_token
or in an environment variableYC_IAM_TOKEN
. - API key
You can specify the key in a constructor parameter as
api_key
or in an environment variableYC_API_KEY
.
Usage
npm
Related
- Chat model conceptual guide
- Chat model how-to guides