The Agent Platform SDK for Node.js lets you use the Gemini API to build AI-powered features and applications. Both TypeScript and JavaScript are supported.
For the latest list of available Gemini models on Agent Platform, see the Model information page in Agent Platform documentation.
-
Make sure your node.js version is 20 or above.
-
Create local authentication credentials for your user account:
gcloud auth application-default login
A list of accepted authentication options are listed in GoogleAuthOptions interface of google-auth-library-node.js GitHub repo.
Install the Agent Platform SDK for Node.js by running the following command:
npm install @google-cloud/agentplatformFirst, import the Client class:
import { Client } from '@google-cloud/agentplatform';Then instantiate a client:
const client: Client = new Client({
project: 'my-cloud-project',
location: 'my-cloud-location',
});The contents of this repository are licensed under the Apache License, version 2.0.