-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
** Please make sure you read the contribution guide and file the issues in the right place. **
Contribution guide.
Is your feature request related to a problem? Please describe.
Currently, the BigQuery tool in ADK does not provide a way for developers to add custom labels to BigQuery jobs created by their agents. This makes it difficult to:
- Track and monitor BigQuery costs associated with specific agents or use cases
- Organize and filter BigQuery jobs in the Google Cloud Console
- Implement billing attribution and resource organization strategies
- Differentiate between jobs from different environments (dev, staging, production)
While the tool automatically adds an internal adk-bigquery-tool label with the caller_id, there's no mechanism for users to add their own custom labels for tracking and monitoring purposes.
Describe the solution you'd like
Add a labels configuration field to BigQueryToolConfig that allows users to specify custom key-value pairs to be applied to all BigQuery jobs executed by the agent. The solution should:
- Configuration Option: Add an optional labels parameter to BigQueryToolConfig accepting a dictionary of string key-value pairs
- Validation: Ensure labels follow BigQuery's requirements (non-empty string keys, string values)
- Job Application: Automatically apply configured labels to all BigQuery jobs alongside the existing internal labels Documentation: Provide clear documentation on how to use labels for tracking and monitoring
Example usage:
from google.adk.tools.bigquery import BigQueryToolConfig
config = BigQueryToolConfig(
labels={
"environment": "production",
"team": "data-analytics",
"agent": "sales-insights"
}
)