Skip to main content
DeprecatedThis integration is deprecated and will be removed in a future release. Please use ChatGoogleGenerativeAI instead. See the full release notes and migration guide.
Gemini Enterprise Agent Platform exposes all foundational models available in Google Cloud, like gemini-3.1-pro-preview, gemini-3.7-flash, etc. For a full and updated list of available models visit Gemini Enterprise Agent Platform documentation.
Gemini Enterprise Agent Platform vs. Gemini APIThe Gemini Enterprise Agent Platform integration is separate from the Google Gemini API. This page showcases an enterprise version of Gemini through Google Cloud Platform (GCP).
API ReferenceFor detailed documentation of all features and configuration options, head to the ChatVertexAI API reference.

Overview

Integration details

Model features

Setup

To access Gemini Enterprise Agent Platform models you’ll need to create a Google Cloud Platform account, set up credentials, and install the langchain-google-vertexai integration package.

Credentials

To use the integration you must either:
  • Have credentials configured for your environment (gcloud, workload identity, etc…)
  • Store the path to a service account JSON file as the GOOGLE_APPLICATION_CREDENTIALS environment variable
This codebase uses the google.auth library which first looks for the application credentials variable mentioned above, and then looks for system-level auth. For more information, see the google.auth API reference. To enable automated tracing of your model calls, set your LangSmith API key:

Installation

The LangChain Gemini Enterprise Agent Platform integration lives in the langchain-google-vertexai package:

Instantiation

Now we can instantiate our model object and generate chat completions:

Invocation

Built-in tools

Gemini supports a range of tools that are executed server-side.
Requires langchain-google-vertexai>=2.0.11
Gemini can execute a Google search and use the results to ground its responses:

Code execution

Requires langchain-google-vertexai>=2.0.25
Gemini can generate and execute Python code:

API reference

For detailed documentation of all features and configuration options, head to the ChatVertexAI API reference.