langchain-google-genai 4.0.0, this package uses the consolidated google-genai SDK and now supports both the Gemini Developer API and Vertex AI backends.The langchain-google-vertexai package remains supported for Vertex AI platform-specific features (Model Garden, Vector Search, evaluation services, etc.).Read the full announcement and migration guide.Google Generative AI (Gemini API & Vertex AI)
Google Generative AI (Gemini API & Vertex AI)
- Gemini Developer API: Quick setup with API key, ideal for individual developers and rapid prototyping
- Vertex AI: Enterprise features with Google Cloud integration (requires GCP project)
langchain-google-genai package for chat models, LLMs, and embeddings.See integrations.Google Cloud (Vertex AI Platform Services)
Google Cloud (Vertex AI Platform Services)
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 integrations.Google Generative AI
Access Google Gemini models via the Gemini Developer API or Vertex AI 使用 unifiedlangchain-google-genai 包。
聊天模型
ChatGoogleGenerativeAI
大语言模型 (LLM)
GoogleGenerativeAI
向量嵌入模型
GoogleGenerativeAIEmbeddings
Google Cloud
Access Vertex AI platform-specific services including Model Garden (Llama, Mistral, Anthropic), Vector Search, evaluation services, and specialized vision models.ChatGoogleGenerativeAI from langchain-google-genai. The classes below focus on Vertex AI platform services not available in the consolidated SDK.聊天模型
ChatAnthropicVertex
ChatVertexAI (deprecated)
ChatVertexAI (deprecated)
ChatGoogleGenerativeAI for Gemini models instead.VertexModelGardenLlama
VertexModelGardenLlama
VertexModelGardenMistral
VertexModelGardenMistral
GemmaChatLocalHF
GemmaChatLocalHF
GemmaChatLocalKaggle
GemmaChatLocalKaggle
GemmaChatVertexAIModelGarden
GemmaChatVertexAIModelGarden
VertexAIImageCaptioningChat
VertexAIImageCaptioningChat
VertexAIImageEditorChat
VertexAIImageEditorChat
VertexAIImageGeneratorChat
VertexAIImageGeneratorChat
VertexAIVisualQnAChat
VertexAIVisualQnAChat
大语言模型 (LLM)
(Legacy) string-in, string-out LLM interface.VertexAIModelGarden
VertexAI (deprecated)
VertexAI (deprecated)
GoogleGenerativeAI for Gemini models instead.Gemma local from Hugging Face
Gemma local from Hugging Face
Gemma local from Kaggle
Gemma local from Kaggle
Gemma on Vertex AI Model Garden
Gemma on Vertex AI Model Garden
Vertex AI image captioning
Vertex AI image captioning
向量嵌入模型
VertexAIEmbeddings (deprecated)
VertexAIEmbeddings (deprecated)
GoogleGenerativeAIEmbeddings instead.文档加载器
AlloyDB for PostgreSQL
BigQuery
Bigtable
Cloud SQL for MySQL
Cloud SQL for SQL Server
Cloud SQL for PostgreSQL
Cloud Storage (directory)
Cloud Storage (file)
El Carro for Oracle Workloads
Firestore (Native Mode)
Firestore (Datastore Mode)
Memorystore for Redis
Spanner
Speech-to-Text
Cloud Vision loader
Cloud Vision loader
文档转换器
Document AI
Google Translate
向量存储
Store and search vectors using Google Cloud databases and Vertex AI Vector Search.AlloyDB for PostgreSQL
BigQuery Vector Search
Memorystore for Redis
Spanner
Bigtable
Firestore (Native Mode)
Cloud SQL for MySQL
Cloud SQL for PostgreSQL
Vertex AI Vector Search
Vertex AI Vector Search + Datastore
检索器
Vertex AI Search
Document AI Warehouse
工具
Integrate agents with various Google Cloud services.Text-to-Speech
回调
Track LLM/Chat model usage.Vertex AI callback handler
Vertex AI callback handler
VertexAI usage info.Google BigQuery
Google BigQuery
Evaluators
Evaluate model outputs using Vertex AI.VertexPairWiseStringEvaluator
VertexPairWiseStringEvaluator
VertexStringEvaluator
VertexStringEvaluator

