> ## Documentation Index
> Fetch the complete documentation index at: https://spacesail.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Google BigQuery Tools

## Code

```python cookbook/tools/google_bigquery_tools.py theme={null}
from agno.agent import Agent
from agno.tools.google_bigquery import GoogleBigQueryTools

agent = Agent(
    instructions=[
        "You are a data analyst assistant that helps with BigQuery operations",
        "Execute SQL queries to analyze large datasets",
        "Provide insights and summaries of query results",
    ],
    tools=[GoogleBigQueryTools(dataset="your_dataset_name")],
    markdown=True,
)

agent.print_response("List all tables in the dataset and describe the sales table")
```

## Usage

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Set your credentials">
    ```bash theme={null}
    export GOOGLE_CLOUD_PROJECT=your-project-id
    export GOOGLE_CLOUD_LOCATION=US
    export GOOGLE_APPLICATION_CREDENTIALS=path/to/credentials.json
    export OPENAI_API_KEY=xxx
    ```
  </Step>

  <Step title="Install libraries">
    ```bash theme={null}
    pip install -U google-cloud-bigquery openai agno
    ```
  </Step>

  <Step title="Run Agent">
    <CodeGroup>
      ```bash Mac theme={null}
      python cookbook/tools/google_bigquery_tools.py
      ```

      ```bash Windows theme={null}
      python cookbook/tools/google_bigquery_tools.py
      ```
    </CodeGroup>
  </Step>
</Steps>
