diff --git a/docs/docs/Integrations/Google/integrations-google-big-query.md b/docs/docs/Integrations/Google/integrations-google-big-query.md new file mode 100644 index 000000000..216501f85 --- /dev/null +++ b/docs/docs/Integrations/Google/integrations-google-big-query.md @@ -0,0 +1,85 @@ +--- +title: Integrate Google BigQuery with Langflow +slug: /integrations-google-big-query +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +Langflow integrates with [Google BigQuery](https://cloud.google.com/bigquery) through the BigQuery component, allowing you to execute SQL queries and retrieve data from your BigQuery datasets. + +## Prerequisites + +* A [Google Cloud project](https://developers.google.com/workspace/guides/create-project) with the BigQuery API enabled +* A [service account](https://developers.google.com/workspace/guides/create-credentials#service-account) with the **BigQuery Job User** role +* A [BigQuery dataset and table](https://cloud.google.com/bigquery/docs/datasets-intro) + +## Create a service account with BigQuery access + +1. Select and enable your Google Cloud project. +For more information, see [Create a Google Cloud project](https://developers.google.com/workspace/guides/create-project). +2. Create a service account in your Google Cloud project. +For more information, see [Create a service account](https://developers.google.com/workspace/guides/create-credentials#service-account). +3. Assign the **BigQuery Job User** role to your new account. +This role allows Langflow to access BigQuery resources with the service account. +You may also need to allow access to your BigQuery dataset. +For more information, see [BigQuery access control with IAM](https://cloud.google.com/bigquery/docs/access-control). +4. To generate a new JSON key for the service account, navigate to your service account. +5. Click **Add Key**, and then click **Create new key**. +6. Under **Key type**, select **JSON**, and then click **Create**. +A JSON private key file is downloaded to your machine. +Now that you have a service account and a JSON private key, you need to configure the credentials in the Langflow BigQuery component. + +## Configure credentials in the Langflow component + +With your service account configured and your credentials JSON file created, follow these steps to authenticate the Langflow application. + +1. Create a new project in Langflow. +2. From the components sidebar, drag and drop the BigQuery component to your workspace. +3. In the BigQuery component's **Upload Service Account JSON** field, click **Select file**. +4. In the **My Files** pane, select **Click or drag files here**. +Your file browser opens. +5. In your file browser, select the service account JSON file, and then click **Open**. +6. In the **My Files** pane, select your service account JSON file, and then click **Select files**. +The BigQuery component can now query your datasets and tables using your service account JSON file. + +## Query a BigQuery dataset + +With your component credentials configured, query your BigQuery datasets and tables to confirm connectivity. + +1. Connect a **Chat input** and **Chat output** component to the BigQuery component. +The flow looks like this: +![BigQuery component connected to chat input and output](/img/google/integrations-bigquery.png) +2. Open the **Playground**, and then submit a valid SQL query. +This example queries a table of Oscar winners stored within a BigQuery dataset called `the_oscar_award`. + + + + ```sql + SELECT film, category, year_film + FROM `big-query-langflow-project.the_oscar_award.oscar_winners` + WHERE winner = TRUE + LIMIT 10 + ``` + + + + + ```text + film category year_film + The Last Command ACTOR 1927 + 7th Heaven ACTRESS 1927 + The Dove; ART DIRECTION 1927 + Sunrise CINEMATOGRAPHY 1927 + Sunrise CINEMATOGRAPHY 1927 + Two Arabian Knights DIRECTING (Comedy Picture) 1927 + 7th Heaven DIRECTING (Dramatic Picture) 1927 + Wings ENGINEERING EFFECTS 1927 + Wings OUTSTANDING PICTURE 1927 + Sunrise UNIQUE AND ARTISTIC PICTURE 1927 + ``` + + + + A successful chat confirms the component can access the BigQuery table. + diff --git a/docs/docs/Integrations/Google/integrations-setup-google-cloud-vertex-ai-langflow.md b/docs/docs/Integrations/Google/integrations-setup-google-cloud-vertex-ai-langflow.md index e71c552f4..c96f94179 100644 --- a/docs/docs/Integrations/Google/integrations-setup-google-cloud-vertex-ai-langflow.md +++ b/docs/docs/Integrations/Google/integrations-setup-google-cloud-vertex-ai-langflow.md @@ -1,7 +1,6 @@ --- title: Integrate Google Cloud Vertex AI with Langflow slug: /integrations-setup-google-cloud-vertex-ai-langflow -description: "A comprehensive guide on creating a Google OAuth app, obtaining tokens, and integrating them with Langflow's Google components." --- Langflow integrates with the [Google Vertex AI API](https://console.cloud.google.com/marketplace/product/google/aiplatform.googleapis.com) for authenticating the [Vertex AI embeddings model](/components-embedding-models#vertexai-embeddings) and [Vertex AI](/components-models#vertexai) components. diff --git a/docs/docs/Integrations/Google/integrations-setup-google-oauth-langflow.md b/docs/docs/Integrations/Google/integrations-setup-google-oauth-langflow.md index ce283b89e..2aed026ef 100644 --- a/docs/docs/Integrations/Google/integrations-setup-google-oauth-langflow.md +++ b/docs/docs/Integrations/Google/integrations-setup-google-oauth-langflow.md @@ -1,8 +1,6 @@ --- title: Integrate Google OAuth with Langflow slug: /integrations-setup-google-oauth-langflow - -description: "A comprehensive guide on creating a Google OAuth app, obtaining tokens, and integrating them with Langflow's Google components." --- import TOCInline from '@theme/TOCInline'; diff --git a/docs/sidebars.js b/docs/sidebars.js index dc3a0d65f..85474288a 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -198,6 +198,7 @@ module.exports = { items: [ 'Integrations/Google/integrations-setup-google-oauth-langflow', 'Integrations/Google/integrations-setup-google-cloud-vertex-ai-langflow', + 'Integrations/Google/integrations-google-big-query', ], }, "Integrations/integrations-langfuse", diff --git a/docs/static/img/google/integrations-bigquery.png b/docs/static/img/google/integrations-bigquery.png new file mode 100644 index 000000000..01b61ca21 Binary files /dev/null and b/docs/static/img/google/integrations-bigquery.png differ