mirror of
https://github.com/hwchase17/langchain
synced 2024-10-29 17:07:25 +00:00
100 lines
3.2 KiB
Plaintext
100 lines
3.2 KiB
Plaintext
# Google
|
|
|
|
## Document Loader
|
|
### Google BigQuery
|
|
|
|
>[Google BigQuery](https://cloud.google.com/bigquery) is a serverless and cost-effective enterprise data warehouse that works across clouds and scales with your data.
|
|
`BigQuery` is a part of the `Google Cloud Platform`.
|
|
|
|
First, you need to install `google-cloud-bigquery` python package.
|
|
|
|
```bash
|
|
pip install google-cloud-bigquery
|
|
```
|
|
|
|
See a [usage example](/docs/integrations/document_loaders/google_bigquery).
|
|
|
|
```python
|
|
from langchain.document_loaders import BigQueryLoader
|
|
```
|
|
|
|
### Google Cloud Storage
|
|
|
|
>[Google Cloud Storage](https://en.wikipedia.org/wiki/Google_Cloud_Storage) is a managed service for storing unstructured data.
|
|
|
|
First, you need to install `google-cloud-storage` python package.
|
|
|
|
```bash
|
|
pip install google-cloud-storage
|
|
```
|
|
|
|
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).
|
|
|
|
```python
|
|
from langchain.document_loaders import GCSDirectoryLoader
|
|
```
|
|
See a [usage example](/docs/integrations/document_loaders/google_cloud_storage_file).
|
|
|
|
```python
|
|
from langchain.document_loaders import GCSFileLoader
|
|
```
|
|
|
|
### 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.
|
|
|
|
First, you need to install several python package.
|
|
|
|
```bash
|
|
pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib
|
|
```
|
|
|
|
See a [usage example and authorizing instructions](/docs/integrations/document_loaders/google_drive.html).
|
|
|
|
```python
|
|
from langchain.document_loaders import GoogleDriveLoader
|
|
```
|
|
|
|
## Vector Store
|
|
### Google Vertex AI MatchingEngine
|
|
|
|
> [Google Vertex AI Matching Engine](https://cloud.google.com/vertex-ai/docs/matching-engine/overview) 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 several python packages.
|
|
|
|
```bash
|
|
pip install tensorflow google-cloud-aiplatform tensorflow-hub tensorflow-text
|
|
```
|
|
|
|
See a [usage example](/docs/integrations/vectorstores/matchingengine).
|
|
|
|
```python
|
|
from langchain.vectorstores import MatchingEngine
|
|
```
|
|
|
|
## Tools
|
|
### Google Search
|
|
|
|
- Install requirements with `pip install google-api-python-client`
|
|
- 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
|
|
|
|
There exists a GoogleSearchAPIWrapper utility which wraps this API. To import this utility:
|
|
|
|
```python
|
|
from langchain.utilities import GoogleSearchAPIWrapper
|
|
```
|
|
For a more detailed walkthrough of this wrapper, see [this notebook](/docs/integrations/tools/google_search.html).
|
|
|
|
You can easily load this wrapper as a Tool (to use with an Agent). You can do this with:
|
|
```python
|
|
from langchain.agents import load_tools
|
|
tools = load_tools(["google-search"])
|
|
```
|