-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat(bigquery): add conversational analytics tools for Data Agents #2517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
7b95bfd
feat(bigquery): add conversational analytics tools for Data Agents
Genesis929 a343dd1
test(conversationalanalytics): fix unit tests for data agent tools
Genesis929 a6f072e
chore: cleanup and security improvements based on review
Genesis929 265d048
test(prebuiltconfigs): update expected tool sources to include bigque…
Genesis929 77f307b
test(bigquery): fix linting issues in integration tests
Genesis929 0b655f2
resolve unused function lint error
Genesis929 74d3011
Merge branch 'main' into ca_tools
Genesis929 48a915a
Merge branch 'main' into ca_tools
Genesis929 4f73ff7
Simplify ask_data_agent response handling to align with CA tools and …
Genesis929 812906c
Synchronize error handling across Conversational Analytics tools to u…
Genesis929 ac9cc09
Merge remote-tracking branch 'origin/main' into ca_tools
Genesis929 3c0d1a0
Merge branch 'main' into ca_tools
Genesis929 9580c9f
Update BigQuery Conversational Analytics documentation and prebuilt c…
Genesis929 04918b3
doc location fix
Genesis929 8fcf73f
Merge branch 'main' into ca_tools
Genesis929 3419a78
Merge branch 'main' into ca_tools
Genesis929 3d4c9e7
Merge branch 'main' into ca_tools
Genesis929 8bbfd13
replace source
Genesis929 696b27e
chore: merge origin/main and refactor prebuilt config docs for cloudgda
Genesis929 3d84bd6
fix test
Genesis929 19f2cab
update description
Genesis929 8537673
fix: enable native api for cloudgda integration tests
Genesis929 80afa8b
fix test: enable api endpoint and remove non-existent flag
Genesis929 d792ce5
fix: use listAccessible custom method for data agents discovery
Genesis929 9cff582
Merge branch 'main' into ca_tools
Genesis929 62978dd
Merge branch 'main' into ca_tools
Genesis929 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
internal/prebuiltconfigs/tools/bigquery-conversational-analytics-with-data-agent.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # Copyright 2026 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| sources: | ||
| bigquery-source: | ||
| kind: "bigquery" | ||
| project: ${BIGQUERY_PROJECT} | ||
| location: ${BIGQUERY_LOCATION:} | ||
| useClientOAuth: ${BIGQUERY_USE_CLIENT_OAUTH:false} | ||
| scopes: ${BIGQUERY_SCOPES:} | ||
| maxQueryResultRows: ${BIGQUERY_MAX_QUERY_RESULT_ROWS:50} | ||
|
|
||
| tools: | ||
| list-accessible-data-agents: | ||
| kind: conversational-analytics-list-accessible-data-agents | ||
| source: bigquery-source | ||
| description: | | ||
| List all available BigQuery Data Agents that can be used for | ||
| conversational analytics in the current project. | ||
|
|
||
| get-data-agent-info: | ||
| kind: conversational-analytics-get-data-agent-info | ||
| source: bigquery-source | ||
| description: | | ||
| Retrieve detailed information about a specific BigQuery Data Agent | ||
| using its ID. | ||
|
|
||
| ask-data-agent: | ||
| kind: conversational-analytics-ask-data-agent | ||
| source: bigquery-source | ||
| description: | | ||
| Perform natural language data analysis and get insights by interacting | ||
| with a specific BigQuery Data Agent. This tool allows for conversational | ||
| queries and provides detailed responses based on the agent's configured | ||
| data sources. | ||
|
|
||
| toolsets: | ||
| conversational_analytics_tools: | ||
| - list-accessible-data-agents | ||
| - get-data-agent-info | ||
| - ask-data-agent | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
.../conversationalanalyticsaskdataagent/conversational-analytics-ask-data-agent.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| --- | ||
| title: "conversational-analytics-ask-data-agent" | ||
| type: docs | ||
| weight: 1 | ||
| description: > | ||
| A "conversational-analytics-ask-data-agent" tool allows conversational interaction with a Conversational Analytics source. | ||
| aliases: | ||
| - /resources/tools/conversational-analytics-ask-data-agent | ||
| --- | ||
|
|
||
| ## About | ||
|
|
||
| A `conversational-analytics-ask-data-agent` tool allows you to ask questions about | ||
| your data in natural language. | ||
|
|
||
| This function takes a user's question (which can include conversational history | ||
| for context) and references to a specific BigQuery Data Agent, and sends them to a | ||
| stateless conversational API. | ||
|
|
||
| The API uses a GenAI agent to understand the question, generate and execute SQL | ||
| queries and Python code, and formulate an answer. This function returns a | ||
| detailed, sequential log of this entire process, which includes any generated | ||
| SQL or Python code, the data retrieved, and the final text answer. | ||
|
|
||
| **Note**: This tool requires additional setup in your project. Please refer to | ||
| the official Conversational Analytics API | ||
| documentation | ||
| for instructions. | ||
|
|
||
| It's compatible with the following sources: | ||
|
|
||
| - conversational-analytics | ||
|
|
||
| `conversational-analytics-ask-data-agent` accepts the following parameters: | ||
|
|
||
| - **`user_query_with_context`:** The question to ask the agent, potentially | ||
| including conversation history for context. | ||
| - **`data_agent_id`:** The ID of the data agent to ask. | ||
|
|
||
| ## Example | ||
|
|
||
| ```yaml | ||
| tools: | ||
| ask_data_agent: | ||
| kind: conversational-analytics-ask-data-agent | ||
| source: my-conversational-analytics-source | ||
| description: | | ||
| Perform natural language data analysis and get insights by interacting | ||
| with a specific BigQuery Data Agent. This tool allows for conversational | ||
| queries and provides detailed responses based on the agent's configured | ||
| data sources. | ||
| ``` | ||
|
|
||
| ## Reference | ||
|
|
||
| | **field** | **type** | **required** | **description** | | ||
| |-------------|:--------:|:------------:|----------------------------------------------------| | ||
| | kind | string | true | Must be "conversational-analytics-ask-data-agent". | | ||
| | source | string | true | Name of the source for chat. | | ||
| | description | string | true | Description of the tool that is passed to the LLM. | |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.