Google components
Bundles contain custom components that support specific third-party integrations with Langflow.
This page describes the components that are available in the Google bundle.
BigQuery
Langflow integrates with Google BigQuery through the BigQuery component in the Google bundle, allowing you to execute SQL queries and retrieve data from your BigQuery datasets.
Use the BigQuery component in a flow
To use the BigQuery component in a flow, you need the following:
- A Google Cloud project with the BigQuery API enabled
- A service account with the BigQuery Job User role
- A BigQuery dataset and table
- A running Langflow server
Create a service account with BigQuery access
- Select and enable your Google Cloud project. For more information, see Create a Google Cloud project.
- Create a service account in your Google Cloud project. For more information, see Create a service account.
- 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.
- To generate a new JSON key for the service account, navigate to your service account.
- Click Add Key, and then click Create new key.
- 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.
- Create a new flow in Langflow.
- In Bundles, find the Google BigQuery component, and then add it to your flow.
- In the BigQuery component's Upload Service Account JSON field, click Select file.
- In the My Files pane, select Click or drag files here. Your file browser opens.
- In your file browser, select the service account JSON file, and then click Open.
- 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.
-
Connect Chat Input and Chat Output components to the BigQuery component.
-
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
:_10SELECT film, category, year_film_10FROM `big-query-langflow-project.the_oscar_award.oscar_winners`_10WHERE winner = TRUE_10LIMIT 10Result
_11film category year_film_11The Last Command ACTOR 1927_117th Heaven ACTRESS 1927_11The Dove; ART DIRECTION 1927_11Sunrise CINEMATOGRAPHY 1927_11Sunrise CINEMATOGRAPHY 1927_11Two Arabian Knights DIRECTING (Comedy Picture) 1927_117th Heaven DIRECTING (Dramatic Picture) 1927_11Wings ENGINEERING EFFECTS 1927_11Wings OUTSTANDING PICTURE 1927_11Sunrise UNIQUE AND ARTISTIC PICTURE 1927A successful chat confirms the component can access the BigQuery table.
Google Generative AI
This component generates text using Google Generative AI models.
Google Generative AI parameters
Name | Type | Description |
---|---|---|
Google API Key | SecretString | Input parameter. Your Google API key to use for the Google Generative AI. |
Model | String | Input parameter. The name of the model to use, such as "gemini-pro" . |
Max Output Tokens | Integer | Input parameter. The maximum number of tokens to generate. |
Temperature | Float | Input parameter. Run inference with this temperature. |
Top K | Integer | Input parameter. Consider the set of top K most probable tokens. |
Top P | Float | Input parameter. The maximum cumulative probability of tokens to consider when sampling. |
N | Integer | Input parameter. Number of chat completions to generate for each prompt. |
model | LanguageModel | Output parameter. An instance of ChatGoogleGenerativeAI configured with the specified parameters. |
Google Generative AI Embeddings
The Google Generative AI Embeddings component connects to Google's generative AI embedding service using the GoogleGenerativeAIEmbeddings class from the langchain-google-genai
package.
For more information about using embedding model components in flows, see Embedding model components.
Google Generative AI Embeddings parameters
Name | Display Name | Info |
---|---|---|
api_key | API Key | Input parameter. The secret API key for accessing Google's generative AI service. Required. |
model_name | Model Name | Input parameter. The name of the embedding model to use. Default: "models/text-embedding-004". |
embeddings | Embeddings | Output parameter. The built GoogleGenerativeAIEmbeddings object. |
Google Search API
This component allows you to call the Google Search API.
Google Search API parameters
Name | Type | Description |
---|---|---|
google_api_key | SecretString | Input parameter. A Google API key for authentication. |
google_cse_id | SecretString | Input parameter. A Google Custom Search Engine ID. |
input_value | String | Input parameter. The search query input. |
k | Integer | Input parameter. The number of search results to return. |
results | List[Data] | Output parameter. A list of search results. |
tool | Tool | Output parameter. A Google Search tool for use in LangChain. |
Other Google Search components
Langflow includes multiple components that support Google Search, such as the following:
- Apify Actors component
- SearchApi component
- Serper Google Search API component
- News Search component
- Web Search component
Google Vertex AI
For information about Vertex AI components, see the Vertex AI bundle.
Legacy Google components
Legacy components are longer supported and can be removed in a future release. You can continue to use them in existing flows, but it is recommended that you replace them with supported components as soon as possible. Suggested replacements are included in the Legacy banner on components in your flows. They are also given in release notes and Langflow documentation whenever possible.
If you aren't sure how to replace a legacy component, Search for components by provider, service, or component name. The component may have been deprecated in favor of a completely new component, a similar component, or a new version of the same component in a different category.
If there is no obvious replacement, consider whether another component can be adapted to your use case. For example, many Core components provide generic functionality that can support multiple providers and use cases, such as the API Request component.
If neither of these options are viable, you could use the legacy component's code to create your own custom component, or start a discussion about the legacy component.
To discourage use of legacy components in new flows, these components are hidden by default. In the visual editor, you can click Component settings to toggle the Legacy filter.
The following Google components are in legacy status:
Google OAuth Token
The Google OAuth Token component was deprecated in Langflow 1.4.0.
To connect your flows to Google OAuth services, use Composio components.
Gmail Loader
This component loads emails from Gmail using Service Account JSON credentials and label ID filters.
As an alternative, you can use Composio components to connect your flows to Google services.
Google Drive Loader
This component loads documents from Google Drive using Service Account JSON credentials and document ID filters.
While there is no direct replacement, consider using the API Request component to call the Google Drive API.
Google Drive Search
This component searches Google Drive using Service Account JSON credentials and various query strings and filters.
While there is no direct replacement, consider using the API Request component to call the Google Drive API.