This package contains resources to access Google AI/ML models and other Google services via Vertex AI. Authorization to these services use service account credentials stored on the local file system or provided through the Google Cloud Platform environment it is running on.
If you are running this on a platform where the credentials cannot be provided this way, consider using the @langchain/google-vertexai-web package instead. You do not need to use both packages. See the section on Authorization below.
$ yarn add @langchain/google-vertexai
Authorization is done through a Google Cloud Service Account.
To handle service accounts, this package uses the google-auth-library
package, and you may wish to consult the documentation for that library
about how it does so. But in short, classes in this package will use
credentials from the first of the following that apply:
apiKey
attributeauthInfo
attributeAPI_KEY
GOOGLE_APPLICATION_CREDENTIALS
environment
variable.gcloud auth application-default login
, then the
default credentials.