本页还没有译文
本页 84 段还没译成简体中文,下面显示的是英文原文。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)
Access Google Gemini models via the Gemini Developer API or Gemini Enterprise Agent Platform. The backend is selected automatically based on your configuration.
- Gemini Developer API: Quick setup with API key, ideal for individual developers and rapid prototyping
- Gemini Enterprise Agent Platform: Enterprise features with Google Cloud integration (requires GCP project)
Use the langchain-google-genai package for chat models, LLMs, and embeddings.
Google Cloud (Gemini Enterprise Agent Platform Services)
Access Gemini Enterprise Agent Platform-specific services beyond Gemini models: Model Garden (Llama, Mistral, Anthropic), evaluation services, and specialized vision models.
Use the langchain-google-vertexai package for platform services and specific packages (e.g., langchain-google-community, langchain-google-cloud-sql-pg) for other cloud services like databases and storage.
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
Google Gemini chat models via Gemini Developer API or Gemini Enterprise Agent Platform.
LLMs
Gemini models using the (legacy) LLM text completion interface.
Embedding models
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
Anthropic on Gemini Enterprise Agent Platform Model Garden
ChatVertexAI (deprecated)
Deprecated—Use ChatGoogleGenerativeAI for Gemini models instead.
from langchain_google_vertexai import ChatVertexAIVertexModelGardenLlama
Llama on Gemini Enterprise Agent Platform Model Garden
from langchain_google_vertexai.model_garden_maas.llama import VertexModelGardenLlamaVertexModelGardenMistral
Mistral on Gemini Enterprise Agent Platform Model Garden
from langchain_google_vertexai.model_garden_maas.mistral import VertexModelGardenMistralGemmaChatLocalHF
Local Gemma model loaded from HuggingFace.
from langchain_google_vertexai.gemma import GemmaChatLocalHFGemmaChatLocalKaggle
Local Gemma model loaded from Kaggle.
from langchain_google_vertexai.gemma import GemmaChatLocalKaggleGemmaChatVertexAIModelGarden
Gemma on Gemini Enterprise Agent Platform Model Garden
from langchain_google_vertexai.gemma import GemmaChatVertexAIModelGardenVertexAIImageCaptioningChat
Image captioning model as a chat interface.
from langchain_google_vertexai.vision_models import VertexAIImageCaptioningChatVertexAIImageEditorChat
Edit images given a prompt. Currently supports mask-free editing only.
from langchain_google_vertexai.vision_models import VertexAIImageEditorChatVertexAIImageGeneratorChat
Generate images from a prompt.
from langchain_google_vertexai.vision_models import VertexAIImageGeneratorChatVertexAIVisualQnAChat
Visual question answering model as a chat interface.
from langchain_google_vertexai.vision_models import VertexAIVisualQnAChatLLMs
(Legacy) string-in, string-out LLM interface.
Hundreds of OSS models via Gemini Enterprise Agent Platform Model Garden.
VertexAI (deprecated)
Deprecated—Use GoogleGenerativeAI for Gemini models instead.
from langchain_google_vertexai import VertexAIGemma local from Hugging Face
Local Gemma model loaded from HuggingFace.
from langchain_google_vertexai.gemma import GemmaLocalHFGemma local from Kaggle
Local Gemma model loaded from Kaggle.
from langchain_google_vertexai.gemma import GemmaLocalKaggleGemma on Gemini Enterprise Agent Platform Model Garden
from langchain_google_vertexai.gemma import GemmaVertexAIModelGardenGemini Enterprise Agent Platform image captioning
Image captioning model as an LLM interface.
from langchain_google_vertexai.vision_models import VertexAIImageCaptioningEmbedding models
VertexAIEmbeddings (deprecated)
Deprecated—Use GoogleGenerativeAIEmbeddings instead.
from langchain_google_vertexai import VertexAIEmbeddingsDocument loaders
PostgreSQL-compatible database on Google Cloud.
Serverless data warehouse.
Key-value and wide-column store for structured and semi-structured data.
Managed MySQL database.
Managed SQL Server database.
Managed PostgreSQL database.
Load documents from a GCS bucket directory.
Load a single document from GCS.
Oracle databases on Kubernetes via El Carro.
NoSQL document database.
Firestore in Datastore mode.
Managed Redis service.
Globally distributed relational database.
Transcribe audio files.
Cloud Vision loader
Load data using Google Cloud Vision API.
from langchain_google_community.vision import CloudVisionLoaderDocument transformers
Extract structured data from unstructured documents.
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.
PostgreSQL-compatible vector store on AlloyDB.
Semantic search using GoogleSQL with vector indexes.
Vector store on Memorystore for Redis.
Vector store on Cloud Spanner.
Vector store on Cloud Bigtable.
Vector store on Firestore.
Vector store on Cloud SQL for MySQL.
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.
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 VertexAISearchSummaryToolTools
Integrate agents with various Google Cloud services.
Synthesize natural-sounding speech with 100+ voices.
Callbacks
Track LLM/Chat model usage.
Gemini Enterprise Agent Platform callback handler
Track VertexAI usage info.
from langchain_google_vertexai.callbacks import VertexAICallbackHandlerGoogle BigQuery
See the documentation for more details.
from langchain_google_community.callbacks.bigquery_callback import BigQueryCallbackHandlerEvaluators
Evaluate model outputs using Gemini Enterprise Agent Platform.
VertexPairWiseStringEvaluator
Pair-wise evaluation using Gemini Enterprise Agent Platform models.
from langchain_google_vertexai.evaluators.evaluation import VertexPairWiseStringEvaluatorVertexStringEvaluator
Single prediction evaluation using Gemini Enterprise Agent Platform models.
from langchain_google_vertexai.evaluators.evaluation import VertexStringEvaluatorOther Google products
Integrations with various Google services beyond the core Cloud Platform.
Document loaders
Load files from Google Drive. Currently supports Google Docs.
Retrievers
Retrieve documents from Google Drive.
Tools
Web search via Google Custom Search Engine (CSE).
Interact with Google Drive.
MCP
Connect to databases including Cloud SQL and AlloyDB.
Toolkits
Create, search, and send emails via the Gmail API.
3rd party integrations
Access Google services via unofficial third-party APIs.
Search
Google Search results with AI Overview support.