Skip to main content

谷歌

谷歌云平台及其他谷歌产品相关的所有功能。

聊天模型

我们建议个人开发者从Gemini API(langchain-google-genai)开始,当他们需要访问商业支持和更高的速率限制时,再转向Vertex AI(langchain-google-vertexai)。如果您已经是云友好或云原生的,那么您可以直接在Vertex AI中开始。 有关更多信息,请参见这里

谷歌生成式AI

通过ChatGoogleGenerativeAI类访问谷歌AI Gemini模型,如gemini-progemini-pro-vision

pip install -U langchain-google-genai

配置您的API密钥。

export GOOGLE_API_KEY=your-api-key
from langchain_google_genai import ChatGoogleGenerativeAI

llm = ChatGoogleGenerativeAI(model="gemini-pro")
llm.invoke("Sing a ballad of LangChain.")

Gemini视觉模型在提供单个聊天消息时支持图像输入。

from langchain_core.messages import HumanMessage
from langchain_google_genai import ChatGoogleGenerativeAI

llm = ChatGoogleGenerativeAI(model="gemini-pro-vision")

message = HumanMessage(
content=[
{
"type": "text",
"text": "What's in this image?",
}, # You can optionally provide text parts
{"type": "image_url", "image_url": "https://picsum.photos/seed/picsum/200/300"},
]
)
llm.invoke([message])

image_url的值可以是以下任意一种:

  • 一个公共图像URL
  • 一个gcs文件(例如,"gcs://path/to/file.png")
  • 一个本地文件路径
  • 一个base64编码的图像(例如,data:image/png;base64,abcd124)
  • 一个PIL图像

Vertex AI

通过Google Cloud访问聊天模型,如Gemini

我们需要安装 langchain-google-vertexai Python 包。

pip install langchain-google-vertexai

查看 使用示例

from langchain_google_vertexai import ChatVertexAI

在 Vertex AI 模型库上聊天 Anthropic

查看 使用示例

from langchain_google_vertexai.model_garden import ChatAnthropicVertex

在 Vertex AI 模型库上聊天 Llama

from langchain_google_vertexai.model_garden_maas.llama import VertexModelGardenLlama

在 Vertex AI 模型库上聊天 Mistral

from langchain_google_vertexai.model_garden_maas.mistral import VertexModelGardenMistral

从 Hugging Face 本地聊天 Gemma

HuggingFace 加载的本地 Gemma 模型。

我们需要安装 langchain-google-vertexai Python 包。

pip install langchain-google-vertexai
from langchain_google_vertexai.gemma import GemmaChatLocalHF

从 Kaggle 本地聊天 Gemma

本地 Gemma 模型已从 Kaggle 加载。

我们需要安装 langchain-google-vertexai python 包。

pip install langchain-google-vertexai
from langchain_google_vertexai.gemma import GemmaChatLocalKaggle

在 Vertex AI 模型库上聊天 Gemma

我们需要安装 langchain-google-vertexai python 包。

pip install langchain-google-vertexai
from langchain_google_vertexai.gemma import GemmaChatVertexAIModelGarden

Vertex AI 图像描述聊天

图像描述模型 实现为聊天。

我们需要安装 langchain-google-vertexai python 包。

pip install langchain-google-vertexai
from langchain_google_vertexai.vision_models import VertexAIImageCaptioningChat

Vertex AI 图像编辑器聊天

给定一张图像和一个提示,编辑该图像。目前仅支持无遮罩编辑。

我们需要安装 langchain-google-vertexai python 包。

pip install langchain-google-vertexai
from langchain_google_vertexai.vision_models import VertexAIImageEditorChat

Vertex AI 图像生成聊天

从提示生成图像。

我们需要安装 langchain-google-vertexai Python 包。

pip install langchain-google-vertexai
from langchain_google_vertexai.vision_models import VertexAIImageGeneratorChat

Vertex AI 视觉问答聊天

视觉问答模型的聊天实现

我们需要安装 langchain-google-vertexai Python 包。

pip install langchain-google-vertexai
from langchain_google_vertexai.vision_models import VertexAIVisualQnAChat

大型语言模型

谷歌生成式 AI

通过 GoogleGenerativeAI 类访问 GoogleAI Gemini 模型,如 gemini-progemini-pro-vision

安装 Python 包。

pip install langchain-google-genai

查看 使用示例

from langchain_google_genai import GoogleGenerativeAI

Vertex AI 模型花园

通过 Vertex AI 模型花园 服务访问 PaLM 和数百个开源模型。

我们需要安装 langchain-google-vertexai Python 包。

pip install langchain-google-vertexai

查看 使用示例

from langchain_google_vertexai import VertexAIModelGarden

来自 Hugging Face 的本地 Gemma

HuggingFace 加载的本地 Gemma 模型。

我们需要安装 langchain-google-vertexai Python 包。

pip install langchain-google-vertexai
from langchain_google_vertexai.gemma import GemmaLocalHF

来自 Kaggle 的本地 Gemma

Kaggle 加载的本地 Gemma 模型。

我们需要安装 langchain-google-vertexai Python 包。

pip install langchain-google-vertexai
from langchain_google_vertexai.gemma import GemmaLocalKaggle

Vertex AI 模型花园中的 Gemma

我们需要安装 langchain-google-vertexai Python 包。

pip install langchain-google-vertexai
from langchain_google_vertexai.gemma import GemmaVertexAIModelGarden

Vertex AI 图像描述

图像描述模型 实现为大型语言模型。

我们需要安装 langchain-google-vertexai Python 包。

pip install langchain-google-vertexai
from langchain_google_vertexai.vision_models import VertexAIImageCaptioning

嵌入模型

Google 生成式 AI 嵌入

查看 使用示例

pip install -U langchain-google-genai

配置您的 API 密钥。

export GOOGLE_API_KEY=your-api-key
from langchain_google_genai import GoogleGenerativeAIEmbeddings

Google 生成式 AI 服务器端嵌入

安装 python 包:

pip install langchain-google-genai
from langchain_google_genai.google_vector_store import ServerSideEmbedding

Vertex AI

我们需要安装 langchain-google-vertexai python 包。

pip install langchain-google-vertexai

查看 使用示例

from langchain_google_vertexai import VertexAIEmbeddings

Palm 嵌入

我们需要安装 langchain-community python 包。

pip install langchain-community
from langchain_community.embeddings.google_palm import GooglePalmEmbeddings

文档加载器

AlloyDB for PostgreSQL

Google Cloud AlloyDB 是一个完全托管的关系数据库服务,提供高性能、无缝集成和令人印象深刻的可扩展性,运行在 Google Cloud 上。AlloyDB 与 PostgreSQL 100% 兼容。

安装 Python 包:

pip install langchain-google-alloydb-pg

查看 使用示例

from langchain_google_alloydb_pg import AlloyDBEngine, AlloyDBLoader

BigQuery

Google Cloud BigQuery 是一个无服务器且具有成本效益的企业数据仓库,能够跨云工作并随着您在 Google Cloud 中的数据规模扩展。

我们需要安装带有 Big Query 依赖项的 langchain-google-community

pip install langchain-google-community[bigquery]

查看 使用示例

from langchain_google_community import BigQueryLoader

Bigtable

Google Cloud Bigtable 是 Google 在 Google Cloud 中完全托管的 NoSQL 大数据数据库服务。

安装 Python 包:

pip install langchain-google-bigtable

查看 Google Cloud 使用示例

from langchain_google_bigtable import BigtableLoader

Cloud SQL for MySQL

Google Cloud SQL for MySQL 是一个完全托管的数据库服务,帮助您在 Google Cloud 上设置、维护、管理和管理您的 MySQL 关系数据库。

安装 python 包:

pip install langchain-google-cloud-sql-mysql

查看 使用示例

from langchain_google_cloud_sql_mysql import MySQLEngine, MySQLLoader

Cloud SQL for SQL Server

Google Cloud SQL for SQL Server 是一个完全托管的数据库服务,帮助您在 Google Cloud 上设置、维护、管理和管理您的 SQL Server 数据库。

安装 python 包:

pip install langchain-google-cloud-sql-mssql

查看 使用示例

from langchain_google_cloud_sql_mssql import MSSQLEngine, MSSQLLoader

Cloud SQL for PostgreSQL

Google Cloud SQL for PostgreSQL 是一个完全托管的数据库服务,帮助您在 Google Cloud 上设置、维护、管理和管理您的 PostgreSQL 关系数据库。

安装 Python 包:

pip install langchain-google-cloud-sql-pg

查看 使用示例

from langchain_google_cloud_sql_pg import PostgresEngine, PostgresLoader

云存储

云存储 是一个用于在 Google Cloud 中存储非结构化数据的托管服务。

我们需要安装带有 Google Cloud Storage 依赖项的 langchain-google-community

pip install langchain-google-community[gcs]

对于 Google Cloud Storage 有两个加载器:DirectoryFile 加载器。

查看 使用示例

from langchain_google_community import GCSDirectoryLoader

查看 使用示例

from langchain_google_community import GCSFileLoader

云视觉加载器

安装 Python 包:

pip install langchain-google-community[vision]
from langchain_google_community.vision import CloudVisionLoader

El Carro 用于 Oracle 工作负载

Google El Carro Oracle 操作符 提供了一种在 Kubernetes 中运行 Oracle 数据库的方法,作为一个可移植的开源、 社区驱动的,无供应商锁定的容器编排系统。

pip install langchain-google-el-carro

请参见 使用示例

from langchain_google_el_carro import ElCarroLoader

Google Drive

Google Drive 是由 Google 开发的文件存储和同步服务。

目前,仅支持 Google Docs

我们需要安装带有 Google Drive 依赖项的 langchain-google-community

pip install langchain-google-community[drive]

请参见 使用示例和授权说明

from langchain_google_community import GoogleDriveLoader

Firestore(原生模式)

Google Cloud Firestore 是一个为自动扩展、高性能和简化应用开发而构建的 NoSQL 文档数据库。

安装 Python 包:

pip install langchain-google-firestore

查看 使用示例

from langchain_google_firestore import FirestoreLoader

Firestore(数据存储模式)

Google Cloud Firestore 在数据存储模式下 是一个为自动扩展、高性能和简化应用开发而构建的 NoSQL 文档数据库。 Firestore 是数据存储的最新版本,并引入了多个改进。

安装 Python 包:

pip install langchain-google-datastore

查看 使用示例

from langchain_google_datastore import DatastoreLoader

Redis 的 Memorystore

Google Cloud Memorystore for Redis 是 Google Cloud 的完全托管的 Redis 服务。运行在 Google Cloud 上的应用程序可以通过利用高度可扩展、可用、安全的 Redis 服务,达到极高的性能,而无需管理复杂的 Redis 部署。

安装 Python 包:

pip install langchain-google-memorystore-redis

查看 使用示例

from langchain_google_memorystore_redis import MemorystoreDocumentLoader

Spanner

Google Cloud Spanner 是 Google Cloud 上完全托管的、关键任务的关系数据库服务,提供全球范围内的事务一致性、高可用性的自动同步复制,并支持两种 SQL 方言:GoogleSQL(带扩展的 ANSI 2011)和 PostgreSQL。

安装 Python 包:

pip install langchain-google-spanner

查看 使用示例

from langchain_google_spanner import SpannerLoader

语音转文本

Google Cloud Speech-to-Text 是一个音频转录 API,由 Google Cloud 中的语音识别模型提供支持。

此文档加载器将音频文件转录并将文本结果输出为文档。

首先,我们需要安装带有语音转文本依赖的 langchain-google-community

pip install langchain-google-community[speech]

查看用法示例和授权说明

from langchain_google_community import SpeechToTextLoader

文档转换器

文档 AI

Google Cloud Document AI 是一个 Google Cloud 服务,将文档中的非结构化数据转换为结构化数据,使其更易于 理解、分析和使用。

我们需要设置一个GCS 存储桶并创建自己的 OCR 处理器 GCS_OUTPUT_PATH 应该是 GCS 上一个文件夹的路径(以 gs:// 开头) 处理器名称应类似于 projects/PROJECT_NUMBER/locations/LOCATION/processors/PROCESSOR_ID。 我们可以通过编程方式获取,或者从 Processor detailsPrediction endpoint 部分复制。 在 Google Cloud 控制台的选项卡中。

pip install langchain-google-community[docai]

查看 使用示例

from langchain_core.document_loaders.blob_loaders import Blob
from langchain_google_community import DocAIParser

谷歌翻译

谷歌翻译 是一个多语言神经机器 翻译服务,由谷歌开发,用于翻译文本、文档和网站 从一种语言翻译成另一种语言。

GoogleTranslateTransformer 允许您使用 Google Cloud Translation API 翻译文本和 HTML。

首先,我们需要安装带有翻译依赖项的 langchain-google-community

pip install langchain-google-community[translate]

查看 使用示例和授权说明

from langchain_google_community import GoogleTranslateTransformer

向量存储

AlloyDB for PostgreSQL

Google Cloud AlloyDB 是一个完全托管的关系数据库服务,提供高性能、无缝集成和令人印象深刻的可扩展性,运行在 Google Cloud 上。AlloyDB 与 PostgreSQL 100% 兼容。

安装 Python 包:

pip install langchain-google-alloydb-pg

查看 使用示例

from langchain_google_alloydb_pg import AlloyDBEngine, AlloyDBVectorStore

BigQuery 向量搜索

Google Cloud BigQuery, BigQuery 是 Google Cloud 中一个无服务器且具有成本效益的企业数据仓库。

Google Cloud BigQuery 向量搜索 BigQuery 向量搜索让您可以使用 GoogleSQL 进行语义搜索,使用向量索引以获得快速但近似的结果,或使用暴力搜索以获得精确结果。

它可以计算欧几里得距离或余弦距离。使用 LangChain 时,我们默认使用欧几里得距离。

我们需要安装几个 Python 包。

pip install google-cloud-bigquery

查看 使用示例

from langchain.vectorstores import BigQueryVectorSearch

Redis 的 Memorystore

Google Cloud Redis 的 Memorystore 是 Google Cloud 的完全托管 Redis 服务。在 Google Cloud 上运行的应用程序可以通过利用高度可扩展、可用、安全的 Redis 服务来实现极高的性能,而无需管理复杂的 Redis 部署。

安装 Python 包:

pip install langchain-google-memorystore-redis

查看 使用示例

from langchain_google_memorystore_redis import RedisVectorStore

Spanner

Google Cloud Spanner 是 Google Cloud 上的完全托管、关键任务的关系数据库服务,提供全球范围内的事务一致性、高可用性的自动同步复制,并支持两种 SQL 方言:GoogleSQL(带扩展的 ANSI 2011)和 PostgreSQL。

安装 Python 包:

pip install langchain-google-spanner

查看 使用示例

from langchain_google_spanner import SpannerVectorStore

Firestore(原生模式)

Google Cloud Firestore 是一个为自动扩展、高性能和简化应用开发而构建的 NoSQL 文档数据库。

安装 Python 包:

pip install langchain-google-firestore

查看 使用示例

from langchain_google_firestore import FirestoreVectorStore

Cloud SQL for MySQL

Google Cloud SQL for MySQL 是一个完全托管的数据库服务,帮助您在 Google Cloud 上设置、维护、管理和管理 MySQL 关系数据库。

安装 Python 包:

pip install langchain-google-cloud-sql-mysql

查看 使用示例

from langchain_google_cloud_sql_mysql import MySQLEngine, MySQLVectorStore

Cloud SQL for PostgreSQL

Google Cloud SQL for PostgreSQL 是一个完全托管的数据库服务,帮助您在 Google Cloud 上设置、维护、管理和管理您的 PostgreSQL 关系数据库。

安装 python 包:

pip install langchain-google-cloud-sql-pg

查看 使用示例

from langchain_google_cloud_sql_pg import PostgresEngine, PostgresVectorStore

Vertex AI 向量搜索

Google Cloud Vertex AI 向量搜索 来自 Google Cloud, 以前称为 Vertex AI Matching Engine,提供行业领先的高规模 低延迟向量数据库。这些向量数据库通常 被称为向量相似性匹配或近似最近邻 (ANN) 服务。

安装 python 包:

pip install langchain-google-vertexai

查看 使用示例

from langchain_google_vertexai import VectorSearchVectorStore

Vertex AI 向量搜索与数据存储

使用 DatasTore 文档存储的向量搜索。

安装 Python 包:

pip install langchain-google-vertexai

查看 使用示例

from langchain_google_vertexai import VectorSearchVectorStoreDatastore

VectorSearchVectorStoreGCS

为了一致性,VectorSearchVectorStore 的别名 与其他具有不同文档存储后端的向量存储保持一致。

安装 Python 包:

pip install langchain-google-vertexai
from langchain_google_vertexai import VectorSearchVectorStoreGCS

Google 生成式 AI 向量存储

目前,它在服务器端计算嵌入向量。 欲了解更多信息,请访问 指南

安装 python 包:

pip install langchain-google-genai
from langchain_google_genai.google_vector_store import GoogleVectorStore

ScaNN

Google ScaNN (可扩展最近邻) 是一个 python 包。

ScaNN 是一种高效的向量相似性搜索方法,适用于大规模数据。

ScaNN 包括搜索空间修剪和量化,以实现最大内积 产品搜索,并且还支持其他距离函数,例如 欧几里得距离。该实现针对x86处理器进行了优化 支持AVX2。有关更多详细信息,请参见其Google Research github 了解更多信息。

我们需要安装scann python包。

pip install scann

请参见使用示例

from langchain_community.vectorstores import ScaNN

检索器

Google Drive

我们需要安装几个python包。

pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib langchain-googledrive

请参见使用示例和授权说明

from langchain_googledrive.retrievers import GoogleDriveRetriever

Vertex AI 搜索

Vertex AI Search 来自 Google Cloud 的服务,允许开发者快速为客户和员工构建生成式 AI 驱动的搜索引擎。

查看 使用示例

注意:GoogleVertexAISearchRetriever 已被弃用,请使用 VertexAIMultiTurnSearchRetrieverVertexAISearchSummaryToolVertexAISearchRetriever(见下文)。 VertexAISearchSummaryToolVertexAISearchRetriever(见下文)。

GoogleVertexAISearchRetriever

我们需要安装 google-cloud-discoveryengine python 包。

pip install google-cloud-discoveryengine
from langchain_community.retrievers import GoogleVertexAISearchRetriever

VertexAIMultiTurnSearchRetriever

from langchain_google_community import VertexAIMultiTurnSearchRetriever

VertexAISearchRetriever

from langchain_google_community import VertexAIMultiTurnSearchRetriever

VertexAISearchSummaryTool

from langchain_google_community import VertexAISearchSummaryTool

文档 AI 仓库

文档 AI 仓库 来自 Google Cloud 的服务,允许企业在单一平台上搜索、存储、管理文档及其 AI 提取的数据和元数据。 数据和元数据在一个平台上管理。

注意:GoogleDocumentAIWarehouseRetriever 已被弃用,请使用 DocumentAIWarehouseRetriever(见下文)。

from langchain.retrievers import GoogleDocumentAIWarehouseRetriever
docai_wh_retriever = GoogleDocumentAIWarehouseRetriever(
project_number=...
)
query = ...
documents = docai_wh_retriever.invoke(
query, user_ldap=...
)
from langchain_google_community.documentai_warehouse import DocumentAIWarehouseRetriever

工具

语音合成

Google Cloud 语音合成 是一个 Google Cloud 服务,使开发者能够 合成自然听起来的语音,提供 100 多种声音,支持多种语言和变体。 它应用了 DeepMind 在 WaveNet 方面的突破性研究和 Google 强大的神经网络。 以提供尽可能高的保真度。

我们需要安装一些Python包。

pip install google-cloud-text-to-speech langchain-google-community

请查看用法示例和授权说明

from langchain_google_community import TextToSpeechTool

Google Drive

我们需要安装几个Python包。

pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib
pip install langchain-googledrive

请查看用法示例和授权说明

from langchain_googledrive.utilities.google_drive import GoogleDriveAPIWrapper
from langchain_googledrive.tools.google_drive.tool import GoogleDriveSearchTool

Google Finance

我们需要安装一个Python包。

pip install google-search-results

请查看用法示例和授权说明

from langchain_community.tools.google_finance import GoogleFinanceQueryRun
from langchain_community.utilities.google_finance import GoogleFinanceAPIWrapper

Google Jobs

我们需要安装一个Python包。

pip install google-search-results

查看用法示例和授权说明

from langchain_community.tools.google_jobs import GoogleJobsQueryRun
from langchain_community.utilities.google_finance import GoogleFinanceAPIWrapper

Google Lens

查看用法示例和授权说明

from langchain_community.tools.google_lens import GoogleLensQueryRun
from langchain_community.utilities.google_lens import GoogleLensAPIWrapper

Google Places

我们需要安装一个Python包。

pip install googlemaps

查看用法示例和授权说明

from langchain.tools import GooglePlacesTool

Google Scholar

我们需要安装一个Python包。

pip install google-search-results

查看用法示例和授权说明

from langchain_community.tools.google_scholar import GoogleScholarQueryRun
from langchain_community.utilities.google_scholar import GoogleScholarAPIWrapper

谷歌搜索

  • 按照这些说明设置自定义搜索引擎
  • 从上一步获取API密钥和自定义搜索引擎ID,并将它们设置为环境变量 GOOGLE_API_KEYGOOGLE_CSE_ID分别。
from langchain_google_community import GoogleSearchAPIWrapper

有关此包装器的更详细的操作指南,请参见此笔记本

我们可以轻松地将此包装器加载为工具(与代理一起使用)。我们可以这样做:

from langchain.agents import load_tools
tools = load_tools(["google-search"])

GoogleSearchResults

查询Google Search API(通过GoogleSearchAPIWrapper)并返回JSON的工具。

from langchain_community.tools import GoogleSearchResults

GoogleSearchRun

查询Google Search API(通过GoogleSearchAPIWrapper)的工具。

from langchain_community.tools import GoogleSearchRun

谷歌趋势

我们需要安装一个python包。

pip install google-search-results

查看使用示例和授权说明

from langchain_community.tools.google_trends import GoogleTrendsQueryRun
from langchain_community.utilities.google_trends import GoogleTrendsAPIWrapper

工具包

Gmail

谷歌 Gmail 是谷歌提供的免费电子邮件服务。 该工具包通过 Gmail API 处理电子邮件。

我们需要安装 langchain-google-community 及其所需依赖:

pip install langchain-google-community[gmail]

查看使用示例和授权说明

from langchain_google_community import GmailToolkit

Gmail 单个工具

您可以使用GMail工具包中的单个工具。

from langchain_google_community.gmail.create_draft import GmailCreateDraft
from langchain_google_community.gmail.get_message import GmailGetMessage
from langchain_google_community.gmail.get_thread import GmailGetThread
from langchain_google_community.gmail.search import GmailSearch
from langchain_google_community.gmail.send_message import GmailSendMessage

内存

AlloyDB for PostgreSQL

AlloyDB for PostgreSQL 是一个完全托管的关系数据库服务,提供高性能、无缝集成和令人印象深刻的可扩展性,运行在Google Cloud上。AlloyDB与PostgreSQL 100%兼容。

安装python包:

pip install langchain-google-alloydb-pg

请参见使用示例

from langchain_google_alloydb_pg import AlloyDBEngine, AlloyDBChatMessageHistory

Cloud SQL for PostgreSQL

Cloud SQL for PostgreSQL 是一个完全托管的数据库服务,帮助您在Google Cloud上设置、维护、管理和管理您的PostgreSQL关系数据库。

安装python包:

pip install langchain-google-cloud-sql-pg

请参见使用示例

from langchain_google_cloud_sql_pg import PostgresEngine, PostgresChatMessageHistory

Cloud SQL for MySQL

Cloud SQL for MySQL 是一个完全托管的数据库服务,帮助您在 Google Cloud 上设置、维护、管理和管理您的 MySQL 关系数据库。

安装 Python 包:

pip install langchain-google-cloud-sql-mysql

查看 使用示例

from langchain_google_cloud_sql_mysql import MySQLEngine, MySQLChatMessageHistory

Cloud SQL for SQL Server

Cloud SQL for SQL Server 是一个完全托管的数据库服务,帮助您在 Google Cloud 上设置、维护、管理和管理您的 SQL Server 数据库。

安装 Python 包:

pip install langchain-google-cloud-sql-mssql

查看 使用示例

from langchain_google_cloud_sql_mssql import MSSQLEngine, MSSQLChatMessageHistory

Spanner

Google Cloud Spanner 是一个完全托管的、关键任务的关系数据库服务,提供全球范围内的事务一致性、高可用性的自动同步复制,并支持两种 SQL 方言:GoogleSQL(ANSI 2011 及扩展)和 PostgreSQL。

安装 Python 包:

pip install langchain-google-spanner

查看 使用示例

from langchain_google_spanner import SpannerChatMessageHistory

Redis 的 Memorystore

Google Cloud Memorystore for Redis 是 Google Cloud 的完全托管 Redis 服务。在 Google Cloud 上运行的应用程序可以利用高度可扩展、可用、安全的 Redis 服务,实现极高的性能,而无需管理复杂的 Redis 部署。

安装 Python 包:

pip install langchain-google-memorystore-redis

查看 使用示例

from langchain_google_memorystore_redis import MemorystoreChatMessageHistory

Bigtable

Google Cloud Bigtable 是 Google 在 Google Cloud 中完全托管的 NoSQL 大数据数据库服务。

安装 Python 包:

pip install langchain-google-bigtable

查看 使用示例

from langchain_google_bigtable import BigtableChatMessageHistory

Firestore(原生模式)

Google Cloud Firestore 是一个为自动扩展、高性能和简化应用开发而构建的 NoSQL 文档数据库。

安装 Python 包:

pip install langchain-google-firestore

查看 使用示例

from langchain_google_firestore import FirestoreChatMessageHistory

Firestore(数据存储模式)

Google Cloud Firestore 在数据存储模式下 是一个为自动扩展、高性能和简化应用开发而构建的 NoSQL 文档数据库。 Firestore 是数据存储的最新版本,并引入了多个改进。

安装 Python 包:

pip install langchain-google-datastore

查看 使用示例

from langchain_google_datastore import DatastoreChatMessageHistory

El Carro:Kubernetes 的 Oracle 操作符

Google El Carro Oracle Operator for Kubernetes 提供了一种在 Kubernetes 中运行 Oracle 数据库的方式,作为一个可移植的开源、 社区驱动的,无供应商锁定的容器编排系统。

pip install langchain-google-el-carro

查看 使用示例

from langchain_google_el_carro import ElCarroChatMessageHistory

回调

Vertex AI 回调处理器

回调处理器,用于跟踪 VertexAI 信息。

我们需要安装 langchain-google-vertexai Python 包。

pip install langchain-google-vertexai
from langchain_google_vertexai.callbacks import VertexAICallbackHandler

聊天加载器

GMail

Gmail 是由 Google 提供的免费电子邮件服务。 该加载器通过 Gmail API 处理电子邮件。

我们需要安装 langchain-google-community 及其依赖项。

pip install langchain-google-community[gmail]

请参见 用法示例和授权说明

from langchain_google_community import GMailLoader

评估器

我们需要安装 langchain-google-vertexai Python 包。

pip install langchain-google-vertexai

VertexPairWiseStringEvaluator

对预测字符串的困惑度进行成对评估。

from langchain_google_vertexai.evaluators.evaluation import VertexPairWiseStringEvaluator

VertexStringEvaluator

评估预测字符串的困惑度。

from langchain_google_vertexai.evaluators.evaluation import VertexPairWiseStringEvaluator

第三方集成

搜索API

搜索API 提供一个第三方API来访问Google搜索结果、YouTube搜索和转录以及其他与Google相关的引擎。

查看使用示例和授权说明

from langchain_community.utilities import SearchApiAPIWrapper

SerpApi

SerpApi 提供一个第三方API来访问Google搜索结果。

查看使用示例和授权说明

from langchain_community.utilities import SerpAPIWrapper

Serper.dev

查看使用示例和授权说明

from langchain_community.utilities import GoogleSerperAPIWrapper

YouTube

YouTube Search 包搜索 YouTube 视频,避免使用其受限的 API。

它使用 YouTube 首页的表单并抓取结果页面。

我们需要安装一个 Python 包。

pip install youtube_search

查看 使用示例

from langchain.tools import YouTubeSearchTool

YouTube 音频

YouTube 是一个由 Google 创建的在线视频分享和社交媒体平台。

使用 YoutubeAudioLoader 获取/下载音频文件。

然后,使用 OpenAIWhisperParser 将其转录为文本。

我们需要安装几个 Python 包。

pip install yt_dlp pydub librosa

查看使用示例和授权说明

from langchain_community.document_loaders.blob_loaders.youtube_audio import YoutubeAudioLoader
from langchain_community.document_loaders.parsers import OpenAIWhisperParser, OpenAIWhisperParserLocal

YouTube 转录

YouTube 是一个由 Google 创建的在线视频分享和社交媒体平台。

我们需要安装 youtube-transcript-api Python 包。

pip install youtube-transcript-api

查看使用示例

from langchain_community.document_loaders import YoutubeLoader

Was this page helpful?


You can also leave detailed feedback on GitHub.

扫我,入群扫我,找书