Google BigQuery
GoogleBigQueryTools enables agents to interact with Google BigQuery for large-scale data analysis and SQL queries.
Example
The following agent can query and analyze BigQuery datasets:
1from kern.agent import Agent2from kern.tools.google_bigquery import GoogleBigQueryTools34agent = Agent(5 instructions=[6 "You are a data analyst assistant that helps with BigQuery operations",7 "Execute SQL queries to analyze large datasets",8 "Provide insights and summaries of query results",9 "Help with data exploration and table analysis",10 ],11 tools=[GoogleBigQueryTools(dataset="your_dataset_name")],12)1314agent.print_response("List all tables in the dataset and describe the sales table", stream=True)Toolkit Params
| Parameter | Type | Default | Description |
|---|---|---|---|
dataset | str | None | BigQuery dataset name (required). |
project | Optional[str] | None | Google Cloud project ID. Uses GOOGLE_CLOUD_PROJECT. |
location | Optional[str] | None | BigQuery location. Uses GOOGLE_CLOUD_LOCATION. |
credentials | Optional[Any] | None | Google Cloud credentials object. |
enable_list_tables | bool | True | Enable table listing functionality. |
enable_describe_table | bool | True | Enable table description functionality. |
enable_run_sql_query | bool | True | Enable SQL query execution functionality. |
Toolkit Functions
| Function | Description |
|---|---|
list_tables | List all tables in the specified BigQuery dataset. |
describe_table | Get detailed schema information about a specific table. |
run_sql_query | Execute SQL queries on BigQuery datasets. |