Skip to content

feat(tools/conversational-analytics): Allow optional dataAgent#2490

Open
efantasia wants to merge 14 commits intogoogleapis:mainfrom
efantasia:ef/ca-data-agent
Open

feat(tools/conversational-analytics): Allow optional dataAgent#2490
efantasia wants to merge 14 commits intogoogleapis:mainfrom
efantasia:ef/ca-data-agent

Conversation

@efantasia
Copy link
Copy Markdown

Description

Modifies both the bigquery-conversational-analytics and looker-conversational-analytics tools to accept an optional dataAgent configuration parameter. The Data Agent provides additional context and settings: https://docs.cloud.google.com/gemini/docs/conversational-analytics-api/build-agent-http#create_a_data_agent

PR Checklist

  • 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>

@efantasia efantasia requested review from a team February 17, 2026 23:40
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @efantasia, 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 enhances the BigQuery and Looker conversational analytics tools by introducing an optional dataAgent configuration. This allows users to leverage external data agents for providing context to the conversational analytics API, offering a more flexible and powerful way to interact with data compared to solely relying on inline context. The change involves updating tool configurations, API payload structures, and relevant documentation.

Highlights

  • Optional Data Agent Support: Introduced an optional dataAgent parameter for both BigQuery and Looker conversational analytics tools, allowing external context to be provided to the conversational analytics API.
  • API Payload Flexibility: Modified the internal Go structs and logic to dynamically construct the API payload, choosing between InlineContext or DataAgentContext based on the presence of the dataAgent.
  • Documentation Updates: Expanded documentation for both BigQuery and Looker conversational analytics tools to guide users on configuring and utilizing the new dataAgent feature.
Changelog
  • docs/en/resources/tools/bigquery/bigquery-conversational-analytics.md
    • Added a new section explaining how to use a Data Agent.
    • Updated the reference table to include the optional dataAgent field.
  • docs/en/resources/tools/looker/looker-conversational-analytics.md
    • Added a new section explaining how to use a Data Agent.
    • Updated the reference table to include the optional dataAgent field.
  • internal/tools/bigquery/bigqueryconversationalanalytics/bigqueryconversationalanalytics.go
    • Introduced a new DataAgentContext struct to encapsulate data agent information.
    • Modified the CAPayload struct to allow for either an optional InlineContext or DataAgentContext.
    • Added a DataAgent field to the Config struct to store the data agent resource name.
    • Updated the Invoke method to conditionally populate the CAPayload with DataAgentContext if a data agent is configured, otherwise using InlineContext.
  • internal/tools/looker/lookerconversationalanalytics/lookerconversationalanalytics.go
    • Introduced a new DataAgentContext struct to encapsulate data agent information.
    • Modified the CAPayload struct to allow for either an optional InlineContext or DataAgentContext.
    • Added a DataAgent field to the Config struct to store the data agent resource name.
    • Updated the Invoke method to conditionally populate the CAPayload with DataAgentContext if a data agent is configured, otherwise using InlineContext.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
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
Copy Markdown
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 an optional dataAgent parameter for the bigquery-conversational-analytics and looker-conversational-analytics tools, allowing users to leverage pre-configured data agents for context. While the implementation correctly handles conditional logic for the API payload, a significant security concern exists: the BigQuery tool is vulnerable to prompt injection due to concatenating instructions with user input. It is strongly recommended to update the BigQuery tool to use the systemInstruction field, aligning with the Looker tool's more secure approach. Also, a minor typo was noted in the documentation.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@drstrangelooker
Copy link
Copy Markdown
Contributor

/gcbrun

@drstrangelooker
Copy link
Copy Markdown
Contributor

/gcbrun

@efantasia
Copy link
Copy Markdown
Author

Hi @drstrangelooker - thanks for reviewing! This is my first contribution here. JFYI I've tested the dataAgent with BigQuery but do not have a Looker Data Agent to test against.

@drstrangelooker
Copy link
Copy Markdown
Contributor

/gcbrun

@drstrangelooker drstrangelooker added the tests: run Label to trigger Github Action tests. label Feb 20, 2026
@github-actions github-actions bot removed the tests: run Label to trigger Github Action tests. label Feb 20, 2026
Copy link
Copy Markdown
Contributor

@drstrangelooker drstrangelooker left a comment

Choose a reason for hiding this comment

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

I fixed the lint issues. LGTM

@duwenxin99 duwenxin99 requested review from a team as code owners March 8, 2026 19:22
@duwenxin99
Copy link
Copy Markdown
Contributor

/gcbrun

@duwenxin99 duwenxin99 added the tests: run Label to trigger Github Action tests. label Mar 8, 2026
@duwenxin99 duwenxin99 enabled auto-merge (squash) March 8, 2026 19:22
@github-actions github-actions bot removed the tests: run Label to trigger Github Action tests. label Mar 8, 2026
@duwenxin99
Copy link
Copy Markdown
Contributor

Hi @Genesis929, could you review this PR for the BQ change? Thanks!

Copy link
Copy Markdown
Contributor

@Genesis929 Genesis929 left a comment

Choose a reason for hiding this comment

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

LGTM except maybe we need integration test. Meanwhile may need @shobsi to approve this for bigquery?

@drstrangelooker
Copy link
Copy Markdown
Contributor

/gcbrun

@github-actions
Copy link
Copy Markdown
Contributor

@drstrangelooker
Copy link
Copy Markdown
Contributor

/gcbrun

@github-actions
Copy link
Copy Markdown
Contributor

@drstrangelooker
Copy link
Copy Markdown
Contributor

/gcbrun

@github-actions
Copy link
Copy Markdown
Contributor

@drstrangelooker
Copy link
Copy Markdown
Contributor

/gcbrun

@github-actions
Copy link
Copy Markdown
Contributor

@drstrangelooker
Copy link
Copy Markdown
Contributor

/gcbrun

@drstrangelooker
Copy link
Copy Markdown
Contributor

someone from @googleapis/toolbox-bigquery-team needs to approve now

@duwenxin99 duwenxin99 added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Mar 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p2 Moderately-important priority. Fix may not be included in next release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants