Skip to main content
Functionality related to Google Cloud Platform and AI Studio

Chat models

Gemini Models

Access Gemini models such as gemini-2.5-pro and gemini-2.0-flex through the ChatGoogleGenerativeAI, or if using VertexAI, via the ChatVertexAI class.
npm
Configure your API key.
More recent Gemini models support image inputs:
Click here for the @langchain/google-genai specific integration docs
The value of image_url must be a base64 encoded image (e.g., data:image/png;base64,abcd124).

Gemma

Access the gemma-3-27b-it model through AI Studio using the ChatGoogle class. (This class is a superclass of the ChatVertexAI class that works with both Vertex AI and the AI Studio APIs.)
Since Gemma is an open model, it may also be available from other platforms including Ollama.
npm
Configure your API key.

Third Party Models

See above for setting up authentication through Vertex AI to use these models. Anthropic Claude models are also available through the Vertex AI platform. See here for more information about enabling access to the models and the model names to use. PaLM models are no longer supported.

Vector Store

Vertex AI Vector Search, formerly known as Vertex AI Matching Engine, provides the industry’s leading high-scale low latency vector database. These vector databases are commonly referred to as vector similarity-matching or an approximate nearest neighbor (ANN) service.

Postgres Vector Store

The PostgresVectorStore module from the @langchain/google-cloud-sql-pg package provides a way to use the CloudSQL for PostgresSQL to store vector embeddings using the class.
Set your environment variables:
Create a DB connection through the PostgresEngine class:
Initialize the vector store table:
Create a vector store instance:

Tools

  • Set up a Custom Search Engine, following these instructions
  • Get an API Key and Custom Search Engine ID from the previous step, and set them as environment variables GOOGLE_API_KEY and GOOGLE_CSE_ID respectively
There exists a GoogleCustomSearch utility which wraps this API. To import this utility:
We can easily load this wrapper as a Tool (to use with an Agent). We can do this with:

Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.