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 Agent
2from kern.tools.google_bigquery import GoogleBigQueryTools
3
4agent = 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)
13
14agent.print_response("List all tables in the dataset and describe the sales table", stream=True)

Toolkit Params

ParameterTypeDefaultDescription
datasetstrNoneBigQuery dataset name (required).
projectOptional[str]NoneGoogle Cloud project ID. Uses GOOGLE_CLOUD_PROJECT.
locationOptional[str]NoneBigQuery location. Uses GOOGLE_CLOUD_LOCATION.
credentialsOptional[Any]NoneGoogle Cloud credentials object.
enable_list_tablesboolTrueEnable table listing functionality.
enable_describe_tableboolTrueEnable table description functionality.
enable_run_sql_queryboolTrueEnable SQL query execution functionality.

Toolkit Functions

FunctionDescription
list_tablesList all tables in the specified BigQuery dataset.
describe_tableGet detailed schema information about a specific table.
run_sql_queryExecute SQL queries on BigQuery datasets.

Developer Resources