Skip to main content

Google integrations

还没翻译译自英文(docs.langchain.com)本页 84 段都还没译

This page covers all LangChain integrations with Google Gemini, Google Cloud, and other Google products (such as Google Maps, YouTube, and more).

Note

Unified SDK & package consolidation

As of langchain-google-genai 4.0.0, this package uses the consolidated google-genai SDK and now supports both the Gemini Developer API and Gemini Enterprise Agent Platform backends.

The langchain-google-vertexai package remains supported for Gemini Enterprise Agent Platform-specific features (Model Garden, Vector Search, evaluation services, etc.).

Read the full announcement and migration guide.

Not sure which package to use?

Google Generative AI (Gemini API & Gemini Enterprise Agent Platform)

Google Cloud (Gemini Enterprise Agent Platform Services)

See Google's guide on migrating from the Gemini API to Gemini Enterprise Agent Platform for more details on the differences.


Google Generative AI

Access Google Gemini models via the Gemini Developer API or Gemini Enterprise Agent Platform using the unified langchain-google-genai package.

Chat models

ChatGoogleGenerativeAI

Google Gemini chat models via Gemini Developer API or Gemini Enterprise Agent Platform.

LLMs

GoogleGenerativeAI

Gemini models using the (legacy) LLM text completion interface.

Embedding models

GoogleGenerativeAIEmbeddings

Gemini embedding models via Gemini Developer API or Gemini Enterprise Agent Platform.


Google Cloud

Access Gemini Enterprise Agent Platform-specific services including Model Garden (Llama, Mistral, Anthropic), Vector Search, evaluation services, and specialized vision models.

Note

For Gemini models, use ChatGoogleGenerativeAI from langchain-google-genai. The classes below focus on Gemini Enterprise Agent Platform services not available in the consolidated SDK.

Chat models

ChatAnthropicVertex

Anthropic on Gemini Enterprise Agent Platform Model Garden

ChatVertexAI (deprecated)

VertexModelGardenLlama

VertexModelGardenMistral

GemmaChatLocalHF

GemmaChatLocalKaggle

GemmaChatVertexAIModelGarden

VertexAIImageCaptioningChat

VertexAIImageEditorChat

VertexAIImageGeneratorChat

VertexAIVisualQnAChat

LLMs

(Legacy) string-in, string-out LLM interface.

VertexAIModelGarden

Hundreds of OSS models via Gemini Enterprise Agent Platform Model Garden.

VertexAI (deprecated)

Gemma local from Hugging Face

Gemma local from Kaggle

Gemma on Gemini Enterprise Agent Platform Model Garden

Gemini Enterprise Agent Platform image captioning

Embedding models

VertexAIEmbeddings (deprecated)

Document loaders

AlloyDB for PostgreSQL

PostgreSQL-compatible database on Google Cloud.

BigQuery

Serverless data warehouse.

Bigtable

Key-value and wide-column store for structured and semi-structured data.

Cloud SQL for MySQL

Managed MySQL database.

Cloud SQL for SQL Server

Managed SQL Server database.

Cloud SQL for PostgreSQL

Managed PostgreSQL database.

Cloud Storage (directory)

Load documents from a GCS bucket directory.

Cloud Storage (file)

Load a single document from GCS.

El Carro for Oracle Workloads

Oracle databases on Kubernetes via El Carro.

Firestore (Native Mode)

NoSQL document database.

Firestore (Datastore Mode)

Firestore in Datastore mode.

Memorystore for Redis

Managed Redis service.

Spanner

Globally distributed relational database.

Speech-to-Text

Transcribe audio files.

Cloud Vision loader

Document transformers

Document AI

Extract structured data from unstructured documents.

Google Translate

Translate text and HTML via Cloud Translation API.

Vector stores

Store and search vectors using Google Cloud databases and Vector Search on Gemini Enterprise Agent Platform.

AlloyDB for PostgreSQL

PostgreSQL-compatible vector store on AlloyDB.

BigQuery Vector Search

Semantic search using GoogleSQL with vector indexes.

Memorystore for Redis

Vector store on Memorystore for Redis.

Spanner

Vector store on Cloud Spanner.

Bigtable

Vector store on Cloud Bigtable.

Firestore (Native Mode)

Vector store on Firestore.

Cloud SQL for MySQL

Vector store on Cloud SQL for MySQL.

Cloud SQL for PostgreSQL

Vector store on Cloud SQL for PostgreSQL.

Vector Search on Gemini Enterprise Agent Platform

Formerly known as Vertex AI Matching Engine, provides a low latency vector database. These vector databases are commonly referred to as vector similarity-matching or an approximate nearest neighbor (ANN) service.

Vector Search on Gemini Enterprise Agent Platform + Datastore

Vector search with Datastore for document storage.

Retrievers

Agent Search on Gemini Enterprise Agent Platform

Generative AI powered search via Agent Search on Gemini Enterprise Agent Platform.

Document AI Warehouse

Search, store, and manage documents using Document AI Warehouse.

from langchain_google_community import VertexAIMultiTurnSearchRetriever
from langchain_google_community import VertexAISearchRetriever
from langchain_google_community import VertexAISearchSummaryTool

Tools

Integrate agents with various Google Cloud services.

Text-to-Speech

Synthesize natural-sounding speech with 100+ voices.

Callbacks

Track LLM/Chat model usage.

Gemini Enterprise Agent Platform callback handler

Google BigQuery

Evaluators

Evaluate model outputs using Gemini Enterprise Agent Platform.

VertexPairWiseStringEvaluator

VertexStringEvaluator


Other Google products

Integrations with various Google services beyond the core Cloud Platform.

Document loaders

Google Drive

Load files from Google Drive. Currently supports Google Docs.

Retrievers

Google Drive

Retrieve documents from Google Drive.

Tools

Google Search

Web search via Google Custom Search Engine (CSE).

Google Drive

Interact with Google Drive.

MCP

MCP Toolbox

Connect to databases including Cloud SQL and AlloyDB.

Toolkits

Gmail

Create, search, and send emails via the Gmail API.


3rd party integrations

Access Google services via unofficial third-party APIs.

cloro

Google Search results with AI Overview support.