diff --git a/docs/docs/integrations/document_transformers/docai.ipynb b/docs/docs/integrations/document_transformers/google_docai.ipynb similarity index 100% rename from docs/docs/integrations/document_transformers/docai.ipynb rename to docs/docs/integrations/document_transformers/google_docai.ipynb diff --git a/docs/docs/integrations/platforms/google.mdx b/docs/docs/integrations/platforms/google.mdx index 95bfeccedd00c0..70c3dbd4136f48 100644 --- a/docs/docs/integrations/platforms/google.mdx +++ b/docs/docs/integrations/platforms/google.mdx @@ -2,6 +2,56 @@ All functionality related to [Google Cloud Platform](https://cloud.google.com/) and other `Google` products. +## LLMs + +### Google Generative AI + +Access GoogleAI `Gemini` models such as `gemini-pro` and `gemini-pro-vision` through the `GoogleGenerativeAI` class. + +Install python package. + +```bash +pip install langchain-google-genai +``` + +See a [usage example](/docs/integrations/llms/google_ai). + +```python +from langchain_google_genai import GoogleGenerativeAI +``` + +### Vertex AI + +Access to `Gemini` and `PaLM` LLMs (like `text-bison` and `code-bison`) via `Vertex AI` on Google Cloud. + +We need to install `langchain-google-vertexai` python package. + +```bash +pip install langchain-google-vertexai +``` + +See a [usage example](/docs/integrations/llms/google_vertex_ai_palm). + +```python +from langchain_google_vertexai import VertexAI +``` + +### Model Garden + +Access PaLM and hundreds of OSS models via `Vertex AI Model Garden` on Google Cloud. + +We need to install `langchain-google-vertexai` python package. + +```bash +pip install langchain-google-vertexai +``` + +See a [usage example](/docs/integrations/llms/google_vertex_ai_palm#vertex-model-garden). + +```python +from langchain_google_vertexai import VertexAIModelGarden +``` + ## Chat models ### Google Generative AI @@ -69,502 +119,452 @@ See a [usage example](/docs/integrations/chat/google_vertex_ai_palm). from langchain_google_vertexai import ChatVertexAI ``` -## LLMs +## Document Loaders -### Google Generative AI +### AlloyDB for PostgreSQL -Access GoogleAI `Gemini` models such as `gemini-pro` and `gemini-pro-vision` through the `GoogleGenerativeAI` class. +> [Google Cloud AlloyDB](https://cloud.google.com/alloydb) is a fully managed relational database service that offers high performance, seamless integration, and impressive scalability on Google Cloud. AlloyDB is 100% compatible with PostgreSQL. -Install python package. +Install the python package: ```bash -pip install langchain-google-genai +pip install langchain-google-alloydb-pg ``` -See a [usage example](/docs/integrations/llms/google_ai). +See [usage example](/docs/integrations/document_loaders/google_alloydb). ```python -from langchain_google_genai import GoogleGenerativeAI +from langchain_google_alloydb_pg import AlloyDBEngine, AlloyDBLoader ``` -### Vertex AI +### BigQuery -Access to `Gemini` and `PaLM` LLMs (like `text-bison` and `code-bison`) via `Vertex AI` on Google Cloud. +> [Google Cloud BigQuery](https://cloud.google.com/bigquery) is a serverless and cost-effective enterprise data warehouse that works across clouds and scales with your data in Google Cloud. -We need to install `langchain-google-vertexai` python package. +We need to install `google-cloud-bigquery` python package. ```bash -pip install langchain-google-vertexai +pip install google-cloud-bigquery ``` -See a [usage example](/docs/integrations/llms/google_vertex_ai_palm). +See a [usage example](/docs/integrations/document_loaders/google_bigquery). ```python -from langchain_google_vertexai import VertexAI +from langchain_community.document_loaders import BigQueryLoader ``` -### Model Garden - -Access PaLM and hundreds of OSS models via `Vertex AI Model Garden` on Google Cloud. +### Bigtable -We need to install `langchain-google-vertexai` python package. +> [Google Cloud Bigtable](https://cloud.google.com/bigtable/docs) is Google's fully managed NoSQL Big Data database service in Google Cloud. +Install the python package: ```bash -pip install langchain-google-vertexai +pip install langchain-google-bigtable ``` -See a [usage example](/docs/integrations/llms/google_vertex_ai_palm#vertex-model-garden). +See [Googel Cloud usage example](/docs/integrations/document_loaders/google_bigtable). ```python -from langchain_google_vertexai import VertexAIModelGarden +from langchain_google_bigtable import BigtableLoader ``` -## Vector Stores - -### AlloyDB for PostgreSQL - -> [AlloyDB](https://cloud.google.com/alloydb) is a fully managed relational database service that offers high performance, seamless integration, and impressive scalability on Google Cloud. AlloyDB is 100% compatible with PostgreSQL. +### SQL for MySQL +> [Google Cloud SQL for MySQL](https://cloud.google.com/sql) is a fully-managed database service that helps you set up, maintain, manage, and administer your MySQL relational databases on Google Cloud. Install the python package: ```bash -pip install langchain-google-alloydb-pg +pip install langchain-google-cloud-sql-mysql ``` -See [usage example](/docs/integrations/vectorstores/google_alloydb). +See [usage example](/docs/integrations/document_loaders/google_cloud_sql_mysql). ```python -from langchain_google_alloydb_pg import AlloyDBEngine, AlloyDBVectorStore +from langchain_google_cloud_sql_mysql import MySQLEngine, MySQLDocumentLoader ``` -### Cloud SQL for PostgreSQL +### SQL for SQL Server -> [Cloud SQL for PostgreSQL](https://cloud.google.com/sql) is a fully-managed database service that helps you set up, maintain, manage, and administer your PostgreSQL relational databases on Google Cloud. +> [Google Cloud SQL for SQL Server](https://cloud.google.com/sql) is a fully-managed database service that helps you set up, maintain, manage, and administer your SQL Server databases on Google Cloud. Install the python package: ```bash -pip install langchain-google-cloud-sql-pg +pip install langchain-google-cloud-sql-mssql ``` -See [usage example](docs/docs/integrations/vectorstores/google_cloud_sql_pg). +See [usage example](/docs/integrations/document_loaders/google_cloud_sql_mssql). ```python -from langchain_google_cloud_sql_pg import PostgreSQLEngine, PostgresVectorStore +from langchain_google_cloud_sql_mssql import MSSQLEngine, MSSQLLoader ``` -### Spanner +### SQL for PostgreSQL -> [Spanner](https://cloud.google.com/spanner/docs) is a fully managed, mission-critical, relational database service on Google Cloud that offers transactional consistency at global scale, automatic, synchronous replication for high availability, and support for two SQL dialects: GoogleSQL (ANSI 2011 with extensions) and PostgreSQL. +> [Google Cloud SQL for PostgreSQL](https://cloud.google.com/sql) is a fully-managed database service that helps you set up, maintain, manage, and administer your PostgreSQL relational databases on Google Cloud. Install the python package: ```bash -pip install langchain-google-spanner +pip install langchain-google-cloud-sql-pg ``` -See [usage example](docs/docs/integrations/vectorstores/google_spanner). +See [usage example](/docs/integrations/document_loaders/google_cloud_sql_pg). ```python -from langchain_google_spanner import SpannerVectorStore +from langchain_google_cloud_sql_pg import PostgreSQLEngine, PostgreSQLLoader ``` -### Memorystore for Redis - -> [Memorystore for Redis](https://cloud.google.com/memorystore/docs/redis) is a fully managed Redis service for Google Cloud. Applications running on Google Cloud can achieve extreme performance by leveraging the highly scalable, available, secure Redis service without the burden of managing complex Redis deployments. -Install the python package: +### Cloud Storage -```bash -pip install langchain-google-memorystore-redis -``` +>[Cloud Storage](https://en.wikipedia.org/wiki/Google_Cloud_Storage) is a managed service for storing unstructured data in Google Cloud. -See [usage example](docs/docs/integrations/vectorstores/google_memorystore_redis). +We need to install `google-cloud-storage` python package. -```python -from langchain_google_memorystore_redis import RedisVectorStore +```bash +pip install google-cloud-storage ``` -### Vertex AI Vector Search - -> [Vertex AI Vector Search](https://cloud.google.com/vertex-ai/docs/matching-engine/overview) from Google Cloud, -> 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. +There are two loaders for the `Google Cloud Storage`: the `Directory` and the `File` loaders. -We need to install several python packages. +See a [usage example](/docs/integrations/document_loaders/google_cloud_storage_directory). -```bash -pip install tensorflow langchain-google-vertexai tensorflow-hub tensorflow-text +```python +from langchain_community.document_loaders import GCSDirectoryLoader ``` - -See a [usage example](/docs/integrations/vectorstores/google_vertex_ai_vector_search). +See a [usage example](/docs/integrations/document_loaders/google_cloud_storage_file). ```python -from langchain_community.vectorstores import MatchingEngine +from langchain_community.document_loaders import GCSFileLoader ``` -### BigQuery +### Google Drive -> [BigQuery](https://cloud.google.com/bigquery), -> BigQuery is a serverless and cost-effective enterprise data warehouse in Google Cloud. -> -> [BigQuery Vector Search](https://cloud.google.com/bigquery/docs/vector-search-intro) -> BigQuery vector search lets you use GoogleSQL to do semantic search, using vector indexes for fast but approximate results, or using brute force for exact results. +>[Google Drive](https://en.wikipedia.org/wiki/Google_Drive) is a file storage and synchronization service developed by Google. -> It can calculate Euclidean or Cosine distance. With LangChain, we default to use Euclidean distance. +Currently, only `Google Docs` are supported. We need to install several python packages. ```bash -pip install google-cloud-bigquery +pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib ``` -See a [usage example](/docs/integrations/vectorstores/bigquery_vector_search). +See a [usage example and authorization instructions](/docs/integrations/document_loaders/google_drive). ```python -from langchain.vectorstores import BigQueryVectorSearch +from langchain_community.document_loaders import GoogleDriveLoader ``` -### Google ScaNN - ->[Google ScaNN](https://github.com/google-research/google-research/tree/master/scann) -> (Scalable Nearest Neighbors) is a python package. -> ->`ScaNN` is a method for efficient vector similarity search at scale. - ->`ScaNN` includes search space pruning and quantization for Maximum Inner -> Product Search and also supports other distance functions such as -> Euclidean distance. The implementation is optimized for x86 processors -> with AVX2 support. See its [Google Research github](https://github.com/google-research/google-research/tree/master/scann) -> for more details. +### Firestore (Native Mode) -We need to install `scann` python package. +> [Google Cloud Firestore](https://cloud.google.com/firestore/docs/) is a NoSQL document database built for automatic scaling, high performance, and ease of application development. +Install the python package: ```bash -pip install scann +pip install langchain-google-firestore ``` -See a [usage example](/docs/integrations/vectorstores/scann). +See [usage example](/docs/integrations/document_loaders/google_firestore). ```python -from langchain_community.vectorstores import ScaNN +from langchain_google_firestore import FirestoreLoader ``` -## Retrievers - -### Google Drive +### Firestore (Datastore Mode) -We need to install several python packages. +> [Google Cloud Firestore in Datastore mode](https://cloud.google.com/datastore/docs) is a NoSQL document database built for automatic scaling, high performance, and ease of application development. +> Firestore is the newest version of Datastore and introduces several improvements over Datastore. +Install the python package: ```bash -pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib +pip install langchain-google-datastore ``` -See a [usage example and authorization instructions](/docs/integrations/retrievers/google_drive). +See [usage example](/docs/integrations/document_loaders/google_datastore). ```python -from langchain_googledrive.retrievers import GoogleDriveRetriever +from langchain_google_datastore import DatastoreLoader ``` -### Vertex AI Search - -> [Vertex AI Search](https://cloud.google.com/generative-ai-app-builder/docs/introduction) -> from Google Cloud allows developers to quickly build generative AI powered search engines for customers and employees. +### Memorystore for Redis -We need to install the `google-cloud-discoveryengine` python package. +> [Google Cloud Memorystore for Redis](https://cloud.google.com/memorystore/docs/redis) is a fully managed Redis service for Google Cloud. Applications running on Google Cloud can achieve extreme performance by leveraging the highly scalable, available, secure Redis service without the burden of managing complex Redis deployments. +Install the python package: ```bash -pip install google-cloud-discoveryengine -``` - -See a [usage example](/docs/integrations/retrievers/google_vertex_ai_search). - -```python -from langchain.retrievers import GoogleVertexAISearchRetriever +pip install langchain-google-memorystore-redis ``` -### Document AI Warehouse - -> [Document AI Warehouse](https://cloud.google.com/document-ai-warehouse) -> from Google Cloud allows enterprises to search, store, govern, and manage documents and their AI-extracted -> data and metadata in a single platform. +See [usage example](/docs/integrations/document_loaders/google_memorystore_redis). ```python -from langchain.retrievers import GoogleDocumentAIWarehouseRetriever -docai_wh_retriever = GoogleDocumentAIWarehouseRetriever( - project_number=... -) -query = ... -documents = docai_wh_retriever.get_relevant_documents( - query, user_ldap=... -) +from langchain_google_memorystore_redis import MemorystoreLoader ``` -## Document Loaders - -### AlloyDB for PostgreSQL - -> [AlloyDB](https://cloud.google.com/alloydb) is a fully managed relational database service that offers high performance, seamless integration, and impressive scalability on Google Cloud. AlloyDB is 100% compatible with PostgreSQL. +### Spanner +> [Google Cloud Spanner](https://cloud.google.com/spanner/docs) is a fully managed, mission-critical, relational database service on Google Cloud that offers transactional consistency at global scale, automatic, synchronous replication for high availability, and support for two SQL dialects: GoogleSQL (ANSI 2011 with extensions) and PostgreSQL. Install the python package: ```bash -pip install langchain-google-alloydb-pg +pip install langchain-google-spanner ``` -See [usage example](/docs/integrations/document_loaders/google_alloydb). +See [usage example](/docs/integrations/document_loaders/google_spanner). ```python -from langchain_google_alloydb_pg import AlloyDBEngine, AlloyDBLoader +from langchain_google_spanner import SpannerLoader ``` -### Cloud SQL for PostgreSQL +### Speech-to-Text -> [Cloud SQL for PostgreSQL](https://cloud.google.com/sql) is a fully-managed database service that helps you set up, maintain, manage, and administer your PostgreSQL relational databases on Google Cloud. -Install the python package: +> [Google Cloud Speech-to-Text](https://cloud.google.com/speech-to-text) is an audio transcription API powered by Google's speech recognition models in Google Cloud. + +This document loader transcribes audio files and outputs the text results as Documents. + +First, we need to install the python package. ```bash -pip install langchain-google-cloud-sql-pg +pip install google-cloud-speech ``` -See [usage example](docs/docs/integrations/document_loaders/google_cloud_sql_pg). +See a [usage example and authorization instructions](/docs/integrations/document_loaders/google_speech_to_text). ```python -from langchain_google_cloud_sql_pg import PostgreSQLEngine, PostgreSQLLoader +from langchain_community.document_loaders import GoogleSpeechToTextLoader ``` -### Cloud SQL for MySQL +## Document Transformers -> [Cloud SQL for MySQL](https://cloud.google.com/sql) is a fully-managed database service that helps you set up, maintain, manage, and administer your MySQL relational databases on Google Cloud. -Install the python package: +### Document AI + +>[Google Cloud Document AI](https://cloud.google.com/document-ai/docs/overview) is a Google Cloud +> service that transforms unstructured data from documents into structured data, making it easier +> to understand, analyze, and consume. + +We need to set up a [`GCS` bucket and create your own OCR processor](https://cloud.google.com/document-ai/docs/create-processor) +The `GCS_OUTPUT_PATH` should be a path to a folder on GCS (starting with `gs://`) +and a processor name should look like `projects/PROJECT_NUMBER/locations/LOCATION/processors/PROCESSOR_ID`. +We can get it either programmatically or copy from the `Prediction endpoint` section of the `Processor details` +tab in the Google Cloud Console. ```bash -pip install langchain-google-cloud-sql-mysql +pip install google-cloud-documentai +pip install google-cloud-documentai-toolbox ``` -See [usage example](docs/docs/integrations/document_loader/cloud_sql_mysql). +See a [usage example](/docs/integrations/document_transformers/google_docai). ```python -from langchain_google_cloud_sql_mysql import MySQLEngine, MySQLDocumentLoader +from langchain_community.document_loaders.blob_loaders import Blob +from langchain_community.document_loaders.parsers import DocAIParser ``` -### Cloud SQL for SQL Server +### Google Translate -> [Cloud SQL for SQL Server](https://cloud.google.com/sql) is a fully-managed database service that helps you set up, maintain, manage, and administer your SQL Server databases on Google Cloud. -Install the python package: +> [Google Translate](https://translate.google.com/) is a multilingual neural machine +> translation service developed by Google to translate text, documents and websites +> from one language into another. + +The `GoogleTranslateTransformer` allows you to translate text and HTML with the [Google Cloud Translation API](https://cloud.google.com/translate). + +To use it, you should have the `google-cloud-translate` python package installed, and a Google Cloud project with the [Translation API enabled](https://cloud.google.com/translate/docs/setup). This transformer uses the [Advanced edition (v3)](https://cloud.google.com/translate/docs/intro-to-v3). + +First, we need to install the python package. ```bash -pip install langchain-google-cloud-sql-mssql +pip install google-cloud-translate ``` -See [usage example](docs/docs/integrations/document_loaders/google_cloud_sql_mssql). +See a [usage example and authorization instructions](/docs/integrations/document_transformers/google_translate). ```python -from langchain_google_cloud_sql_mssql import MSSQLEngine, MSSQLLoader +from langchain_community.document_transformers import GoogleTranslateTransformer ``` -### Bigtable +## Vector Stores + +### AlloyDB for PostgreSQL + +> [Google Cloud AlloyDB](https://cloud.google.com/alloydb) is a fully managed relational database service that offers high performance, seamless integration, and impressive scalability on Google Cloud. AlloyDB is 100% compatible with PostgreSQL. -> [Bigtable](https://cloud.google.com/bigtable/docs) is Google's fully managed NoSQL Big Data database service in Google Cloud. Install the python package: ```bash -pip install langchain-google-bigtable +pip install langchain-google-alloydb-pg ``` -See [usage example](docs/docs/integrations/document_loaders/google_bigtable). +See [usage example](/docs/integrations/vectorstores/google_alloydb). ```python -from langchain_google_bigtable import BigtableLoader +from langchain_google_alloydb_pg import AlloyDBEngine, AlloyDBVectorStore ``` -### Spanner +### BigQuery Vector Search -> [Spanner](https://cloud.google.com/spanner/docs) is a fully managed, mission-critical, relational database service on Google Cloud that offers transactional consistency at global scale, automatic, synchronous replication for high availability, and support for two SQL dialects: GoogleSQL (ANSI 2011 with extensions) and PostgreSQL. -Install the python package: +> [Google Cloud BigQuery](https://cloud.google.com/bigquery), +> BigQuery is a serverless and cost-effective enterprise data warehouse in Google Cloud. +> +> [Google Cloud BigQuery Vector Search](https://cloud.google.com/bigquery/docs/vector-search-intro) +> BigQuery vector search lets you use GoogleSQL to do semantic search, using vector indexes for fast but approximate results, or using brute force for exact results. + +> It can calculate Euclidean or Cosine distance. With LangChain, we default to use Euclidean distance. + +We need to install several python packages. ```bash -pip install langchain-google-spanner +pip install google-cloud-bigquery ``` -See [usage example](docs/docs/integrations/document_loaders/google_spanner). +See a [usage example](/docs/integrations/vectorstores/google_bigquery_vector_search). ```python -from langchain_google_spanner import SpannerLoader +from langchain.vectorstores import BigQueryVectorSearch ``` ### Memorystore for Redis -> [Memorystore for Redis](https://cloud.google.com/memorystore/docs/redis) is a fully managed Redis service for Google Cloud. Applications running on Google Cloud can achieve extreme performance by leveraging the highly scalable, available, secure Redis service without the burden of managing complex Redis deployments. +> [Google Cloud Memorystore for Redis](https://cloud.google.com/memorystore/docs/redis) is a fully managed Redis service for Google Cloud. Applications running on Google Cloud can achieve extreme performance by leveraging the highly scalable, available, secure Redis service without the burden of managing complex Redis deployments. Install the python package: ```bash pip install langchain-google-memorystore-redis ``` -See [usage example](docs/docs/integrations/document_loaders/google_memorystore_redis). +See [usage example](/docs/integrations/vectorstores/google_memorystore_redis). ```python -from langchain_google_memorystore_redis import MemorystoreLoader +from langchain_google_memorystore_redis import RedisVectorStore ``` -### Firestore (Native Mode) +### Spanner -> [Firestore](https://cloud.google.com/firestore/docs/) is a NoSQL document database built for automatic scaling, high performance, and ease of application development. +> [Google Cloud Spanner](https://cloud.google.com/spanner/docs) is a fully managed, mission-critical, relational database service on Google Cloud that offers transactional consistency at global scale, automatic, synchronous replication for high availability, and support for two SQL dialects: GoogleSQL (ANSI 2011 with extensions) and PostgreSQL. Install the python package: ```bash -pip install langchain-google-firestore +pip install langchain-google-spanner ``` -See [usage example](docs/docs/integrations/document_loader/google_firestore). +See [usage example](/docs/integrations/vectorstores/google_spanner). ```python -from langchain_google_firestore import FirestoreLoader +from langchain_google_spanner import SpannerVectorStore ``` -### Firestore in Datastore Mode +### SQL for PostgreSQL -> [Firestore in Datastore mode](https://cloud.google.com/datastore/docs) is a NoSQL document database built for automatic scaling, high performance, and ease of application development. -> Firestore is the newest version of Datastore and introduces several improvements over Datastore. +> [Google Cloud SQL for PostgreSQL](https://cloud.google.com/sql) is a fully-managed database service that helps you set up, maintain, manage, and administer your PostgreSQL relational databases on Google Cloud. Install the python package: ```bash -pip install langchain-google-datastore +pip install langchain-google-cloud-sql-pg ``` -See [usage example](docs/docs/integrations/document_loaders/google_datastore). +See [usage example](/docs/integrations/vectorstores/google_sql_pg). ```python -from langchain_google_datastore import DatastoreLoader +from langchain_google_cloud_sql_pg import PostgreSQLEngine, PostgresVectorStore ``` -### BigQuery +### Vertex AI Vector Search -> [BigQuery](https://cloud.google.com/bigquery) is a serverless and cost-effective enterprise data warehouse that works across clouds and scales with your data in Google Cloud. +> [Google Cloud Vertex AI Vector Search](https://cloud.google.com/vertex-ai/docs/matching-engine/overview) from Google Cloud, +> 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. -We need to install `google-cloud-bigquery` python package. +We need to install several python packages. ```bash -pip install google-cloud-bigquery +pip install tensorflow langchain-google-vertexai tensorflow-hub tensorflow-text ``` -See a [usage example](/docs/integrations/document_loaders/google_bigquery). +See a [usage example](/docs/integrations/vectorstores/google_vertex_ai_vector_search). ```python -from langchain_community.document_loaders import BigQueryLoader +from langchain_community.vectorstores import MatchingEngine ``` -### Cloud Storage +### ScaNN ->[Cloud Storage](https://en.wikipedia.org/wiki/Google_Cloud_Storage) is a managed service for storing unstructured data in Google Cloud. +>[Google ScaNN](https://github.com/google-research/google-research/tree/master/scann) +> (Scalable Nearest Neighbors) is a python package. +> +>`ScaNN` is a method for efficient vector similarity search at scale. -We need to install `google-cloud-storage` python package. +>`ScaNN` includes search space pruning and quantization for Maximum Inner +> Product Search and also supports other distance functions such as +> Euclidean distance. The implementation is optimized for x86 processors +> with AVX2 support. See its [Google Research github](https://github.com/google-research/google-research/tree/master/scann) +> for more details. + +We need to install `scann` python package. ```bash -pip install google-cloud-storage +pip install scann ``` -There are two loaders for the `Google Cloud Storage`: the `Directory` and the `File` loaders. - -See a [usage example](/docs/integrations/document_loaders/google_cloud_storage_directory). +See a [usage example](/docs/integrations/vectorstores/scann). ```python -from langchain_community.document_loaders import GCSDirectoryLoader +from langchain_community.vectorstores import ScaNN ``` -See a [usage example](/docs/integrations/document_loaders/google_cloud_storage_file). -```python -from langchain_community.document_loaders import GCSFileLoader -``` +## Retrievers ### Google Drive ->[Google Drive](https://en.wikipedia.org/wiki/Google_Drive) is a file storage and synchronization service developed by Google. - -Currently, only `Google Docs` are supported. - We need to install several python packages. ```bash pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib ``` -See a [usage example and authorization instructions](/docs/integrations/document_loaders/google_drive). - -```python -from langchain_community.document_loaders import GoogleDriveLoader -``` - -### Speech-to-Text - -> [Speech-to-Text](https://cloud.google.com/speech-to-text) is an audio transcription API powered by Google's speech recognition models in Google Cloud. - -This document loader transcribes audio files and outputs the text results as Documents. - -First, we need to install the python package. - -```bash -pip install google-cloud-speech -``` - -See a [usage example and authorization instructions](/docs/integrations/document_loaders/google_speech_to_text). +See a [usage example and authorization instructions](/docs/integrations/retrievers/google_drive). ```python -from langchain_community.document_loaders import GoogleSpeechToTextLoader +from langchain_googledrive.retrievers import GoogleDriveRetriever ``` -## Document Transformers - -### Document AI +### Vertex AI Search ->[Document AI](https://cloud.google.com/document-ai/docs/overview) is a Google Cloud -> service that transforms unstructured data from documents into structured data, making it easier -> to understand, analyze, and consume. +> [Vertex AI Search](https://cloud.google.com/generative-ai-app-builder/docs/introduction) +> from Google Cloud allows developers to quickly build generative AI powered search engines for customers and employees. -We need to set up a [`GCS` bucket and create your own OCR processor](https://cloud.google.com/document-ai/docs/create-processor) -The `GCS_OUTPUT_PATH` should be a path to a folder on GCS (starting with `gs://`) -and a processor name should look like `projects/PROJECT_NUMBER/locations/LOCATION/processors/PROCESSOR_ID`. -We can get it either programmatically or copy from the `Prediction endpoint` section of the `Processor details` -tab in the Google Cloud Console. +We need to install the `google-cloud-discoveryengine` python package. ```bash -pip install google-cloud-documentai -pip install google-cloud-documentai-toolbox +pip install google-cloud-discoveryengine ``` -See a [usage example](/docs/integrations/document_transformers/docai). +See a [usage example](/docs/integrations/retrievers/google_vertex_ai_search). ```python -from langchain_community.document_loaders.blob_loaders import Blob -from langchain_community.document_loaders.parsers import DocAIParser +from langchain.retrievers import GoogleVertexAISearchRetriever ``` -### Google Translate - -> [Google Translate](https://translate.google.com/) is a multilingual neural machine -> translation service developed by Google to translate text, documents and websites -> from one language into another. - -The `GoogleTranslateTransformer` allows you to translate text and HTML with the [Google Cloud Translation API](https://cloud.google.com/translate). - -To use it, you should have the `google-cloud-translate` python package installed, and a Google Cloud project with the [Translation API enabled](https://cloud.google.com/translate/docs/setup). This transformer uses the [Advanced edition (v3)](https://cloud.google.com/translate/docs/intro-to-v3). - -First, we need to install the python package. - -```bash -pip install google-cloud-translate -``` +### Document AI Warehouse -See a [usage example and authorization instructions](/docs/integrations/document_transformers/google_translate). +> [Document AI Warehouse](https://cloud.google.com/document-ai-warehouse) +> from Google Cloud allows enterprises to search, store, govern, and manage documents and their AI-extracted +> data and metadata in a single platform. ```python -from langchain_community.document_transformers import GoogleTranslateTransformer +from langchain.retrievers import GoogleDocumentAIWarehouseRetriever +docai_wh_retriever = GoogleDocumentAIWarehouseRetriever( + project_number=... +) +query = ... +documents = docai_wh_retriever.get_relevant_documents( + query, user_ldap=... +) ``` ## Tools ### Text-to-Speech ->[Text-to-Speech](https://cloud.google.com/text-to-speech) is a Google Cloud service that enables developers to +>[Google Cloud Text-to-Speech](https://cloud.google.com/text-to-speech) is a Google Cloud service that enables developers to > synthesize natural-sounding speech with 100+ voices, available in multiple languages and variants. > It applies DeepMind’s groundbreaking research in WaveNet and Google’s powerful neural networks > to deliver the highest fidelity possible. @@ -596,39 +596,6 @@ from langchain_community.utilities.google_drive import GoogleDriveAPIWrapper from langchain_community.tools.google_drive.tool import GoogleDriveSearchTool ``` -### Google Places - -We need to install a python package. - -```bash -pip install googlemaps -``` - -See a [usage example and authorization instructions](/docs/integrations/tools/google_places). - -```python -from langchain.tools import GooglePlacesTool -``` - -### Google Search - -- Set up a Custom Search Engine, following [these instructions](https://stackoverflow.com/questions/37083058/programmatically-searching-google-in-python-using-custom-search) -- 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. - -```python -from langchain_community.utilities import GoogleSearchAPIWrapper -``` - -For a more detailed walkthrough of this wrapper, see [this notebook](/docs/integrations/tools/google_search). - -We can easily load this wrapper as a Tool (to use with an Agent). We can do this with: - -```python -from langchain.agents import load_tools -tools = load_tools(["google-search"]) -``` - ### Google Finance We need to install a python package. @@ -668,6 +635,20 @@ from langchain_community.tools.google_lens import GoogleLensQueryRun from langchain_community.utilities.google_lens import GoogleLensAPIWrapper ``` +### Google Places + +We need to install a python package. + +```bash +pip install googlemaps +``` + +See a [usage example and authorization instructions](/docs/integrations/tools/google_places). + +```python +from langchain.tools import GooglePlacesTool +``` + ### Google Scholar We need to install a python package. @@ -683,6 +664,25 @@ from langchain_community.tools.google_scholar import GoogleScholarQueryRun from langchain_community.utilities.google_scholar import GoogleScholarAPIWrapper ``` +### Google Search + +- Set up a Custom Search Engine, following [these instructions](https://stackoverflow.com/questions/37083058/programmatically-searching-google-in-python-using-custom-search) +- 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. + +```python +from langchain_community.utilities import GoogleSearchAPIWrapper +``` + +For a more detailed walkthrough of this wrapper, see [this notebook](/docs/integrations/tools/google_search). + +We can easily load this wrapper as a Tool (to use with an Agent). We can do this with: + +```python +from langchain.agents import load_tools +tools = load_tools(["google-search"]) +``` + ### Google Trends We need to install a python package. @@ -702,7 +702,7 @@ from langchain_community.utilities.google_trends import GoogleTrendsAPIWrapper ### GMail -> [Gmail](https://en.wikipedia.org/wiki/Gmail) is a free email service provided by Google. +> [Google Gmail](https://en.wikipedia.org/wiki/Gmail) is a free email service provided by Google. This toolkit works with emails through the `Gmail API`. We need to install several python packages. @@ -744,7 +744,7 @@ Install the python package: pip install langchain-google-cloud-sql-pg ``` -See [usage example](docs/docs/integrations/memory/google_cloud_sql_pg). +See [usage example](/docs/integrations/memory/google_cloud_sql_pg). ```python @@ -760,7 +760,7 @@ Install the python package: pip install langchain-google-cloud-sql-mysql ``` -See [usage example](docs/docs/integrations/memory/google_cloud_sql_mysql). +See [usage example](/docs/integrations/memory/google_cloud_sql_mysql). ```python from langchain_google_cloud_sql_mysql import MySQLEngine, MySQLChatMessageHistory @@ -775,7 +775,7 @@ Install the python package: pip install langchain-google-cloud-sql-mssql ``` -See [usage example](docs/docs/integrations/memory/google_cloud_sql_mssql). +See [usage example](/docs/integrations/memory/google_cloud_sql_mssql). ```python from langchain_google_cloud_sql_mssql import MSSQLEngine, MSSQLChatMessageHistory @@ -783,14 +783,14 @@ from langchain_google_cloud_sql_mssql import MSSQLEngine, MSSQLChatMessageHistor ### Spanner -> [Spanner](https://cloud.google.com/spanner/docs) is a fully managed, mission-critical, relational database service on Google Cloud that offers transactional consistency at global scale, automatic, synchronous replication for high availability, and support for two SQL dialects: GoogleSQL (ANSI 2011 with extensions) and PostgreSQL. +> [Google Cloud Spanner](https://cloud.google.com/spanner/docs) is a fully managed, mission-critical, relational database service on Google Cloud that offers transactional consistency at global scale, automatic, synchronous replication for high availability, and support for two SQL dialects: GoogleSQL (ANSI 2011 with extensions) and PostgreSQL. Install the python package: ```bash pip install langchain-google-spanner ``` -See [usage example](docs/docs/integrations/memory/google_spanner). +See [usage example](/docs/integrations/memory/google_spanner). ```python from langchain_google_spanner import SpannerChatMessageHistory @@ -798,14 +798,14 @@ from langchain_google_spanner import SpannerChatMessageHistory ### Memorystore for Redis -> [Memorystore for Redis](https://cloud.google.com/memorystore/docs/redis) is a fully managed Redis service for Google Cloud. Applications running on Google Cloud can achieve extreme performance by leveraging the highly scalable, available, secure Redis service without the burden of managing complex Redis deployments. +> [Google Cloud Memorystore for Redis](https://cloud.google.com/memorystore/docs/redis) is a fully managed Redis service for Google Cloud. Applications running on Google Cloud can achieve extreme performance by leveraging the highly scalable, available, secure Redis service without the burden of managing complex Redis deployments. Install the python package: ```bash pip install langchain-google-memorystore-redis ``` -See [usage example](docs/docs/integrations/document_loaders/google_memorystore_redis). +See [usage example](/docs/integrations/document_loaders/google_memorystore_redis). ```python from langchain_google_memorystore_redis import MemorystoreChatMessageHistory @@ -813,14 +813,14 @@ from langchain_google_memorystore_redis import MemorystoreChatMessageHistory ### Bigtable -> [Bigtable](https://cloud.google.com/bigtable/docs) is Google's fully managed NoSQL Big Data database service in Google Cloud. +> [Google Cloud Bigtable](https://cloud.google.com/bigtable/docs) is Google's fully managed NoSQL Big Data database service in Google Cloud. Install the python package: ```bash pip install langchain-google-bigtable ``` -See [usage example](docs/docs/integrations/memory/google_bigtable). +See [usage example](/docs/integrations/memory/google_bigtable). ```python from langchain_google_bigtable import BigtableChatMessageHistory @@ -828,22 +828,22 @@ from langchain_google_bigtable import BigtableChatMessageHistory ### Firestore (Native Mode) -> [Firestore](https://cloud.google.com/firestore/docs/) is a NoSQL document database built for automatic scaling, high performance, and ease of application development. +> [Google Cloud Firestore](https://cloud.google.com/firestore/docs/) is a NoSQL document database built for automatic scaling, high performance, and ease of application development. Install the python package: ```bash pip install langchain-google-firestore ``` -See [usage example](docs/docs/integrations/memory/google_firestore). +See [usage example](/docs/integrations/memory/google_firestore). ```python from langchain_google_firestore import FirestoreChatMessageHistory ``` -### Firestore in Datastore Mode +### Firestore (Datastore Mode) -> [Firestore in Datastore mode](https://cloud.google.com/datastore/docs) is a NoSQL document database built for automatic scaling, high performance, and ease of application development. +> [Google Cloud Firestore in Datastore mode](https://cloud.google.com/datastore/docs) is a NoSQL document database built for automatic scaling, high performance, and ease of application development. > Firestore is the newest version of Datastore and introduces several improvements over Datastore. Install the python package: @@ -851,7 +851,7 @@ Install the python package: pip install langchain-google-datastore ``` -See [usage example](docs/docs/integrations/memory/google_datastore). +See [usage example](/docs/integrations/memory/google_datastore). ```python from langchain_google_datastore import DatastoreChatMessageHistory diff --git a/docs/docs/integrations/vectorstores/google_alloydb.ipynb b/docs/docs/integrations/vectorstores/google_alloydb.ipynb index c467a3aa95b94d..e632e2b34286e4 100644 --- a/docs/docs/integrations/vectorstores/google_alloydb.ipynb +++ b/docs/docs/integrations/vectorstores/google_alloydb.ipynb @@ -6,7 +6,7 @@ "source": [ "# Google AlloyDB for PostgreSQL\n", "\n", - "> [AlloyDB](https://cloud.google.com/alloydb) is a fully managed relational database service that offers high performance, seamless integration, and impressive scalability. AlloyDB is 100% compatible with PostgreSQL. Extend your database application to build AI-powered experiences leveraging AlloyDB's Langchain integrations.\n", + "> [Google Cloud AlloyDB](https://cloud.google.com/alloydb) is a fully managed relational database service that offers high performance, seamless integration, and impressive scalability. AlloyDB is 100% compatible with PostgreSQL. Extend your database application to build AI-powered experiences leveraging AlloyDB's Langchain integrations.\n", "\n", "This notebook goes over how to use `AlloyDB for PostgreSQL` to store vector embeddings with the `AlloyDBVectorStore` class." ] @@ -64,7 +64,6 @@ { "cell_type": "code", "execution_count": null, - "id": "v6jBDnYnNM08", "metadata": { "id": "v6jBDnYnNM08" }, @@ -79,7 +78,6 @@ }, { "cell_type": "markdown", - "id": "yygMe6rPWxHS", "metadata": { "id": "yygMe6rPWxHS" }, @@ -94,7 +92,6 @@ { "cell_type": "code", "execution_count": 1, - "id": "PTXN1_DSXj2b", "metadata": { "id": "PTXN1_DSXj2b" }, @@ -107,7 +104,6 @@ }, { "cell_type": "markdown", - "id": "NEvB9BoLEulY", "metadata": { "id": "NEvB9BoLEulY" }, @@ -125,7 +121,6 @@ { "cell_type": "code", "execution_count": null, - "id": "gfkS3yVRE4_W", "metadata": { "cellView": "form", "id": "gfkS3yVRE4_W" @@ -142,7 +137,6 @@ }, { "cell_type": "markdown", - "id": "rEWWNoNnKOgq", "metadata": { "id": "rEWWNoNnKOgq" }, @@ -154,7 +148,6 @@ { "cell_type": "code", "execution_count": 3, - "id": "5utKIdq7KYi5", "metadata": { "id": "5utKIdq7KYi5" }, @@ -166,7 +159,6 @@ }, { "cell_type": "markdown", - "id": "f8f2830ee9ca1e01", "metadata": { "id": "f8f2830ee9ca1e01" }, @@ -176,7 +168,6 @@ }, { "cell_type": "markdown", - "id": "OMvzMWRrR6n7", "metadata": { "id": "OMvzMWRrR6n7" }, @@ -188,7 +179,6 @@ { "cell_type": "code", "execution_count": 4, - "id": "irl7eMFnSPZr", "metadata": { "id": "irl7eMFnSPZr" }, @@ -204,7 +194,6 @@ }, { "cell_type": "markdown", - "id": "QuQigs4UoFQ2", "metadata": { "id": "QuQigs4UoFQ2" }, @@ -290,7 +279,6 @@ { "cell_type": "code", "execution_count": 3, - "id": "5utKIdq7KYi5", "metadata": { "id": "5utKIdq7KYi5" }, @@ -546,7 +534,8 @@ "toc_visible": true }, "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", + "language": "python", "name": "python3" }, "language_info": { @@ -559,9 +548,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.5" + "version": "3.10.12" } }, "nbformat": 4, - "nbformat_minor": 0 + "nbformat_minor": 4 } diff --git a/docs/docs/integrations/vectorstores/bigquery_vector_search.ipynb b/docs/docs/integrations/vectorstores/google_bigquery_vector_search.ipynb similarity index 95% rename from docs/docs/integrations/vectorstores/bigquery_vector_search.ipynb rename to docs/docs/integrations/vectorstores/google_bigquery_vector_search.ipynb index 403a8d9fbd2b27..19271a92bcdc03 100644 --- a/docs/docs/integrations/vectorstores/bigquery_vector_search.ipynb +++ b/docs/docs/integrations/vectorstores/google_bigquery_vector_search.ipynb @@ -6,8 +6,9 @@ "id": "E_RJy7C1bpCT" }, "source": [ - "# BigQuery Vector Search\n", - "> [**BigQuery Vector Search**](https://cloud.google.com/bigquery/docs/vector-search-intro) lets you use GoogleSQL to do semantic search, using vector indexes for fast approximate results, or using brute force for exact results.\n", + "# Google BigQuery Vector Search\n", + "\n", + "> [Google Cloud BigQuery Vector Search](https://cloud.google.com/bigquery/docs/vector-search-intro) lets you use GoogleSQL to do semantic search, using vector indexes for fast approximate results, or using brute force for exact results.\n", "\n", "\n", "This tutorial illustrates how to work with an end-to-end data and embedding management system in LangChain, and provide scalable semantic search in BigQuery." @@ -349,7 +350,8 @@ "toc_visible": true }, "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", + "language": "python", "name": "python3" }, "language_info": { @@ -362,9 +364,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.0" + "version": "3.10.12" } }, "nbformat": 4, - "nbformat_minor": 0 + "nbformat_minor": 4 } diff --git a/docs/docs/integrations/vectorstores/google_cloud_sql_pg.ipynb b/docs/docs/integrations/vectorstores/google_sql_pg.ipynb similarity index 95% rename from docs/docs/integrations/vectorstores/google_cloud_sql_pg.ipynb rename to docs/docs/integrations/vectorstores/google_sql_pg.ipynb index 404a348c05d003..8051833ee453a2 100644 --- a/docs/docs/integrations/vectorstores/google_cloud_sql_pg.ipynb +++ b/docs/docs/integrations/vectorstores/google_sql_pg.ipynb @@ -4,9 +4,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Google Cloud SQL for PostgreSQL\n", + "# Google SQL for PostgreSQL\n", "\n", - "> [Cloud SQL](https://cloud.google.com/sql) is a fully managed relational database service that offers high performance, seamless integration, and impressive scalability. It offers PostgreSQL, PostgreSQL, and SQL Server database engines. Extend your database application to build AI-powered experiences leveraging Cloud SQL's Langchain integrations.\n", + "> [Google Cloud SQL](https://cloud.google.com/sql) is a fully managed relational database service that offers high performance, seamless integration, and impressive scalability. It offers PostgreSQL, PostgreSQL, and SQL Server database engines. Extend your database application to build AI-powered experiences leveraging Cloud SQL's Langchain integrations.\n", "\n", "This notebook goes over how to use `Cloud SQL for PostgreSQL` to store vector embeddings with the `PostgresVectorStore` class." ] @@ -64,7 +64,6 @@ { "cell_type": "code", "execution_count": null, - "id": "v6jBDnYnNM08", "metadata": { "id": "v6jBDnYnNM08" }, @@ -79,7 +78,6 @@ }, { "cell_type": "markdown", - "id": "yygMe6rPWxHS", "metadata": { "id": "yygMe6rPWxHS" }, @@ -94,7 +92,6 @@ { "cell_type": "code", "execution_count": 1, - "id": "PTXN1_DSXj2b", "metadata": { "id": "PTXN1_DSXj2b" }, @@ -107,7 +104,6 @@ }, { "cell_type": "markdown", - "id": "NEvB9BoLEulY", "metadata": { "id": "NEvB9BoLEulY" }, @@ -125,7 +121,6 @@ { "cell_type": "code", "execution_count": null, - "id": "gfkS3yVRE4_W", "metadata": { "cellView": "form", "id": "gfkS3yVRE4_W" @@ -142,7 +137,6 @@ }, { "cell_type": "markdown", - "id": "rEWWNoNnKOgq", "metadata": { "id": "rEWWNoNnKOgq" }, @@ -154,7 +148,6 @@ { "cell_type": "code", "execution_count": 3, - "id": "5utKIdq7KYi5", "metadata": { "id": "5utKIdq7KYi5" }, @@ -166,7 +159,6 @@ }, { "cell_type": "markdown", - "id": "f8f2830ee9ca1e01", "metadata": { "id": "f8f2830ee9ca1e01" }, @@ -176,7 +168,6 @@ }, { "cell_type": "markdown", - "id": "OMvzMWRrR6n7", "metadata": { "id": "OMvzMWRrR6n7" }, @@ -188,7 +179,6 @@ { "cell_type": "code", "execution_count": 4, - "id": "irl7eMFnSPZr", "metadata": { "id": "irl7eMFnSPZr" }, @@ -203,7 +193,6 @@ }, { "cell_type": "markdown", - "id": "QuQigs4UoFQ2", "metadata": { "id": "QuQigs4UoFQ2" }, @@ -291,7 +280,6 @@ { "cell_type": "code", "execution_count": 3, - "id": "5utKIdq7KYi5", "metadata": { "id": "5utKIdq7KYi5" }, @@ -547,7 +535,8 @@ "toc_visible": true }, "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", + "language": "python", "name": "python3" }, "language_info": { @@ -560,9 +549,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.5" + "version": "3.10.12" } }, "nbformat": 4, - "nbformat_minor": 0 + "nbformat_minor": 4 }