Skip to content

feat(bigquery): add conversational analytics tools for Data Agents#2517

Open
Genesis929 wants to merge 7 commits intogoogleapis:mainfrom
Genesis929:ca_tools
Open

feat(bigquery): add conversational analytics tools for Data Agents#2517
Genesis929 wants to merge 7 commits intogoogleapis:mainfrom
Genesis929:ca_tools

Conversation

@Genesis929
Copy link
Contributor

Implements new tools to interact with BigQuery Data Agents and aligns BigQuery source method names with other sources for future cross-source compatibility.

  • Add three new tools: 'ask_data_agent', 'get_data_agent_info', and 'list_accessible_data_agents' under 'conversationalanalytics'.
  • Rename BigQuery source methods to 'GoogleCloudProject' and 'GoogleCloudLocation' to unify interface with other source types.
  • Update 'GoogleCloudTokenSourceWithScope' to support flexible scope parameterization.
  • Update existing BigQuery tools to use consistent source method names.
  • Add 'bigquery-conversational-analytics-with-data-agent' prebuilt config.
  • Include comprehensive integration tests for Data Agent tools.
  • Update documentation for the new prebuilt toolset.

Description

Should include a concise description of the changes (bug or feature), it's
impact, along with a summary of the solution

PR Checklist

Thank you for opening a Pull Request! Before submitting your PR, there are a
few things you can do to make sure it goes smoothly:

  • Make sure you reviewed
    CONTRIBUTING.md
  • Make sure to open an issue as a
    bug/issue
    before writing your code! That way we can discuss the change, evaluate
    designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)
  • Make sure to add ! if this involve a breaking change

🛠️ Fixes #<issue_number_goes_here>

Implements new tools to interact with BigQuery Data Agents and aligns
BigQuery source method names with other sources for future cross-source
compatibility.

- Add three new tools: 'ask_data_agent', 'get_data_agent_info', and
  'list_accessible_data_agents' under 'conversationalanalytics'.
- Rename BigQuery source methods to 'GoogleCloudProject' and
  'GoogleCloudLocation' to unify interface with other source types.
- Update 'GoogleCloudTokenSourceWithScope' to support flexible scope
  parameterization.
- Update existing BigQuery tools to use consistent source method names.
- Add 'bigquery-conversational-analytics-with-data-agent' prebuilt config.
- Include comprehensive integration tests for Data Agent tools.
- Update documentation for the new prebuilt toolset.
- Update test YAML format to use standard 'kind' and 'type' fields.
- Switch to 'server.UnmarshalResourceConfig' for correct interface decoding.
- Fix struct field names from 'Kind' to 'Type'.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Genesis929, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the BigQuery integration by introducing a suite of conversational analytics tools that leverage BigQuery Data Agents. The primary goal is to enable natural language interaction with BigQuery data, facilitating data analysis and insights through AI agents. Concurrently, it refactors BigQuery source method names to align with a more generic 'GoogleCloud' prefix, improving consistency and paving the way for broader cloud service compatibility.

Highlights

  • New Conversational Analytics Tools: Introduced three new tools: 'ask_data_agent', 'get_data_agent_info', and 'list_accessible_data_agents', enabling natural language interaction with BigQuery Data Agents.
  • Standardized BigQuery Source Method Names: Renamed BigQuery-specific source methods (e.g., 'BigQueryProject') to more generic 'GoogleCloud' prefixes (e.g., 'GoogleCloudProject') for improved consistency and future cross-source compatibility.
  • Flexible Scope Parameterization: Updated the 'GoogleCloudTokenSourceWithScope' method to accept a single scope string, allowing for more adaptable authentication configurations.
  • New Prebuilt Configuration: Added a new prebuilt configuration, 'bigquery-conversational-analytics-with-data-agent', to simplify the setup and deployment of the new conversational analytics tools.
  • Comprehensive Integration Tests: Included extensive integration tests for the newly added Data Agent tools, covering various authentication scenarios and ensuring their correct functionality.
  • Updated Documentation: Documentation has been updated to reflect the new tools, their usage, required permissions, and the new prebuilt configuration.
Changelog
  • cmd/internal/imports.go
    • Added imports for the new conversational analytics tools.
  • docs/en/reference/prebuilt-tools.md
    • Documented the new BIGQUERY_MAX_QUERY_RESULT_ROWS environment variable.
    • Introduced a new section for the bigquery-conversational-analytics-with-data-agent prebuilt configuration, detailing its tools and permissions.
  • internal/prebuiltconfigs/tools/bigquery-conversational-analytics-with-data-agent.yaml
    • Created a new YAML configuration file to define the bigquery-conversational-analytics-with-data-agent prebuilt toolset, including its sources and the three new conversational analytics tools.
  • internal/sources/bigquery/bigquery.go
    • Renamed BigQueryProject to GoogleCloudProject.
    • Renamed BigQueryLocation to GoogleCloudLocation.
    • Renamed BigQueryTokenSourceWithScope to GoogleCloudTokenSourceWithScope and modified it to accept a single scope string instead of a slice.
  • internal/tools/bigquery/bigqueryconversationalanalytics/bigqueryconversationalanalytics.go
    • Updated the compatibleSource interface and the Invoke method to use the newly renamed GoogleCloud prefixed methods and the single scope parameter for token sourcing.
  • internal/tools/bigquery/bigquerygetdatasetinfo/bigquerygetdatasetinfo.go
    • Modified the compatibleSource interface and Initialize method to utilize the GoogleCloudProject method.
  • internal/tools/bigquery/bigquerygettableinfo/bigquerygettableinfo.go
    • Updated the compatibleSource interface and Initialize method to use the GoogleCloudProject method.
  • internal/tools/bigquery/bigquerylistdatasetids/bigquerylistdatasetids.go
    • Changed the compatibleSource interface and Initialize method to use the GoogleCloudProject method.
  • internal/tools/bigquery/bigquerylisttableids/bigquerylisttableids.go
    • Modified the compatibleSource interface and Initialize method to utilize the GoogleCloudProject method.
  • internal/tools/bigquery/bigquerysearchcatalog/bigquerysearchcatalog.go
    • Updated the compatibleSource interface and Invoke method to use the GoogleCloudProject method.
  • internal/tools/conversationalanalytics/conversationalanalyticsaskdataagent/conversational-analytics-ask-data-agent.md
    • Added new markdown documentation for the conversational-analytics-ask-data-agent tool, detailing its purpose, parameters, and usage.
  • internal/tools/conversationalanalytics/conversationalanalyticsaskdataagent/conversationalanalyticsaskdataagent.go
    • Implemented the conversational-analytics-ask-data-agent tool, including its configuration, invocation logic for interacting with the Gemini Data Analytics API, and response handling.
  • internal/tools/conversationalanalytics/conversationalanalyticsaskdataagent/conversationalanalyticsaskdataagent_test.go
    • Added unit tests to verify the correct parsing and configuration of the conversational-analytics-ask-data-agent tool from YAML.
  • internal/tools/conversationalanalytics/conversationalanalyticsgetdataagentinfo/conversational-analytics-get-data-agent-info.md
    • Added new markdown documentation for the conversational-analytics-get-data-agent-info tool, describing its function and parameters.
  • internal/tools/conversationalanalytics/conversationalanalyticsgetdataagentinfo/conversational-analytics-list-accessible-data-agents.md
    • Added new markdown documentation for the conversational-analytics-list-accessible-data-agents tool, outlining its purpose and lack of parameters.
  • internal/tools/conversationalanalytics/conversationalanalyticsgetdataagentinfo/conversationalanalyticsgetdataagentinfo.go
    • Implemented the conversational-analytics-get-data-agent-info tool, including its configuration and logic for retrieving information about a specific data agent.
  • internal/tools/conversationalanalytics/conversationalanalyticsgetdataagentinfo/conversationalanalyticsgetdataagentinfo_test.go
    • Added unit tests to ensure proper parsing and configuration of the conversational-analytics-get-data-agent-info tool from YAML.
  • internal/tools/conversationalanalytics/conversationalanalyticslistaccessibledataagents/conversationalanalyticslistaccessibledataagents.go
    • Implemented the conversational-analytics-list-accessible-data-agents tool, including its configuration and logic for listing available data agents.
  • internal/tools/conversationalanalytics/conversationalanalyticslistaccessibledataagents/conversationalanalyticslistaccessibledataagents_test.go
    • Added unit tests to confirm the correct parsing and configuration of the conversational-analytics-list-accessible-data-agents tool from YAML.
  • tests/bigquery/bigquery_integration_test.go
    • Removed the runBigQuerySearchCatalogToolInvokeTest call from TestBigQueryToolEndpoints.
    • Introduced TestBigQueryConversationalAnalyticsTools, which includes setup for BigQuery datasets and data agents, and integration tests for list_accessible_data_agents, get_data_agent_info, and ask_data_agent tools, covering various authentication scenarios.
Activity
  • Genesis929 initiated this pull request to introduce conversational analytics capabilities for BigQuery Data Agents.
  • The PR includes the implementation of three new tools: 'ask_data_agent', 'get_data_agent_info', and 'list_accessible_data_agents'.
  • Method names within the BigQuery source were refactored for better consistency across different data sources.
  • A new prebuilt configuration was added to simplify the deployment of these new tools.
  • Comprehensive integration tests have been added to validate the functionality of the new Data Agent tools.
  • Relevant documentation has been updated to guide users on the new features.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces new tools for interacting with BigQuery Data Agents and unifies BigQuery source method names. A high-severity path traversal vulnerability was identified in the URL construction of the get-data-agent-info tool, along with information leakage in error handling and a lack of dataset-level access controls, which could lead to unauthorized resource access. Additionally, the review identified areas for improvement related to redundant location fallback logic, inconsistent constant usage, and the format of returned data.

Fixed sensitive info leaks in errors, added URL escaping, and unified
client identification headers across new tools.
…ry conversational analytics

This fix addresses a failure in the prebuiltconfigs unit tests caused by
adding the new BigQuery Data Agent configuration file.
@Genesis929 Genesis929 added the tests: run Label to trigger Github Action tests. label Feb 19, 2026
@github-actions github-actions bot removed the tests: run Label to trigger Github Action tests. label Feb 19, 2026
@Genesis929 Genesis929 added the tests: run Label to trigger Github Action tests. label Feb 19, 2026
@github-actions github-actions bot removed the tests: run Label to trigger Github Action tests. label Feb 19, 2026
@Genesis929 Genesis929 marked this pull request as ready for review February 19, 2026 20:32
@Genesis929 Genesis929 requested review from a team February 19, 2026 20:32
@Genesis929 Genesis929 added the tests: run Label to trigger Github Action tests. label Feb 19, 2026
@github-actions github-actions bot removed the tests: run Label to trigger Github Action tests. label Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants