Below is a concise README.md
:
bigquery_agent
creates a Gemini Agents Toolkit-based agent with built-in functions to query a specified BigQuery table.
- Python 3.8+
- Gemini Agents Toolkit
- Google Cloud credentials with BigQuery access
- Vertex AI enabled for your GCP project
pip install bigquery_agent
import vertexai
from bigquery_agent import create_bigquery_agent
vertexai.init(project="YOUR_GCP_PROJECT", location="us-west1")
agent = create_bigquery_agent(
bigquery_project_id="YOUR_BQ_PROJECT",
dataset_id="YOUR_DATASET",
table_id="YOUR_TABLE",
model_name="gemini-2.0-flash-exp",
system_instruction="Query the todos table as needed."
)
response = agent.send_message("Show me all todos from the database")[0]
print(response)
This agent can inspect the schema (get_schema
), run queries (run_query
), and get table references (get_table_ref
) using the provided BigQuery credentials and Vertex AI model.
For more details on creating and using agents, refer to the Gemini Agents Toolkit README.